diff options
author | Andrew Pinski <pinskia@gcc.gnu.org> | 2007-08-31 15:45:43 -0700 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2007-08-31 15:45:43 -0700 |
commit | 7fecf2c7dbdd6b13dfce378a66d532c7411ec49f (patch) | |
tree | 181b926113a2a84d029ccf131072702c9c19951e /gcc/config | |
parent | 973bb83254bd44d34c9e4e785fc77d10f2366dc2 (diff) | |
download | gcc-7fecf2c7dbdd6b13dfce378a66d532c7411ec49f.zip gcc-7fecf2c7dbdd6b13dfce378a66d532c7411ec49f.tar.gz gcc-7fecf2c7dbdd6b13dfce378a66d532c7411ec49f.tar.bz2 |
optabs.c (prepare_float_lib_cmp): Use libgcc_cmp_return_mode instead of word_mode.
2007-08-31 Andrew Pinski <andrew_pinski@playstation.sony.com>
* optabs.c (prepare_float_lib_cmp): Use
libgcc_cmp_return_mode instead of word_mode.
* config/dfp-bit.h: Likewise.
* config/fp-bit.h: Likewise.
* config/spu/spu.c (spu_libgcc_cmp_return_mode):
New function.
(spu_libgcc_shift_count_mode): New function.
(TARGET_LIBGCC_CMP_RETURN_MODE): Define.
(TARGET_LIBGCC_SHIFT_COUNT_MODE): Define.
From-SVN: r128005
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/dfp-bit.h | 4 | ||||
-rw-r--r-- | gcc/config/fp-bit.h | 4 | ||||
-rw-r--r-- | gcc/config/spu/spu.c | 31 |
3 files changed, 34 insertions, 5 deletions
diff --git a/gcc/config/dfp-bit.h b/gcc/config/dfp-bit.h index 5238a2b..dfbf4f4 100644 --- a/gcc/config/dfp-bit.h +++ b/gcc/config/dfp-bit.h @@ -454,9 +454,9 @@ typedef unsigned int USItype __attribute__ ((mode (SI))); typedef unsigned int UDItype __attribute__ ((mode (DI))); /* The type of the result of a decimal float comparison. This must - match `word_mode' in GCC for the target. */ + match `__libgcc_cmp_return__' in GCC for the target. */ -typedef int CMPtype __attribute__ ((mode (word))); +typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); /* Prototypes. */ diff --git a/gcc/config/fp-bit.h b/gcc/config/fp-bit.h index 0f03f87..5f9082c 100644 --- a/gcc/config/fp-bit.h +++ b/gcc/config/fp-bit.h @@ -108,9 +108,9 @@ typedef int TItype __attribute__ ((mode (TI))); #endif /* The type of the result of a floating point comparison. This must - match `word_mode' in GCC for the target. */ + match `__libgcc_cmp_return__' in GCC for the target. */ #ifndef CMPtype -typedef int CMPtype __attribute__ ((mode (word))); +typedef int CMPtype __attribute__ ((mode (__libgcc_cmp_return__))); #endif typedef unsigned int UHItype __attribute__ ((mode (HI))); diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index eda0de0..7fcc942 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -174,6 +174,12 @@ static int cpat_info(unsigned char *arr, int size, int *prun, int *pstart); static enum immediate_class classify_immediate (rtx op, enum machine_mode mode); +static enum machine_mode +spu_libgcc_cmp_return_mode (void); + +static enum machine_mode +spu_libgcc_shift_count_mode (void); + /* Built in types. */ tree spu_builtin_types[SPU_BTI_MAX]; @@ -275,6 +281,12 @@ const struct attribute_spec spu_attribute_table[]; #undef TARGET_VECTOR_ALIGNMENT_REACHABLE #define TARGET_VECTOR_ALIGNMENT_REACHABLE spu_vector_alignment_reachable +#undef TARGET_LIBGCC_CMP_RETURN_MODE +#define TARGET_LIBGCC_CMP_RETURN_MODE spu_libgcc_cmp_return_mode + +#undef TARGET_LIBGCC_SHIFT_COUNT_MODE +#define TARGET_LIBGCC_SHIFT_COUNT_MODE spu_libgcc_shift_count_mode + struct gcc_target targetm = TARGET_INITIALIZER; void @@ -5502,4 +5514,21 @@ spu_init_expanders (void) * expanding the prologue. */ if (cfun) REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = 8; -} +} + +static enum machine_mode +spu_libgcc_cmp_return_mode (void) +{ + +/* For SPU word mode is TI mode so it is better to use SImode + for compare returns. */ + return SImode; +} + +static enum machine_mode +spu_libgcc_shift_count_mode (void) +{ +/* For SPU word mode is TI mode so it is better to use SImode + for shift counts. */ + return SImode; +} |