linux64.h (90075) | linux64.h (96263) |
---|---|
1/* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF. 2 Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. 3 Contributed by David S. Miller (davem@caip.rutgers.edu) 4 5This file is part of GNU CC. 6 7GNU CC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by --- 20 unchanged lines hidden (view full) --- 29 30#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc 31/* A 64 bit v9 compiler with stack-bias, 32 in a Medium/Low code model environment. */ 33 34#undef TARGET_DEFAULT 35#define TARGET_DEFAULT \ 36 (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \ | 1/* Definitions for 64-bit SPARC running Linux-based GNU systems with ELF. 2 Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. 3 Contributed by David S. Miller (davem@caip.rutgers.edu) 4 5This file is part of GNU CC. 6 7GNU CC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by --- 20 unchanged lines hidden (view full) --- 29 30#if TARGET_CPU_DEFAULT == TARGET_CPU_v9 || TARGET_CPU_DEFAULT == TARGET_CPU_ultrasparc 31/* A 64 bit v9 compiler with stack-bias, 32 in a Medium/Low code model environment. */ 33 34#undef TARGET_DEFAULT 35#define TARGET_DEFAULT \ 36 (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \ |
37 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_LONG_DOUBLE_128) | 37 + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) |
38#endif 39 40#undef ASM_CPU_DEFAULT_SPEC 41#define ASM_CPU_DEFAULT_SPEC "-Av9a" 42 43#ifdef SPARC_BI_ARCH 44 45#undef CPP_ARCH32_SPEC --- 7 unchanged lines hidden (view full) --- 53 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which 54 provides part of the support for getting C++ file-scope static 55 object constructed before entering `main'. */ 56 57#undef STARTFILE_SPEC 58 59#define STARTFILE_SPEC32 \ 60 "%{!shared: \ | 38#endif 39 40#undef ASM_CPU_DEFAULT_SPEC 41#define ASM_CPU_DEFAULT_SPEC "-Av9a" 42 43#ifdef SPARC_BI_ARCH 44 45#undef CPP_ARCH32_SPEC --- 7 unchanged lines hidden (view full) --- 53 the GNU/Linux magical crtbegin.o file (see crtstuff.c) which 54 provides part of the support for getting C++ file-scope static 55 object constructed before entering `main'. */ 56 57#undef STARTFILE_SPEC 58 59#define STARTFILE_SPEC32 \ 60 "%{!shared: \ |
61 %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ 62 crti.o%s %{static:crtbeginT.o%s}\ | 61 %{pg:/usr/lib/gcrt1.o%s} %{!pg:%{/usr/lib/p:gcrt1.o%s} %{!p:/usr/lib/crt1.o%s}}}\ 62 /usr/lib/crti.o%s %{static:crtbeginT.o%s}\ |
63 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 64 65#define STARTFILE_SPEC64 \ 66 "%{!shared: \ 67 %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} %{!p:/usr/lib64/crt1.o%s}}}\ 68 /usr/lib64/crti.o%s %{static:crtbeginT.o%s}\ 69 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 70 --- 21 unchanged lines hidden (view full) --- 92 the GNU/Linux magical crtend.o file (see crtstuff.c) which 93 provides part of the support for getting C++ file-scope static 94 object constructed before entering `main', followed by a normal 95 GNU/Linux "finalizer" file, `crtn.o'. */ 96 97#undef ENDFILE_SPEC 98 99#define ENDFILE_SPEC32 \ | 63 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 64 65#define STARTFILE_SPEC64 \ 66 "%{!shared: \ 67 %{pg:/usr/lib64/gcrt1.o%s} %{!pg:%{p:/usr/lib64/gcrt1.o%s} %{!p:/usr/lib64/crt1.o%s}}}\ 68 /usr/lib64/crti.o%s %{static:crtbeginT.o%s}\ 69 %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" 70 --- 21 unchanged lines hidden (view full) --- 92 the GNU/Linux magical crtend.o file (see crtstuff.c) which 93 provides part of the support for getting C++ file-scope static 94 object constructed before entering `main', followed by a normal 95 GNU/Linux "finalizer" file, `crtn.o'. */ 96 97#undef ENDFILE_SPEC 98 99#define ENDFILE_SPEC32 \ |
100 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" | 100 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib/crtn.o%s" |
101 102#define ENDFILE_SPEC64 \ 103 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s" 104 | 101 102#define ENDFILE_SPEC64 \ 103 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} /usr/lib64/crtn.o%s" 104 |
105#define ENDFILE_SPEC_COMMON \ 106 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}" 107 |
|
105#ifdef SPARC_BI_ARCH 106 107#if DEFAULT_ARCH32_P 108#define ENDFILE_SPEC "\ 109%{m32:" ENDFILE_SPEC32 "} \ 110%{m64:" ENDFILE_SPEC64 "} \ | 108#ifdef SPARC_BI_ARCH 109 110#if DEFAULT_ARCH32_P 111#define ENDFILE_SPEC "\ 112%{m32:" ENDFILE_SPEC32 "} \ 113%{m64:" ENDFILE_SPEC64 "} \ |
111%{!m32:%{!m64:" ENDFILE_SPEC32 "}}" | 114%{!m32:%{!m64:" ENDFILE_SPEC32 "}} " \ 115ENDFILE_SPEC_COMMON |
112#else 113#define ENDFILE_SPEC "\ 114%{m32:" ENDFILE_SPEC32 "} \ 115%{m64:" ENDFILE_SPEC64 "} \ | 116#else 117#define ENDFILE_SPEC "\ 118%{m32:" ENDFILE_SPEC32 "} \ 119%{m64:" ENDFILE_SPEC64 "} \ |
116%{!m32:%{!m64:" ENDFILE_SPEC64 "}}" | 120%{!m32:%{!m64:" ENDFILE_SPEC64 "}} " \ 121ENDFILE_SPEC_COMMON |
117#endif 118 119#else 120 | 122#endif 123 124#else 125 |
121#define ENDFILE_SPEC ENDFILE_SPEC64 | 126#define ENDFILE_SPEC ENDFILE_SPEC64 " " ENDFILE_SPEC_COMMON |
122 123#endif 124 125/* The GNU C++ standard library requires that these macros be defined. */ 126#undef CPLUSPLUS_CPP_SPEC 127#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" 128 129#undef TARGET_VERSION --- 9 unchanged lines hidden (view full) --- 139{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, 140 141#undef WCHAR_TYPE 142#define WCHAR_TYPE "int" 143 144#undef WCHAR_TYPE_SIZE 145#define WCHAR_TYPE_SIZE 32 146 | 127 128#endif 129 130/* The GNU C++ standard library requires that these macros be defined. */ 131#undef CPLUSPLUS_CPP_SPEC 132#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" 133 134#undef TARGET_VERSION --- 9 unchanged lines hidden (view full) --- 144{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, 145 146#undef WCHAR_TYPE 147#define WCHAR_TYPE "int" 148 149#undef WCHAR_TYPE_SIZE 150#define WCHAR_TYPE_SIZE 32 151 |
147#undef MAX_WCHAR_TYPE_SIZE 148 | |
149/* Define for support of TFmode long double and REAL_ARITHMETIC. 150 Sparc ABI says that long double is 4 words. */ 151#undef LONG_DOUBLE_TYPE_SIZE 152#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) 153 154/* Constant which presents upper bound of the above value. */ 155#undef MAX_LONG_DOUBLE_TYPE_SIZE 156#define MAX_LONG_DOUBLE_TYPE_SIZE 128 157 158/* Define this to set long double type size to use in libgcc2.c, which can 159 not depend on target_flags. */ 160#if defined(__arch64__) || defined(__LONG_DOUBLE_128__) 161#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 162#else 163#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 164#endif 165 166#undef CPP_PREDEFINES | 152/* Define for support of TFmode long double and REAL_ARITHMETIC. 153 Sparc ABI says that long double is 4 words. */ 154#undef LONG_DOUBLE_TYPE_SIZE 155#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64) 156 157/* Constant which presents upper bound of the above value. */ 158#undef MAX_LONG_DOUBLE_TYPE_SIZE 159#define MAX_LONG_DOUBLE_TYPE_SIZE 128 160 161/* Define this to set long double type size to use in libgcc2.c, which can 162 not depend on target_flags. */ 163#if defined(__arch64__) || defined(__LONG_DOUBLE_128__) 164#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128 165#else 166#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64 167#endif 168 169#undef CPP_PREDEFINES |
167#define CPP_PREDEFINES "-D__ELF__ -Dunix -D_LONGLONG -D__sparc__ -Dlinux -Asystem=unix -Asystem=posix" | 170#define CPP_PREDEFINES "-D__ELF__ -Dunix -D_LONGLONG -D__sparc__ -D__gnu_linux__ -Dlinux -Asystem=unix -Asystem=posix" |
168 169#undef CPP_SUBTARGET_SPEC 170#define CPP_SUBTARGET_SPEC "\ 171%{fPIC:-D__PIC__ -D__pic__} \ 172%{fpic:-D__PIC__ -D__pic__} \ 173%{posix:-D_POSIX_SOURCE} \ 174%{pthread:-D_REENTRANT} \ 175" --- 65 unchanged lines hidden (view full) --- 241 242#undef CC1_SPEC 243#if DEFAULT_ARCH32_P 244#define CC1_SPEC "\ 245%{sun4:} %{target:} \ 246%{mcypress:-mcpu=cypress} \ 247%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \ 248%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \ | 171 172#undef CPP_SUBTARGET_SPEC 173#define CPP_SUBTARGET_SPEC "\ 174%{fPIC:-D__PIC__ -D__pic__} \ 175%{fpic:-D__PIC__ -D__pic__} \ 176%{posix:-D_POSIX_SOURCE} \ 177%{pthread:-D_REENTRANT} \ 178" --- 65 unchanged lines hidden (view full) --- 244 245#undef CC1_SPEC 246#if DEFAULT_ARCH32_P 247#define CC1_SPEC "\ 248%{sun4:} %{target:} \ 249%{mcypress:-mcpu=cypress} \ 250%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \ 251%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \ |
252%{m32:%{m64:%emay not use both -m32 and -m64}} \ |
|
249%{m64:-mptr64 -mstack-bias -mlong-double-128 \ 250 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=ultrasparc}}}}}}} \ 251 %{!mno-vis:%{!mcpu=v9:-mvis}}} \ 252" 253#else 254#define CC1_SPEC "\ 255%{sun4:} %{target:} \ 256%{mcypress:-mcpu=cypress} \ 257%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \ 258%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \ | 253%{m64:-mptr64 -mstack-bias -mlong-double-128 \ 254 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=ultrasparc}}}}}}} \ 255 %{!mno-vis:%{!mcpu=v9:-mvis}}} \ 256" 257#else 258#define CC1_SPEC "\ 259%{sun4:} %{target:} \ 260%{mcypress:-mcpu=cypress} \ 261%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \ 262%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \ |
263%{m32:%{m64:%emay not use both -m32 and -m64}} \ |
|
259%{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \ 260 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=cypress}}}}}}}} \ 261%{!m32:%{!mcpu*:-mcpu=ultrasparc}} \ 262%{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}} \ 263" 264#endif 265 266#if DEFAULT_ARCH32_P --- 53 unchanged lines hidden (view full) --- 320 assemble_name ((FILE), (NAME)); \ 321 putc ('\n', (FILE)); \ 322 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ 323} while (0) 324 325#undef COMMON_ASM_OP 326#define COMMON_ASM_OP "\t.common\t" 327 | 264%{m32:-mptr32 -mno-stack-bias %{!mlong-double-128:-mlong-double-64} \ 265 %{!mcpu*:%{!mcypress:%{!msparclite:%{!mf930:%{!mf934:%{!mv8:%{!msupersparc:-mcpu=cypress}}}}}}}} \ 266%{!m32:%{!mcpu*:-mcpu=ultrasparc}} \ 267%{!mno-vis:%{!m32:%{!mcpu=v9:-mvis}}} \ 268" 269#endif 270 271#if DEFAULT_ARCH32_P --- 53 unchanged lines hidden (view full) --- 325 assemble_name ((FILE), (NAME)); \ 326 putc ('\n', (FILE)); \ 327 ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \ 328} while (0) 329 330#undef COMMON_ASM_OP 331#define COMMON_ASM_OP "\t.common\t" 332 |
333#undef LOCAL_LABEL_PREFIX 334#define LOCAL_LABEL_PREFIX "." 335 |
|
328/* This is how to output a definition of an internal numbered label where 329 PREFIX is the class of label and NUM is the number within the class. */ 330 331#undef ASM_OUTPUT_INTERNAL_LABEL 332#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 333 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM) 334 335/* This is how to output a reference to an internal numbered label where --- 20 unchanged lines hidden (view full) --- 356 RELATIVE relocations. */ 357 358/* #define DWARF_OFFSET_SIZE PTR_SIZE */ 359 360#if defined(HAVE_LD_EH_FRAME_HDR) 361#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " 362#endif 363 | 336/* This is how to output a definition of an internal numbered label where 337 PREFIX is the class of label and NUM is the number within the class. */ 338 339#undef ASM_OUTPUT_INTERNAL_LABEL 340#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 341 fprintf (FILE, ".L%s%d:\n", PREFIX, NUM) 342 343/* This is how to output a reference to an internal numbered label where --- 20 unchanged lines hidden (view full) --- 364 RELATIVE relocations. */ 365 366/* #define DWARF_OFFSET_SIZE PTR_SIZE */ 367 368#if defined(HAVE_LD_EH_FRAME_HDR) 369#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " 370#endif 371 |
372/* Don't be different from other Linux platforms in this regard. */ 373#define HANDLE_PRAGMA_PACK_PUSH_POP 374 375/* We use GNU ld so undefine this so that attribute((init_priority)) works. */ 376#undef CTORS_SECTION_ASM_OP 377#undef DTORS_SECTION_ASM_OP 378 379/* Do code reading to identify a signal frame, and set the frame 380 state data appropriately. See unwind-dw2.c for the structs. */ 381 382/* Handle multilib correctly. */ 383#if defined(__arch64__) 384/* 64-bit Sparc version */ 385#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ 386 do { \ 387 unsigned int *pc_ = (CONTEXT)->ra; \ 388 long new_cfa_, i_; \ 389 long regs_off_, fpu_save_off_; \ 390 long this_cfa_, fpu_save_; \ 391 \ 392 if (pc_[0] != 0x82102065 /* mov NR_rt_sigreturn, %g1 */ \ 393 || pc_[1] != 0x91d0206d) /* ta 0x6d */ \ 394 break; \ 395 regs_off_ = 192 + 128; \ 396 fpu_save_off_ = regs_off_ + (16 * 8) + (3 * 8) + (2 * 4); \ 397 this_cfa_ = (long) (CONTEXT)->cfa; \ 398 new_cfa_ = *(long *)(((CONTEXT)->cfa) + (regs_off_ + (14 * 8))); \ 399 new_cfa_ += 2047; /* Stack bias */ \ 400 fpu_save_ = *(long *)((this_cfa_) + (fpu_save_off_)); \ 401 (FS)->cfa_how = CFA_REG_OFFSET; \ 402 (FS)->cfa_reg = 14; \ 403 (FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \ 404 for (i_ = 1; i_ < 16; ++i_) \ 405 { \ 406 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ 407 (FS)->regs.reg[i_].loc.offset = \ 408 this_cfa_ + (regs_off_ + (i_ * 8)) - new_cfa_; \ 409 } \ 410 for (i_ = 0; i_ < 16; ++i_) \ 411 { \ 412 (FS)->regs.reg[i_ + 16].how = REG_SAVED_OFFSET; \ 413 (FS)->regs.reg[i_ + 16].loc.offset = \ 414 this_cfa_ + (i_ * 8) - new_cfa_; \ 415 } \ 416 if (fpu_save_) \ 417 { \ 418 for (i_ = 0; i_ < 64; ++i_) \ 419 { \ 420 if (i_ > 32 && (i_ & 0x1)) \ 421 continue; \ 422 (FS)->regs.reg[i_ + 32].how = REG_SAVED_OFFSET; \ 423 (FS)->regs.reg[i_ + 32].loc.offset = \ 424 (fpu_save_ + (i_ * 4)) - new_cfa_; \ 425 } \ 426 } \ 427 /* Stick return address into %g0, same trick Alpha uses. */ \ 428 (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ 429 (FS)->regs.reg[0].loc.offset = \ 430 this_cfa_ + (regs_off_ + (16 * 8) + 8) - new_cfa_; \ 431 (FS)->retaddr_column = 0; \ 432 goto SUCCESS; \ 433 } while (0) 434#else 435/* 32-bit Sparc version */ 436#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \ 437 do { \ 438 unsigned int *pc_ = (CONTEXT)->ra; \ 439 int new_cfa_, i_, oldstyle_; \ 440 int regs_off_, fpu_save_off_; \ 441 int fpu_save_, this_cfa_; \ 442 \ 443 if (pc_[1] != 0x91d02010) /* ta 0x10 */ \ 444 break; \ 445 if (pc_[0] == 0x821020d8) /* mov NR_sigreturn, %g1 */ \ 446 oldstyle_ = 1; \ 447 else if (pc_[0] == 0x82102065) /* mov NR_rt_sigreturn, %g1 */ \ 448 oldstyle_ = 0; \ 449 else \ 450 break; \ 451 if (oldstyle_) \ 452 { \ 453 regs_off_ = 96; \ 454 fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4); \ 455 } \ 456 else \ 457 { \ 458 regs_off_ = 96 + 128; \ 459 fpu_save_off_ = regs_off_ + (4 * 4) + (16 * 4) + (2 * 4); \ 460 } \ 461 this_cfa_ = (int) (CONTEXT)->cfa; \ 462 new_cfa_ = *(int *)(((CONTEXT)->cfa) + (regs_off_+(4*4)+(14 * 4))); \ 463 fpu_save_ = *(int *)((this_cfa_) + (fpu_save_off_)); \ 464 (FS)->cfa_how = CFA_REG_OFFSET; \ 465 (FS)->cfa_reg = 14; \ 466 (FS)->cfa_offset = new_cfa_ - (int) (CONTEXT)->cfa; \ 467 for (i_ = 1; i_ < 16; ++i_) \ 468 { \ 469 if (i_ == 14) \ 470 continue; \ 471 (FS)->regs.reg[i_].how = REG_SAVED_OFFSET; \ 472 (FS)->regs.reg[i_].loc.offset = \ 473 this_cfa_ + (regs_off_+(4 * 4)+(i_ * 4)) - new_cfa_; \ 474 } \ 475 for (i_ = 0; i_ < 16; ++i_) \ 476 { \ 477 (FS)->regs.reg[i_ + 16].how = REG_SAVED_OFFSET; \ 478 (FS)->regs.reg[i_ + 16].loc.offset = \ 479 this_cfa_ + (i_ * 4) - new_cfa_; \ 480 } \ 481 if (fpu_save_) \ 482 { \ 483 for (i_ = 0; i_ < 32; ++i_) \ 484 { \ 485 (FS)->regs.reg[i_ + 32].how = REG_SAVED_OFFSET; \ 486 (FS)->regs.reg[i_ + 32].loc.offset = \ 487 (fpu_save_ + (i_ * 4)) - new_cfa_; \ 488 } \ 489 } \ 490 /* Stick return address into %g0, same trick Alpha uses. */ \ 491 (FS)->regs.reg[0].how = REG_SAVED_OFFSET; \ 492 (FS)->regs.reg[0].loc.offset = this_cfa_+(regs_off_+4)-new_cfa_; \ 493 (FS)->retaddr_column = 0; \ 494 goto SUCCESS; \ 495 } while (0) 496#endif |
|