[fixed-point] Patch for new machine modes
Fu, Chao-Ying
fu@mips.com
Fri Nov 3 23:59:00 GMT 2006
Hello,
Here is the patch to add new machine modes
for signed/unsigned fractional and accumulator data.
The number of integral and fractional bits in these machine modes
can be changed by using ADJUST_IBIT and ADJUST_FBIT in the
backend's ???-modes.def. Thanks!
Regards,
Chao-ying
2006-11-03 Chao-ying Fu <fu@mips.com>
* 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.
(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.
* 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: Add QQ, HQ, SQ, DQ, TQ, UQQ, UHQ, USQ, UDQ, UTQ,
HA, SA, DA, TA, UHA, USA, UDA, UTA.
* machmode.h (VECTOR_MODE_P): Test MODE_VECTOR_FRACT,
MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM.
(CLASS_HAS_WIDER_MODES_P): Test MODE_FRACT, MODE_UFRACT, MODE_ACCUM,
MODE_UACCUM.
(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.
* 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc.diff
Type: application/octet-stream
Size: 19047 bytes
Desc: gcc.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061103/411f2fae/attachment.obj>
More information about the Gcc-patches
mailing list