comparison gcc/config/pa/pa.h @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Definitions of target machine for GNU compiler, for the HP Spectrum. 1 /* Definitions of target machine for GNU compiler, for the HP Spectrum.
2 Copyright (C) 1992-2017 Free Software Foundation, Inc. 2 Copyright (C) 1992-2018 Free Software Foundation, Inc.
3 Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support 3 Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support
4 and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for 4 and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for
5 Software Science at the University of Utah. 5 Software Science at the University of Utah.
6 6
7 This file is part of GCC. 7 This file is part of GCC.
175 builtin_define("_PA_RISC2_0"); \ 175 builtin_define("_PA_RISC2_0"); \
176 else if (TARGET_PA_11) \ 176 else if (TARGET_PA_11) \
177 builtin_define("_PA_RISC1_1"); \ 177 builtin_define("_PA_RISC1_1"); \
178 else \ 178 else \
179 builtin_define("_PA_RISC1_0"); \ 179 builtin_define("_PA_RISC1_0"); \
180 if (HPUX_LONG_DOUBLE_LIBRARY) \
181 builtin_define("__SIZEOF_FLOAT128__=16"); \
180 } while (0) 182 } while (0)
181 183
182 /* An old set of OS defines for various BSD-like systems. */ 184 /* An old set of OS defines for various BSD-like systems. */
183 #define TARGET_OS_CPP_BUILTINS() \ 185 #define TARGET_OS_CPP_BUILTINS() \
184 do \ 186 do \
305 long double was never implemented in hardware. The glibc implementation 307 long double was never implemented in hardware. The glibc implementation
306 currently provides 8-byte alignment. It should be 16 bytes since various 308 currently provides 8-byte alignment. It should be 16 bytes since various
307 POSIX types such as pthread_mutex_t require 16-byte alignment. Again, 309 POSIX types such as pthread_mutex_t require 16-byte alignment. Again,
308 this is non critical since 16-byte alignment is no longer needed for 310 this is non critical since 16-byte alignment is no longer needed for
309 atomic operations. */ 311 atomic operations. */
310 #define MALLOC_ABI_ALIGNMENT (TARGET_SOM ? 64 : 128) 312 #define MALLOC_ABI_ALIGNMENT (TARGET_64BIT ? 128 : 64)
311 313
312 /* Make arrays of chars word-aligned for the same reasons. */ 314 /* Make arrays of chars word-aligned for the same reasons. */
313 #define DATA_ALIGNMENT(TYPE, ALIGN) \ 315 #define DATA_ALIGNMENT(TYPE, ALIGN) \
314 (TREE_CODE (TYPE) == ARRAY_TYPE \ 316 (TREE_CODE (TYPE) == ARRAY_TYPE \
315 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ 317 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \
533 535
534 On the 64-bit port, the HP C compiler allocates a 48-byte frame 536 On the 64-bit port, the HP C compiler allocates a 48-byte frame
535 marker, although the runtime documentation only describes a 16 537 marker, although the runtime documentation only describes a 16
536 byte marker. For compatibility, we allocate 48 bytes. */ 538 byte marker. For compatibility, we allocate 48 bytes. */
537 #define STACK_POINTER_OFFSET \ 539 #define STACK_POINTER_OFFSET \
538 (TARGET_64BIT ? -(crtl->outgoing_args_size + 48): -32) 540 (TARGET_64BIT ? -(crtl->outgoing_args_size + 48) : poly_int64 (-32))
539 541
540 #define STACK_DYNAMIC_OFFSET(FNDECL) \ 542 #define STACK_DYNAMIC_OFFSET(FNDECL) \
541 (TARGET_64BIT \ 543 (TARGET_64BIT \
542 ? (STACK_POINTER_OFFSET) \ 544 ? (STACK_POINTER_OFFSET) \
543 : ((STACK_POINTER_OFFSET) - crtl->outgoing_args_size)) 545 : ((STACK_POINTER_OFFSET) - crtl->outgoing_args_size))
590 (CUM).words = 0, \ 592 (CUM).words = 0, \
591 (CUM).incoming = 1, \ 593 (CUM).incoming = 1, \
592 (CUM).indirect = 0, \ 594 (CUM).indirect = 0, \
593 (CUM).nargs_prototype = 1000 595 (CUM).nargs_prototype = 1000
594 596
595 /* Figure out the size in words of the function argument. The size
596 returned by this macro should always be greater than zero because
597 we pass variable and zero sized objects by reference. */
598
599 #define FUNCTION_ARG_SIZE(MODE, TYPE) \
600 ((((MODE) != BLKmode \
601 ? (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \
602 : int_size_in_bytes (TYPE)) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
603
604 /* Determine where to put an argument to a function. 597 /* Determine where to put an argument to a function.
605 Value is zero to push the argument on the stack, 598 Value is zero to push the argument on the stack,
606 or a hard register in which to store the argument. 599 or a hard register in which to store the argument.
607 600
608 MODE is the argument's machine mode. 601 MODE is the argument's machine mode.
689 No definition is equivalent to always zero. */ 682 No definition is equivalent to always zero. */
690 683
691 extern int may_call_alloca; 684 extern int may_call_alloca;
692 685
693 #define EXIT_IGNORE_STACK \ 686 #define EXIT_IGNORE_STACK \
694 (get_frame_size () != 0 \ 687 (maybe_ne (get_frame_size (), 0) \
695 || cfun->calls_alloca || crtl->outgoing_args_size) 688 || cfun->calls_alloca || maybe_ne (crtl->outgoing_args_size, 0))
696 689
697 /* Length in units of the trampoline for entering a nested function. */ 690 /* Length in units of the trampoline for entering a nested function. */
698 691
699 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52) 692 #define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
700 693
1119 /* This is how to store into the string LABEL 1112 /* This is how to store into the string LABEL
1120 the symbol_ref name of an internal numbered label where 1113 the symbol_ref name of an internal numbered label where
1121 PREFIX is the class of label and NUM is the number within the class. 1114 PREFIX is the class of label and NUM is the number within the class.
1122 This is suitable for output with `assemble_name'. */ 1115 This is suitable for output with `assemble_name'. */
1123 1116
1124 #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ 1117 #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
1125 sprintf (LABEL, "*%c$%s%04ld", (PREFIX)[0], (PREFIX) + 1, (long)(NUM)) 1118 do \
1119 { \
1120 char *__p; \
1121 (LABEL)[0] = '*'; \
1122 (LABEL)[1] = (PREFIX)[0]; \
1123 (LABEL)[2] = '$'; \
1124 __p = stpcpy (&(LABEL)[3], &(PREFIX)[1]); \
1125 sprint_ul (__p, (unsigned long) (NUM)); \
1126 } \
1127 while (0)
1128
1126 1129
1127 /* Output the definition of a compiler-generated label named NAME. */ 1130 /* Output the definition of a compiler-generated label named NAME. */
1128 1131
1129 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \ 1132 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,NAME) \
1130 do { \ 1133 do { \
1138 #define TARGET_ASM_GLOBALIZE_LABEL pa_globalize_label 1141 #define TARGET_ASM_GLOBALIZE_LABEL pa_globalize_label
1139 1142
1140 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \ 1143 #define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
1141 pa_output_ascii ((FILE), (P), (SIZE)) 1144 pa_output_ascii ((FILE), (P), (SIZE))
1142 1145
1143 /* Jump tables are always placed in the text section. Technically, it 1146 /* Jump tables are always placed in the text section. We have to do
1144 is possible to put them in the readonly data section. This has the 1147 this for the HP-UX SOM target as we can't switch sections in the
1145 benefit of getting the table out of .text and reducing branch lengths 1148 middle of a function.
1146 as a result. 1149
1147 1150 On ELF targets, it is possible to put them in the readonly-data section.
1148 The downside is that an additional insn (addil) is needed to access 1151 This would get the table out of .text and reduce branch lengths.
1152
1153 A downside is that an additional insn (addil) is needed to access
1149 the table when generating PIC code. The address difference table 1154 the table when generating PIC code. The address difference table
1150 also has to use 32-bit pc-relative relocations. Currently, GAS does 1155 also has to use 32-bit pc-relative relocations.
1151 not support these relocations, although it is easily modified to do
1152 this operation.
1153 1156
1154 The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0" 1157 The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0"
1155 when using ELF GAS. A simple difference can be used when using 1158 when using ELF GAS. A simple difference can be used when using
1156 SOM GAS or the HP assembler. The final downside is GDB complains 1159 the HP assembler.
1157 about the nesting of the label for the table when debugging. */ 1160
1161 The final downside is GDB complains about the nesting of the label
1162 for the table. */
1158 1163
1159 #define JUMP_TABLES_IN_TEXT_SECTION 1 1164 #define JUMP_TABLES_IN_TEXT_SECTION 1
1160 1165
1161 /* This is how to output an element of a case-vector that is absolute. */ 1166 /* This is how to output an element of a case-vector that is absolute. */
1162 1167
1163 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 1168 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
1164 fprintf (FILE, "\t.word L$%04d\n", VALUE) 1169 fprintf (FILE, "\t.word L$%d\n", VALUE)
1165 1170
1166 /* This is how to output an element of a case-vector that is relative. 1171 /* This is how to output an element of a case-vector that is relative.
1167 Since we always place jump tables in the text section, the difference 1172 Since we always place jump tables in the text section, the difference
1168 is absolute and requires no relocation. */ 1173 is absolute and requires no relocation. */
1169 1174
1170 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ 1175 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
1171 fprintf (FILE, "\t.word L$%04d-L$%04d\n", VALUE, REL) 1176 fprintf (FILE, "\t.word L$%d-L$%d\n", VALUE, REL)
1172 1177
1173 /* This is how to output an absolute case-vector. */ 1178 /* This is how to output an absolute case-vector. */
1174 1179
1175 #define ASM_OUTPUT_ADDR_VEC(LAB,BODY) \ 1180 #define ASM_OUTPUT_ADDR_VEC(LAB,BODY) \
1176 pa_output_addr_vec ((LAB),(BODY)) 1181 pa_output_addr_vec ((LAB),(BODY))
1182 1187
1183 /* This is how to output an assembler line that says to advance the 1188 /* This is how to output an assembler line that says to advance the
1184 location counter to a multiple of 2**LOG bytes. */ 1189 location counter to a multiple of 2**LOG bytes. */
1185 1190
1186 #define ASM_OUTPUT_ALIGN(FILE,LOG) \ 1191 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
1187 fprintf (FILE, "\t.align %d\n", (1<<(LOG))) 1192 fprintf (FILE, "\t.align %d\n", (1 << (LOG)))
1188 1193
1189 #define ASM_OUTPUT_SKIP(FILE,SIZE) \ 1194 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
1190 fprintf (FILE, "\t.blockz " HOST_WIDE_INT_PRINT_UNSIGNED"\n", \ 1195 fprintf (FILE, "\t.blockz " HOST_WIDE_INT_PRINT_UNSIGNED"\n", \
1191 (unsigned HOST_WIDE_INT)(SIZE)) 1196 (unsigned HOST_WIDE_INT)(SIZE))
1192 1197