From e5e8a8bf3921f126e8ce4e14b02d99ceaa6805c7 Mon Sep 17 00:00:00 2001 From: John Wehle Date: Sun, 17 May 1998 23:00:05 +0000 Subject: [PATCH] i386.h (ALIGN_DFmode): Delete. * i386.h (ALIGN_DFmode): Delete. (CONSTANT_ALIGNMENT): Define. * varasm.c (force_const_mem): Use it. From-SVN: r19823 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.h | 26 ++++++++++++++++++++++++-- gcc/varasm.c | 4 ++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 07cb2379722c..e2cbd10b6288 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Sun May 17 23:59:45 1998 John Wehle (john@feith.com) + + * i386.h (ALIGN_DFmode): Delete. + (CONSTANT_ALIGNMENT): Define. + * varasm.c (force_const_mem): Use it. + Sun May 17 19:31:05 1998 Richard Henderson * alpha.c (alpha_emit_conditional_branch): Clear cmp_code after diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 1053bd9c2422..b55ffccb986e 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -419,8 +419,30 @@ extern int ix86_arch; aligned on 64 bit boundaries. */ #define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32) -/* align DFmode constants and nonaggregates */ -#define ALIGN_DFmode (!TARGET_386) +/* If defined, a C expression to compute the alignment given to a + constant that is being placed in memory. CONSTANT is the constant + and ALIGN is the alignment that the object would ordinarily have. + The value of this macro is used instead of that alignment to align + the object. + + If this macro is not defined, then ALIGN is used. + + The typical use of this macro is to increase alignment for string + constants to be word aligned so that `strcpy' calls that copy + constants can be done inline. */ + +#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ + (TREE_CODE (EXP) == REAL_CST \ + ? ((TYPE_MODE (TREE_TYPE (EXP)) == DFmode && (ALIGN) < 64) \ + ? 64 \ + : (TYPE_MODE (TREE_TYPE (EXP)) == XFmode && (ALIGN) < 128) \ + ? 128 \ + : (ALIGN)) \ + : TREE_CODE (EXP) == STRING_CST \ + ? ((TREE_STRING_LENGTH (EXP) >= 31 && (ALIGN) < 256) \ + ? 256 \ + : (ALIGN)) \ + : (ALIGN)) /* If defined, a C expression to compute the alignment for a static variable. TYPE is the data type, and ALIGN is the alignment that diff --git a/gcc/varasm.c b/gcc/varasm.c index 867ae1f17131..9951a50d31e7 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -3417,6 +3417,10 @@ force_const_mem (mode, x) align = (mode == VOIDmode) ? UNITS_PER_WORD : GET_MODE_SIZE (mode); if (align > BIGGEST_ALIGNMENT / BITS_PER_UNIT) align = BIGGEST_ALIGNMENT / BITS_PER_UNIT; +#ifdef CONSTANT_ALIGNMENT + align = CONSTANT_ALIGNMENT (make_tree (type_for_mode (mode, 0), x), + align * BITS_PER_UNIT) / BITS_PER_UNIT; +#endif pool_offset += align - 1; pool_offset &= ~ (align - 1); -- 2.43.5