This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fixed-point] Patch to handle mode/vector_size attribute


Hello,

  Here is the patch to handle mode attribute and vector_size
attribute for fixed-point data.  Thanks!

Ex:
typedef unsigned _Sat _Fract satUQQtype __attribute__ ((mode (UQQ)));
typedef unsigned _Fract UQQtype __attribute__ ((mode (UQQ)));
typedef _Sat _Fract satQQtype __attribute__ ((mode (QQ)));
typedef _Fract QQtype __attribute__ ((mode (QQ)));

typedef unsigned _Sat _Fract satV2USQtype __attribute__ ((vector_size (8)));
typedef unsigned _Fract V2USQtype __attribute__ ((vector_size (8)));
typedef _Sat _Fract satV2SQtype __attribute__ ((vector_size (8)));
typedef _Fract V2SQtype __attribute__ ((vector_size (8)));

// Depreciated
typedef unsigned _Sat _Fract satV2UHQtype __attribute__ ((mode (V2UHQ)));
typedef unsigned _Fract V2UHQtype __attribute__ ((mode (V2UHQ)));
typedef _Sat _Fract satV2HQtype __attribute__ ((mode (V2HQ)));
typedef _Fract V2HQtype __attribute__ ((mode (V2HQ)));

satUQQtype a1;
UQQtype a2;
satQQtype a3;
QQtype a4;

satV2USQtype b1;
V2USQtype b2;
satV2SQtype b3;
V2SQtype b4;

satV2UHQtype c1;
V2UHQtype c2;
satV2HQtype c3;
V2HQtype c4;

Regards,
Chao-ying

2006-11-09  Chao-ying Fu  <fu@mips.com>

	* machmode.h (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):
	New to test scalar fixed-point modes only.
	(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): Change to test
	scalar or vector fixed-point modes.

	* tree.c (build_vector_type_for_mode): Handle MODE_VECTOR_FRACT,
	MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM.

	* expr.c (vector_mode_valid_p): Handle MODE_VECTOR_FRACT,
	MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM.

	* c-common.c (c_common_type_for_mode): Handle fixed-point modes to
	return various saturating, non-saturating, signed and unsigned types.
	(handle_mode_attribute): Handle fixed-point modes.  Need to check
	if the signness of base type and fixed-point modes are consistent.
	(handle_vector_size_attribute): Handle fixed-point modes.

Attachment: gcc.diff
Description: gcc.diff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]