summaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorchaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-25 22:51:27 +0000
committerchaoyingfu <chaoyingfu@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-25 22:51:27 +0000
commitc559c63952b78aea6494c690ed141783fff55e25 (patch)
tree6ecd0978afb0fb7ed48648a6a19859f96c4e1500 /gcc/machmode.h
parentf1a8fafd6ee9b86470ca2ae0434b36335d79f6c2 (diff)
downloadgcc-c559c63952b78aea6494c690ed141783fff55e25.tar.gz
* doc/rtl.texi (Machine Modes): Document QQ, HQ, SQ, DQ, TQ,
UQQ, UHQ, USQ, UDQ, UTQ, HA, SA, DA, TA, UHA, USA, UDA, and UTAmodes. Document MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM. Document GET_MODE_IBIT, and GET_MODE_FBIT. * machmode.h (VECTOR_MODE_P): Test MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (SCALAR_FRACT_MODE_P, SCALAR_UFRACT_MODE_P, ALL_SCALAR_FRACT_MODE_P, SCALAR_ACCUM_MODE_P, SCALAR_UACCUM_MODE_P, ALL_SCALAR_ACCUM_MODE_P, SIGNED_SCALAR_FIXED_POINT_MODE_P, UNSIGNED_SCALAR_FIXED_POINT_MODE_P, ALL_SCALAR_FIXED_POINT_MODE_P, FRACT_MODE_P, UFRACT_MODE_P, ALL_FRACT_MODE_P, ACCUM_MODE_P, UACCUM_MODE_P, ALL_ACCUM_MODE_P, SIGNED_FIXED_POINT_MODE_P, UNSIGNED_FIXED_POINT_MODE_P, ALL_FIXED_POINT_MODE_P): New define. (CLASS_HAS_WIDER_MODES_P): Test MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM. (GET_MODE_IBIT, GET_MODE_FBIT): New define. * mode-classes.def (MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM): New mode classes. * machmode.def: Document FRACT_MODE, UFRACT_MODE, ACCUM_MODE, UACCUM_MODE, ADJUST_IBIT, and ADJUST_FBIT. Add QQ, HQ, SQ, DQ, TQ, UQQ, UHQ, USQ, UDQ, UTQ, HA, SA, DA, TA, UHA, USA, UDA, and UTA. * genmodes.c (struct mode_data): Add ibit and fbit fields. (blank_mode): Initialize ibit and fbit. (adj_ibit, adj_fbit): New to adjust ibit and fbit. (vector_class): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM. (new_adjust): Change required_class to required_class_from and required_class_to for testing within a range. (complete_mode): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (FRACT_MODE, UFRACT_MODE, ACCUM_MODE, UACCUM_MODE): New define. (make_fixed_point_mode): New. (_ADD_ADJUST): Change C to C1 and C2. (ADJUST_BYTESIZE, ADJUST_ALIGNMENT, ADJUST_FLOAT_FORMAT): Change to use a range for machine classes. (ADJUST_IBIT, ADJUST_FBIT): New. (emit_insn_modes_h): Output defines of CONST_MODE_IBIT and CONST_MODE_FBIT. (emit_mode_adjustments): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Emit adjustment for ibit and fbit. (emit_mode_ibit, emit_mode_fbit): New. (emit_insn_modes_c): Add emit_mode_ibit and emit_mode_fbit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126007 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h98
1 files changed, 96 insertions, 2 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 3948fc9388b..68a2071ccff 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -66,7 +66,11 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
/* Nonzero if MODE is a vector mode. */
#define VECTOR_MODE_P(MODE) \
(GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
- || GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT)
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_FRACT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_UFRACT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_ACCUM \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_UACCUM)
/* Nonzero if MODE is a scalar integral mode. */
#define SCALAR_INT_MODE_P(MODE) \
@@ -82,12 +86,94 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
#define DECIMAL_FLOAT_MODE_P(MODE) \
(GET_MODE_CLASS (MODE) == MODE_DECIMAL_FLOAT)
+/* Nonzero if MODE is a scalar fract mode. */
+#define SCALAR_FRACT_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_FRACT)
+
+/* Nonzero if MODE is a scalar ufract mode. */
+#define SCALAR_UFRACT_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_UFRACT)
+
+/* Nonzero if MODE is a scalar fract or ufract mode. */
+#define ALL_SCALAR_FRACT_MODE_P(MODE) \
+ (SCALAR_FRACT_MODE_P (MODE) || SCALAR_UFRACT_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar accum mode. */
+#define SCALAR_ACCUM_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_ACCUM)
+
+/* Nonzero if MODE is a scalar uaccum mode. */
+#define SCALAR_UACCUM_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_UACCUM)
+
+/* Nonzero if MODE is a scalar accum or uaccum mode. */
+#define ALL_SCALAR_ACCUM_MODE_P(MODE) \
+ (SCALAR_ACCUM_MODE_P (MODE) || SCALAR_UACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar fract or accum mode. */
+#define SIGNED_SCALAR_FIXED_POINT_MODE_P(MODE) \
+ (SCALAR_FRACT_MODE_P (MODE) || SCALAR_ACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar ufract or uaccum mode. */
+#define UNSIGNED_SCALAR_FIXED_POINT_MODE_P(MODE) \
+ (SCALAR_UFRACT_MODE_P (MODE) || SCALAR_UACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar fract, ufract, accum or uaccum mode. */
+#define ALL_SCALAR_FIXED_POINT_MODE_P(MODE) \
+ (SIGNED_SCALAR_FIXED_POINT_MODE_P (MODE) \
+ || UNSIGNED_SCALAR_FIXED_POINT_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar/vector fract mode. */
+#define FRACT_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_FRACT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_FRACT)
+
+/* Nonzero if MODE is a scalar/vector ufract mode. */
+#define UFRACT_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_UFRACT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_UFRACT)
+
+/* Nonzero if MODE is a scalar/vector fract or ufract mode. */
+#define ALL_FRACT_MODE_P(MODE) \
+ (FRACT_MODE_P (MODE) || UFRACT_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar/vector accum mode. */
+#define ACCUM_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_ACCUM \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_ACCUM)
+
+/* Nonzero if MODE is a scalar/vector uaccum mode. */
+#define UACCUM_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_UACCUM \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_UACCUM)
+
+/* Nonzero if MODE is a scalar/vector accum or uaccum mode. */
+#define ALL_ACCUM_MODE_P(MODE) \
+ (ACCUM_MODE_P (MODE) || UACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar/vector fract or accum mode. */
+#define SIGNED_FIXED_POINT_MODE_P(MODE) \
+ (FRACT_MODE_P (MODE) || ACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar/vector ufract or uaccum mode. */
+#define UNSIGNED_FIXED_POINT_MODE_P(MODE) \
+ (UFRACT_MODE_P (MODE) || UACCUM_MODE_P (MODE))
+
+/* Nonzero if MODE is a scalar/vector fract, ufract, accum or uaccum mode. */
+#define ALL_FIXED_POINT_MODE_P(MODE) \
+ (SIGNED_FIXED_POINT_MODE_P (MODE) \
+ || UNSIGNED_FIXED_POINT_MODE_P (MODE))
+
/* Nonzero if CLASS modes can be widened. */
#define CLASS_HAS_WIDER_MODES_P(CLASS) \
(CLASS == MODE_INT \
|| CLASS == MODE_FLOAT \
|| CLASS == MODE_DECIMAL_FLOAT \
- || CLASS == MODE_COMPLEX_FLOAT)
+ || CLASS == MODE_COMPLEX_FLOAT \
+ || CLASS == MODE_FRACT \
+ || CLASS == MODE_UFRACT \
+ || CLASS == MODE_ACCUM \
+ || CLASS == MODE_UACCUM)
/* Get the size in bytes and bits of an object of mode MODE. */
@@ -99,6 +185,14 @@ extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
extern const unsigned short mode_precision[NUM_MACHINE_MODES];
#define GET_MODE_PRECISION(MODE) mode_precision[MODE]
+/* Get the number of integral bits of an object of mode MODE. */
+extern CONST_MODE_IBIT unsigned char mode_ibit[NUM_MACHINE_MODES];
+#define GET_MODE_IBIT(MODE) mode_ibit[MODE]
+
+/* Get the number of fractional bits of an object of mode MODE. */
+extern CONST_MODE_FBIT unsigned char mode_fbit[NUM_MACHINE_MODES];
+#define GET_MODE_FBIT(MODE) mode_fbit[MODE]
+
/* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */