diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-14 21:01:24 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-14 21:01:24 +0000 |
commit | d5f10acfe6048e8ec2f87d407d15b235dd197fbf (patch) | |
tree | 866f9e8520c80581c82643ab70fdd2401ba6d0a1 /gcc/real.c | |
parent | 74e7a0b506d14e7fb1bcb2025dee32d903024e37 (diff) | |
download | gcc-d5f10acfe6048e8ec2f87d407d15b235dd197fbf.tar.gz |
* configure.in (ia64-*): Set float_format for i386 long double.
* real.c (GET_REAL): Treat 128-bit INTEL_EXTENDED_IEEE_FORMAT
as we would for i386 XFmode.
(PUT_REAL): Likewise.
(endian, ereal_atof, real_value_truncate): Likewise.
(ereal_isneg, toe64, etens, make_nan): Likewise.
* real.h (REAL_VALUE_TO_TARGET_LONG_DOUBLE): Likewise.
* config/ia64/ia64-protos.h: Update.
* config/ia64/ia64.c (general_tfmode_operand): New.
(destination_tfmode_operand): New.
(tfreg_or_fp01_operand): New.
(ia64_split_timode): New.
(spill_tfmode_operand): New.
(ia64_expand_prologue): Use TFmode not XFmode.
(ia64_expand_epilogue): Likewise.
(ia64_function_arg): Likewise.
(ia64_function_arg_advance): Likewise.
(ia64_return_in_memory): Likewise.
(ia64_function_value): Likewise.
(ia64_print_operand): Likewise.
(ia64_register_move_cost): Set GR<->FR to 5.
(ia64_secondary_reload_class): Get GR for TImode memory op.
* config/ia64/ia64.h (ROUND_TYPE_SIZE): Remove.
(ROUND_TYPE_ALIGN): Remove.
(LONG_DOUBLE_TYPE_SIZE): Set to 128.
(INTEL_EXTENDED_IEEE_FORMAT): Define.
(HARD_REGNO_NREGS): Use TFmode, not XFmode.
(HARD_REGNO_MODE_OK): Likewise. Disallow TImode in FRs.
(MODES_TIEABLE_P): Use TFmode, not XFmode.
(CLASS_MAX_NREGS): Likewise.
(ASM_OUTPUT_LONG_DOUBLE): Output by 4 byte hunks.
(PREDICATE_CODES): Update.
* config/ia64/ia64.md (movti): New.
(movti_internal): Use a clobber for memory alternatives.
(reload_inti, reload_outti): New.
(movsfcc_astep): Predicate properly.
(movdfcc_astep): Likewise.
(movxf): Remove.
(movtf): New.
(extendsftf2, extenddftf2): New.
(trunctfsf2, trunctfdf2): New.
(floatditf2, fix_trunctfdi2): New.
(floatunsditf2, fixuns_trunctfdi2): New.
(addtf3, subtf3, multf3, abstf2): New.
(negtf2, nabstf2, mintf3, maxtf3): New.
(maddtf3, msubtf3, nmultf3, nmaddtf3): New.
(cmptf): New.
(fr_spill): Use TFmode, not XFmode.
(fr_restore): Likewise.
* config/ia64/lib1funcs.asm (__divtf3): New.
* config/ia64/t-ia64 (LIB1ASMFUNCS): Add it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/real.c')
-rw-r--r-- | gcc/real.c | 87 |
1 files changed, 56 insertions, 31 deletions
diff --git a/gcc/real.c b/gcc/real.c index fa39ebd7253..030f89a39a4 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -95,7 +95,9 @@ netlib.att.com: netlib/cephes. */ The case LONG_DOUBLE_TYPE_SIZE = 128 activates TFmode support and may deactivate XFmode since `long double' is used to refer - to both modes. + to both modes. Defining INTEL_EXTENDED_IEEE_FORMAT at the same + time enables 80387-style 80-bit floats in a 128-bit padded + image, as seen on IA-64. The macros FLOAT_WORDS_BIG_ENDIAN, HOST_FLOAT_WORDS_BIG_ENDIAN, contributed by Richard Earnshaw <Richard.Earnshaw@cl.cam.ac.uk>, @@ -244,30 +246,31 @@ unknown arithmetic type A REAL_VALUE_TYPE is guaranteed to occupy contiguous locations in memory, with no holes. */ -#if MAX_LONG_DOUBLE_TYPE_SIZE == 96 +#if MAX_LONG_DOUBLE_TYPE_SIZE == 96 || \ + (defined(INTEL_EXTENDED_IEEE_FORMAT) && MAX_LONG_DOUBLE_TYPE_SIZE == 128) /* Number of 16 bit words in external e type format */ -#define NE 6 -#define MAXDECEXP 4932 -#define MINDECEXP -4956 -#define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE) -#define PUT_REAL(e,r) \ -do { \ - if (2*NE < sizeof(*r)) \ - bzero((char *)r, sizeof(*r)); \ - bcopy ((char *) e, (char *) r, 2*NE); \ -} while (0) -#else /* no XFmode */ -#if MAX_LONG_DOUBLE_TYPE_SIZE == 128 -#define NE 10 -#define MAXDECEXP 4932 -#define MINDECEXP -4977 -#define GET_REAL(r,e) bcopy ((char *) r, (char *) e, 2*NE) -#define PUT_REAL(e,r) \ -do { \ - if (2*NE < sizeof(*r)) \ - bzero((char *)r, sizeof(*r)); \ - bcopy ((char *) e, (char *) r, 2*NE); \ -} while (0) +# define NE 6 +# define MAXDECEXP 4932 +# define MINDECEXP -4956 +# define GET_REAL(r,e) memcpy ((char *)(e), (char *)(r), 2*NE) +# define PUT_REAL(e,r) \ + do { \ + memcpy ((char *)(r), (char *)(e), 2*NE); \ + if (2*NE < sizeof(*r)) \ + memset ((char *)(r) + 2*NE, 0, sizeof(*r) - 2*NE); \ + } while (0) +# else /* no XFmode */ +# if MAX_LONG_DOUBLE_TYPE_SIZE == 128 +# define NE 10 +# define MAXDECEXP 4932 +# define MINDECEXP -4977 +# define GET_REAL(r,e) memcpy ((char *)(e), (char *)(r), 2*NE) +# define PUT_REAL(e,r) \ + do { \ + memcpy ((char *)(r), (char *)(e), 2*NE); \ + if (2*NE < sizeof(*r)) \ + memset ((char *)(r) + 2*NE, 0, sizeof(*r) - 2*NE); \ + } while (0) #else #define NE 6 #define MAXDECEXP 4932 @@ -497,11 +500,13 @@ endian (e, x, mode) switch (mode) { case TFmode: +#ifndef INTEL_EXTENDED_IEEE_FORMAT /* Swap halfwords in the fourth long. */ th = (unsigned long) e[6] & 0xffff; t = (unsigned long) e[7] & 0xffff; t |= th << 16; x[3] = (long) t; +#endif case XFmode: /* Swap halfwords in the third long. */ @@ -539,11 +544,13 @@ endian (e, x, mode) switch (mode) { case TFmode: +#ifndef INTEL_EXTENDED_IEEE_FORMAT /* Pack the fourth long. */ th = (unsigned long) e[7] & 0xffff; t = (unsigned long) e[6] & 0xffff; t |= th << 16; x[3] = (long) t; +#endif case XFmode: /* Pack the third long. @@ -737,15 +744,18 @@ ereal_atof (s, t) e53toe (tem, e); break; - case XFmode: - asctoe64 (s, tem); - e64toe (tem, e); - break; - case TFmode: +#ifndef INTEL_EXTENDED_IEEE_FORMAT asctoe113 (s, tem); e113toe (tem, e); break; +#endif + /* FALLTHRU */ + + case XFmode: + asctoe64 (s, tem); + e64toe (tem, e); + break; default: asctoe (s, e); @@ -1070,9 +1080,12 @@ real_value_truncate (mode, arg) switch (mode) { case TFmode: +#ifndef INTEL_EXTENDED_IEEE_FORMAT etoe113 (e, t); e113toe (t, t); break; +#endif + /* FALLTHRU */ case XFmode: etoe64 (e, t); @@ -1486,7 +1499,7 @@ ereal_isneg (x) /* e type constants used by high precision check routines */ -#if MAX_LONG_DOUBLE_TYPE_SIZE == 128 +#if MAX_LONG_DOUBLE_TYPE_SIZE == 128 && !defined(INTEL_EXTENDED_IEEE_FORMAT) /* 0.0 */ unsigned EMUSHORT ezero[NE] = {0x0000, 0x0000, 0x0000, 0x0000, @@ -3660,6 +3673,15 @@ toe64 (a, b) /* Clear the last two bytes of 12-byte Intel format */ *(q+1) = 0; } +#ifdef INTEL_EXTENDED_IEEE_FORMAT + if (LONG_DOUBLE_TYPE_SIZE == 128) + { + /* Clear the last 6 bytes of 16-byte Intel format. */ + q[1] = 0; + q[2] = 0; + q[3] = 0; + } +#endif } #endif @@ -4560,7 +4582,7 @@ enormlz (x) #define NTEN 12 #define MAXP 4096 -#if MAX_LONG_DOUBLE_TYPE_SIZE == 128 +#if MAX_LONG_DOUBLE_TYPE_SIZE == 128 && !defined(INTEL_EXTENDED_IEEE_FORMAT) static unsigned EMUSHORT etens[NTEN + 1][NE] = { {0x6576, 0x4a92, 0x804a, 0x153f, @@ -6276,12 +6298,15 @@ make_nan (nan, sign, mode) used like NaN's, but probably not in the same way as IEEE. */ #if !defined(DEC) && !defined(IBM) && !defined(C4X) case TFmode: +#ifndef INTEL_EXTENDED_IEEE_FORMAT n = 8; if (REAL_WORDS_BIG_ENDIAN) p = TFbignan; else p = TFlittlenan; break; +#endif + /* FALLTHRU */ case XFmode: n = 6; |