+2000-01-04 David Edelsohn <edelsohn@gnu.org>
+
+ * expmed.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters
+ to default definition.
+ (store_bit_field): Call SLOW_UNALIGNED_ACCESS with mode and alignment.
+ (store_fixed_bit_field): Call macro with word_mode and alignment.
+ (extract_bit_field): Call macro with relevant mode and alignment.
+ * expr.c (SLOW_UNALIGNED_ACCESS): Add mode and align parameters
+ to default definition.
+ (move_by_pieces): Call SLOW_UNALIGNED_ACCESS with word_mode
+ and alignment.
+ (move_by_pieces_ninsns): Likewise.
+ (clear_by_pieces): Likewise.
+ (emit_push_insn): Likewise.
+ (store_field): Call macro with relevant mode and alignment.
+ (expand_expr): Likewise.
+ (expand_expr_unaligned): Likewise.
+
+ * rs6000.h (HANDLE_PRAGMA_PACK): Define.
+ (SLOW_UNALIGNED_ACCESS): Define.
+ (CASE_VECTOR_MODE): Always use 32-bit offsets.
+ (ASM_FILE_END): Generate 64-bit symbol in 64-bit mode.
+ (EXTRA_SECTOIN_FUNCTIONS): Indent .csect pseudo-op.
+ (toc_section): Likewise and .toc pseudo-op.
+ (ASM_DECLARE_FUNCTION): Likewise. Align text more strictly in
+ 64-bit mode.
+ (TEXT_SECTION_ASM_OP): Likewise.
+ (ASM_OUTPUT_ADD_VEC_ELT, ASM_OUTPUT_ADDR_DIFF_ELT): Always use
+ 32-bit offsets.
+
+ * a29k.h (SLOW_UNALIGNED_ACCESS): Add MODE and ALIGN parameters.
+ * alpha.h (SLOW_UNALIGNED_ACCESS): Likewise.
+ * arm/thumb.h (SLOW_UNALIGNED_ACCESS): Likewise.
+ * gmicro.h (SLOW_UNALIGNED_ACCESS): Likewise.
+ * fr30.h (SLOW_UNALIGNED_ACCESS): Likewise.
+
Tue Jan 4 11:44:13 2000 Jeffrey A Law (law@cygnus.com)
* regclass.c: Revert my Jan 4 change to loop cost computation.
/* Definitions of target machine for GNU compiler, for AMD Am29000 CPU.
- Copyright (C) 1988, 90-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1988, 90-98, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC.
/* Set this non-zero if unaligned move instructions are extremely slow.
On the 29k, they trap. */
-#define SLOW_UNALIGNED_ACCESS 1
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
\f
/* Standard register usage. */
/* Definitions of target machine for GNU compiler, for DEC Alpha.
- Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
On the Alpha, they trap. */
-#define SLOW_UNALIGNED_ACCESS 1
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
\f
/* Standard register usage. */
/* Definitions of target machine for GNU compiler, for ARM/Thumb.
- Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
The basis of this contribution was generated by
Richard Earnshaw, Advanced RISC Machines Ltd
#define SLOW_BYTE_ACCESS 0
-#define SLOW_UNALIGNED_ACCESS 1
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
#define NO_FUNCTION_CSE 1
/* Definitions of target machine for GNU compiler. AT&T DSP1600.
- Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95-98, 2000 Free Software Foundation, Inc.
Contributed by Michael Collison (collison@world.std.com).
This file is part of GNU CC.
/* Define this macro if unaligned accesses have a cost many times greater than
aligned accesses, for example if they are emulated in a trap handler */
-/* define SLOW_UNALIGNED_ACCESS */
+/* define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) */
/* Define this macro to inhibit strength reduction of memory addresses */
/* #define DONT_REDUCE_ADDR */
/*{{{ Comment */
/* Definitions of FR30 target.
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
This file is part of GNU CC.
a memory access.
If the value of this macro is always zero, it need not be defined. */
-/* #define SLOW_UNALIGNED_ACCESS */
+/* #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) */
/* Define this macro to inhibit strength reduction of memory addresses. (On
some machines, such strength reduction seems to do harm rather than good.) */
/* Definitions of target machine for GNU compiler. Gmicro (TRON) version.
- Copyright (C) 1987, 88, 89, 95-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 95-99, 2000 Free Software Foundation, Inc.
Contributed by Masanobu Yuhara, Fujitsu Laboratories LTD.
(yuhara@flab.fujitsu.co.jp)
Unaligned data is allowed on Gmicro, though the access is slow. */
#define STRICT_ALIGNMENT 1
-#define SLOW_UNALIGNED_ACCESS 1
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1
/* Make strings word-aligned so strcpy from constants will be faster. */
#define CONSTANT_ALIGNMENT(EXP, ALIGN) \
If the value of this macro is always zero, it need not be defined. */
-/* #define SLOW_UNALIGNED_ACCESS 0 */
+/* #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 0 */
/* Define this macro to inhibit strength reduction of memory
addresses. (On some machines, such strength reduction seems to do
/* Definitions of target machine for GNU compiler, for IBM RS/6000.
- Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992, 93-99, 2000 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GNU CC.
/* Define this to change the optimizations performed by default. */
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) optimization_options(LEVEL,SIZE)
-
/* Show we can debug even without a frame pointer. */
#define CAN_DEBUG_WITHOUT_FP
\f
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 64
+/* Handle #pragma pack. */
+#define HANDLE_PRAGMA_PACK 1
+
/* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */
#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
(TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
/* Non-zero if move instructions will actually fail to work
when given unaligned data. */
#define STRICT_ALIGNMENT 0
+
+/* Define this macro to be the value 1 if unaligned accesses have a cost
+ many times greater than aligned accesses, for example if they are
+ emulated in a trap handler. */
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) \
+ ((((MODE) == SFmode || (MODE) == DFmode || (MODE) == DImode) \
+ && (ALIGN) < 4) ? 1 : 0)
+
\f
/* Standard register usage. */
On the RS/6000, bump this up a bit. */
-#define MEMORY_MOVE_COST(MODE,CLASS,IN) \
- ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
+#define MEMORY_MOVE_COST(MODE, CLASS, IN) \
+ ((GET_MODE_CLASS (MODE) == MODE_FLOAT \
&& (rs6000_cpu == PROCESSOR_RIOS1 || rs6000_cpu == PROCESSOR_PPC601) \
? 3 : 2) \
+ 4)
output-dependencies. In fact, output dependencies on the CR do have
a cost, but it is probably not worthwhile to track it. */
-#define ADJUST_COST(INSN,LINK,DEP_INSN,COST) \
+#define ADJUST_COST(INSN, LINK, DEP_INSN, COST) \
(COST) = rs6000_adjust_cost (INSN,LINK,DEP_INSN,COST)
/* A C statement (sans semicolon) to update the integer scheduling priority
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */
-#define CASE_VECTOR_MODE (TARGET_32BIT ? SImode : DImode)
+#define CASE_VECTOR_MODE SImode
/* Define as C expression which evaluates to nonzero if the tablejump
instruction expects the table to contain offsets from the address of the
text_section (); \
fputs ("_section_.text:\n", FILE); \
data_section (); \
- fputs ("\t.long _section_.text\n", FILE); \
+ fputs (TARGET_32BIT \
+ ? "\t.long _section_.text\n" : "\t.llong _section_.text\n", FILE); \
}
/* We define this to prevent the name mangler from putting dollar signs into
that we can branch to this function without emitting a no-op after the
call. Do not set this flag if the function is weakly defined. */
-#define ENCODE_SECTION_INFO(DECL) \
+#define ENCODE_SECTION_INFO(DECL) \
if (TREE_CODE (DECL) == FUNCTION_DECL \
&& (TREE_ASM_WRITTEN (DECL) || ! TREE_PUBLIC (DECL)) \
- && !DECL_WEAK (DECL)) \
+ && ! DECL_WEAK (DECL)) \
SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;
/* Indicate that jump tables go in the text section. */
{ \
if (in_section != read_only_data) \
{ \
- fprintf (asm_out_file, ".csect %s[RO],3\n", \
+ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
xcoff_read_only_section_name); \
in_section = read_only_data; \
} \
{ \
if (in_section != private_data) \
{ \
- fprintf (asm_out_file, ".csect %s[RW],3\n", \
+ fprintf (asm_out_file, "\t.csect %s[RW],3\n", \
xcoff_private_data_section_name); \
in_section = private_data; \
} \
{ \
if (in_section != read_only_private_data) \
{ \
- fprintf (asm_out_file, ".csect %s[RO],3\n", \
+ fprintf (asm_out_file, "\t.csect %s[RO],3\n", \
xcoff_private_data_section_name); \
in_section = read_only_private_data; \
} \
in each file. */ \
if (! toc_initialized) \
{ \
- fputs (".toc\nLCTOC..0:\n", asm_out_file); \
+ fputs ("\t.toc\nLCTOC..0:\n", asm_out_file); \
fputs ("\t.tc toc_table[TC],toc_table[RW]\n", asm_out_file); \
toc_initialized = 1; \
} \
\
if (in_section != toc) \
- fprintf (asm_out_file, ".csect toc_table[RW]%s\n", \
+ fprintf (asm_out_file, "\t.csect toc_table[RW]%s\n", \
(TARGET_32BIT ? "" : ",3")); \
} \
else \
{ \
if (in_section != toc) \
- fputs (".toc\n", asm_out_file); \
+ fputs ("\t.toc\n", asm_out_file); \
} \
in_section = toc; \
}
The csect for the function will have already been created by the
`text_section' call previously done. We do have to go back to that
- csect, however. */
+ csect, however.
-/* ??? What do the 16 and 044 in the .function line really mean? */
+ The third and fourth parameters to the .function pseudo-op (16 and 044)
+ are placeholders which no longer have any use. */
#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
{ if (TREE_PUBLIC (DECL)) \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
putc ('\n', FILE); \
} \
- fputs (".csect ", FILE); \
+ fputs ("\t.csect ", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (TARGET_32BIT ? "[DS]\n" : "[DS],3\n", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (TARGET_32BIT ? "\t.long ." : "\t.llong .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (", TOC[tc0], 0\n", FILE); \
- fputs (".csect .text[PR]\n.", FILE); \
+ fputs (TARGET_32BIT \
+ ? "\t.csect .text[PR]\n." : "\t.csect .text[PR],3\n.", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
fputs (":\n", FILE); \
if (write_symbols == XCOFF_DEBUG) \
Text section for 64-bit target may contain 64-bit address jump table. */
#define TEXT_SECTION_ASM_OP (TARGET_32BIT \
- ? ".csect .text[PR]" : ".csect .text[PR],3")
+ ? "\t.csect .text[PR]" : "\t.csect .text[PR],3")
/* Output before writable data.
Align entire section to BIGGEST_ALIGNMENT. */
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
do { char buf[100]; \
- fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('\n', FILE); \
/* This is how to output an element of a case-vector that is relative. */
-#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
do { char buf[100]; \
- fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", FILE); \
+ fputs ("\t.long ", FILE); \
ASM_GENERATE_INTERNAL_LABEL (buf, "L", VALUE); \
assemble_name (FILE, buf); \
putc ('-', FILE); \
extern int function_arg_partial_nregs ();
extern int function_arg_pass_by_reference ();
extern void setup_incoming_varargs ();
-extern union tree_node *rs6000_va_list ();
+extern union tree_node *rs6000_build_va_list ();
extern void rs6000_va_start ();
extern struct rtx_def *rs6000_va_arg ();
extern struct rtx_def *rs6000_stack_temp ();
static int sdiv_pow2_cheap, smod_pow2_cheap;
#ifndef SLOW_UNALIGNED_ACCESS
-#define SLOW_UNALIGNED_ACCESS STRICT_ALIGNMENT
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
#endif
/* For compilers that support multiple targets with different word sizes,
BITPOS is 0 in a REG bigger than a word. */
if (GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
&& (GET_CODE (op0) != MEM
- || ! SLOW_UNALIGNED_ACCESS
+ || ! SLOW_UNALIGNED_ACCESS (fieldmode, align)
|| (offset * BITS_PER_UNIT % bitsize == 0
&& align % GET_MODE_SIZE (fieldmode) == 0))
&& bitpos == 0 && bitsize == GET_MODE_BITSIZE (fieldmode))
bestmode = GET_MODE (op0);
if (bestmode == VOIDmode
- || (SLOW_UNALIGNED_ACCESS && GET_MODE_SIZE (bestmode) > align))
+ || (SLOW_UNALIGNED_ACCESS (bestmode, align)
+ && GET_MODE_SIZE (bestmode) > align))
goto insv_loses;
/* Adjust address to point to the containing unit of that mode. */
int all_zero = 0;
int all_one = 0;
- if (! SLOW_UNALIGNED_ACCESS)
+ if (! SLOW_UNALIGNED_ACCESS (word_mode, struct_align))
struct_align = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
/* There is a case not handled here:
&& TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (GET_MODE (op0))))
|| (GET_CODE (op0) == MEM
- && (! SLOW_UNALIGNED_ACCESS
+ && (! SLOW_UNALIGNED_ACCESS (mode, align)
|| (offset * BITS_PER_UNIT % bitsize == 0
&& align * BITS_PER_UNIT % bitsize == 0))))
&& ((bitsize >= BITS_PER_WORD && bitsize == GET_MODE_BITSIZE (mode)
bestmode = GET_MODE (xop0);
if (bestmode == VOIDmode
- || (SLOW_UNALIGNED_ACCESS && GET_MODE_SIZE (bestmode) > align))
+ || (SLOW_UNALIGNED_ACCESS (bestmode, align)
+ && GET_MODE_SIZE (bestmode) > align))
goto extzv_loses;
/* Compute offset as multiple of this unit,
bestmode = GET_MODE (xop0);
if (bestmode == VOIDmode
- || (SLOW_UNALIGNED_ACCESS && GET_MODE_SIZE (bestmode) > align))
+ || (SLOW_UNALIGNED_ACCESS (bestmode, align)
+ && GET_MODE_SIZE (bestmode) > align))
goto extv_loses;
/* Compute offset as multiple of this unit,
/* SLOW_UNALIGNED_ACCESS is non-zero if unaligned accesses are very slow. */
#ifndef SLOW_UNALIGNED_ACCESS
-#define SLOW_UNALIGNED_ACCESS STRICT_ALIGNMENT
+#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) STRICT_ALIGNMENT
#endif
\f
/* This is run once per compilation to set up which modes can be used
data.to_addr = copy_addr_to_reg (to_addr);
}
- if (! SLOW_UNALIGNED_ACCESS
+ if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
|| align > MOVE_MAX || align >= BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = MOVE_MAX;
register int n_insns = 0;
int max_size = MOVE_MAX + 1;
- if (! SLOW_UNALIGNED_ACCESS
+ if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
|| align > MOVE_MAX || align >= BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = MOVE_MAX;
data.to_addr = copy_addr_to_reg (to_addr);
}
- if (! SLOW_UNALIGNED_ACCESS
+ if (! SLOW_UNALIGNED_ACCESS (word_mode, align)
|| align > MOVE_MAX || align >= BIGGEST_ALIGNMENT / BITS_PER_UNIT)
align = MOVE_MAX;
/* Here we avoid the case of a structure whose weak alignment
forces many pushes of a small amount of data,
and such small pushes do rounding that causes trouble. */
- && ((! SLOW_UNALIGNED_ACCESS)
+ && ((! SLOW_UNALIGNED_ACCESS (word_mode, align))
|| align >= BIGGEST_ALIGNMENT / BITS_PER_UNIT
|| PUSH_ROUNDING (align) == align)
&& PUSH_ROUNDING (INTVAL (size)) == INTVAL (size))
|| GET_CODE (target) == SUBREG
/* If the field isn't aligned enough to store as an ordinary memref,
store it as a bit field. */
- || (mode != BLKmode && SLOW_UNALIGNED_ACCESS
+ || (mode != BLKmode && SLOW_UNALIGNED_ACCESS (mode, align)
&& (align * BITS_PER_UNIT < GET_MODE_ALIGNMENT (mode)
|| bitpos % GET_MODE_ALIGNMENT (mode)))
- || (mode == BLKmode && SLOW_UNALIGNED_ACCESS
+ || (mode == BLKmode && SLOW_UNALIGNED_ACCESS (mode, align)
&& (TYPE_ALIGN (TREE_TYPE (exp)) > align * BITS_PER_UNIT
|| bitpos % TYPE_ALIGN (TREE_TYPE (exp)) != 0))
/* If the RHS and field are a constant size and the size of the
&& GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
/* If the field isn't aligned enough to fetch as a memref,
fetch it as a bit field. */
- || (mode1 != BLKmode && SLOW_UNALIGNED_ACCESS
+ || (mode1 != BLKmode
+ && SLOW_UNALIGNED_ACCESS (mode1, alignment)
&& ((TYPE_ALIGN (TREE_TYPE (tem))
< (unsigned int) GET_MODE_ALIGNMENT (mode))
|| (bitpos % GET_MODE_ALIGNMENT (mode) != 0)))))
|| (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER
&& mode == BLKmode
- && SLOW_UNALIGNED_ACCESS
+ && SLOW_UNALIGNED_ACCESS (mode, alignment)
&& (TYPE_ALIGN (type) > alignment * BITS_PER_UNIT
|| bitpos % TYPE_ALIGN (type) != 0)))
{
EXPAND_INITIALIZER), then we must not copy to a temporary. */
if (mode1 == VOIDmode
|| GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
- || (SLOW_UNALIGNED_ACCESS
+ || (SLOW_UNALIGNED_ACCESS (mode1, alignment)
&& (TYPE_ALIGN (type) > alignment * BITS_PER_UNIT
|| bitpos % TYPE_ALIGN (type) != 0)))
{