1/* Xstormy16 cpu description. 2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 3 Free Software Foundation, Inc. 4 Contributed by Red Hat, Inc. 5 6This file is part of GCC. 7 8GCC is free software; you can redistribute it and/or modify 9it under the terms of the GNU General Public License as published by 10the Free Software Foundation; either version 2, or (at your option) 11any later version. 12 13GCC is distributed in the hope that it will be useful, 14but WITHOUT ANY WARRANTY; without even the implied warranty of 15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16GNU General Public License for more details. 17 18You should have received a copy of the GNU General Public License 19along with GCC; see the file COPYING. If not, write to 20the Free Software Foundation, 51 Franklin Street, Fifth Floor, 21Boston, MA 02110-1301, USA. */ 22 23 24/* Driver configuration */ 25 26/* Defined in svr4.h. */ 27#undef ASM_SPEC 28#define ASM_SPEC "" 29 30/* For xstormy16: 31 - If -msim is specified, everything is built and linked as for the sim. 32 - If -T is specified, that linker script is used, and it should provide 33 appropriate libraries. 34 - If neither is specified, everything is built as for the sim, but no 35 I/O support is assumed. 36 37*/ 38#undef LIB_SPEC 39#define LIB_SPEC "-( -lc %{msim:-lsim}%{!msim:%{!T*:-lnosys}} -)" 40 41/* Defined in svr4.h. */ 42#undef STARTFILE_SPEC 43#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s" 44 45/* Defined in svr4.h. */ 46#undef ENDFILE_SPEC 47#define ENDFILE_SPEC "crtend.o%s crtn.o%s" 48 49/* Defined in svr4.h for host compilers. */ 50/* #define MD_EXEC_PREFIX "" */ 51 52/* Defined in svr4.h for host compilers. */ 53/* #define MD_STARTFILE_PREFIX "" */ 54 55 56/* Run-time target specifications */ 57 58#define TARGET_CPU_CPP_BUILTINS() do { \ 59 builtin_define_std ("xstormy16"); \ 60 builtin_assert ("machine=xstormy16"); \ 61 builtin_assert ("cpu=xstormy16"); \ 62} while (0) 63 64#define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)"); 65 66#define CAN_DEBUG_WITHOUT_FP 67 68 69/* Storage Layout */ 70 71#define BITS_BIG_ENDIAN 1 72 73#define BYTES_BIG_ENDIAN 0 74 75#define WORDS_BIG_ENDIAN 0 76 77#define UNITS_PER_WORD 2 78 79#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ 80do { \ 81 if (GET_MODE_CLASS (MODE) == MODE_INT \ 82 && GET_MODE_SIZE (MODE) < 2) \ 83 (MODE) = HImode; \ 84} while (0) 85 86#define PARM_BOUNDARY 16 87 88#define STACK_BOUNDARY 16 89 90#define FUNCTION_BOUNDARY 16 91 92#define BIGGEST_ALIGNMENT 16 93 94/* Defined in svr4.h. */ 95/* #define MAX_OFILE_ALIGNMENT */ 96 97#define DATA_ALIGNMENT(TYPE, ALIGN) \ 98 (TREE_CODE (TYPE) == ARRAY_TYPE \ 99 && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ 100 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) 101 102#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ 103 (TREE_CODE (EXP) == STRING_CST \ 104 && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) 105 106#define STRICT_ALIGNMENT 1 107 108/* Defined in svr4.h. */ 109#define PCC_BITFIELD_TYPE_MATTERS 1 110 111/* Layout of Source Language Data Types */ 112 113#define INT_TYPE_SIZE 16 114 115#define SHORT_TYPE_SIZE 16 116 117#define LONG_TYPE_SIZE 32 118 119#define LONG_LONG_TYPE_SIZE 64 120 121#define FLOAT_TYPE_SIZE 32 122 123#define DOUBLE_TYPE_SIZE 64 124 125#define LONG_DOUBLE_TYPE_SIZE 64 126 127#define DEFAULT_SIGNED_CHAR 0 128 129/* Defined in svr4.h. */ 130#define SIZE_TYPE "unsigned int" 131 132/* Defined in svr4.h. */ 133#define PTRDIFF_TYPE "int" 134 135/* Defined in svr4.h, to "long int". */ 136/* #define WCHAR_TYPE "long int" */ 137 138/* Defined in svr4.h. */ 139#undef WCHAR_TYPE_SIZE 140#define WCHAR_TYPE_SIZE 32 141 142/* Define this macro if the type of Objective-C selectors should be `int'. 143 144 If this macro is not defined, then selectors should have the type `struct 145 objc_selector *'. */ 146/* #define OBJC_INT_SELECTORS */ 147 148 149/* Register Basics */ 150 151#define FIRST_PSEUDO_REGISTER 19 152 153#define FIXED_REGISTERS \ 154 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1 } 155 156#define CALL_USED_REGISTERS \ 157 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 } 158 159 160/* Order of allocation of registers */ 161 162#define REG_ALLOC_ORDER { 7, 6, 5, 4, 3, 2, 1, 0, 9, 8, 10, 11, 12, 13, 14, 15, 16 } 163 164 165/* How Values Fit in Registers */ 166 167#define HARD_REGNO_NREGS(REGNO, MODE) \ 168 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) 169 170#define HARD_REGNO_MODE_OK(REGNO, MODE) ((REGNO) != 16 || (MODE) == BImode) 171 172/* A C expression that is nonzero if it is desirable to choose register 173 allocation so as to avoid move instructions between a value of mode MODE1 174 and a value of mode MODE2. 175 176 If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are 177 ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be 178 zero. */ 179#define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) != BImode && (MODE2) != BImode) 180 181 182/* Register Classes */ 183 184enum reg_class 185{ 186 NO_REGS, 187 R0_REGS, 188 R1_REGS, 189 TWO_REGS, 190 R2_REGS, 191 EIGHT_REGS, 192 R8_REGS, 193 ICALL_REGS, 194 GENERAL_REGS, 195 CARRY_REGS, 196 ALL_REGS, 197 LIM_REG_CLASSES 198}; 199 200#define N_REG_CLASSES ((int) LIM_REG_CLASSES) 201 202#define REG_CLASS_NAMES \ 203{ \ 204 "NO_REGS", \ 205 "R0_REGS", \ 206 "R1_REGS", \ 207 "TWO_REGS", \ 208 "R2_REGS", \ 209 "EIGHT_REGS", \ 210 "R8_REGS", \ 211 "ICALL_REGS", \ 212 "GENERAL_REGS", \ 213 "CARRY_REGS", \ 214 "ALL_REGS" \ 215} 216 217#define REG_CLASS_CONTENTS \ 218{ \ 219 { 0x00000 }, \ 220 { 0x00001 }, \ 221 { 0x00002 }, \ 222 { 0x00003 }, \ 223 { 0x00004 }, \ 224 { 0x000FF }, \ 225 { 0x00100 }, \ 226 { 0x00300 }, \ 227 { 0x6FFFF }, \ 228 { 0x10000 }, \ 229 { (1 << FIRST_PSEUDO_REGISTER) - 1 } \ 230} 231 232#define REGNO_REG_CLASS(REGNO) \ 233 ((REGNO) == 0 ? R0_REGS \ 234 : (REGNO) == 1 ? R1_REGS \ 235 : (REGNO) == 2 ? R2_REGS \ 236 : (REGNO) < 8 ? EIGHT_REGS \ 237 : (REGNO) == 8 ? R8_REGS \ 238 : (REGNO) == 16 ? CARRY_REGS \ 239 : (REGNO) <= 18 ? GENERAL_REGS \ 240 : ALL_REGS) 241 242#define BASE_REG_CLASS GENERAL_REGS 243 244#define INDEX_REG_CLASS GENERAL_REGS 245 246/* The following letters are unavailable, due to being used as 247 constraints: 248 '0'..'9' 249 '<', '>' 250 'E', 'F', 'G', 'H' 251 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P' 252 'Q', 'R', 'S', 'T', 'U' 253 'V', 'X' 254 'g', 'i', 'm', 'n', 'o', 'p', 'r', 's' */ 255 256#define REG_CLASS_FROM_LETTER(CHAR) \ 257 ( (CHAR) == 'a' ? R0_REGS \ 258 : (CHAR) == 'b' ? R1_REGS \ 259 : (CHAR) == 'c' ? R2_REGS \ 260 : (CHAR) == 'd' ? R8_REGS \ 261 : (CHAR) == 'e' ? EIGHT_REGS \ 262 : (CHAR) == 't' ? TWO_REGS \ 263 : (CHAR) == 'y' ? CARRY_REGS \ 264 : (CHAR) == 'z' ? ICALL_REGS \ 265 : NO_REGS) 266 267#define REGNO_OK_FOR_BASE_P(NUM) 1 268 269#define REGNO_OK_FOR_INDEX_P(NUM) REGNO_OK_FOR_BASE_P (NUM) 270 271/* This declaration must be present. */ 272#define PREFERRED_RELOAD_CLASS(X, CLASS) \ 273 xstormy16_preferred_reload_class (X, CLASS) 274 275#define PREFERRED_OUTPUT_RELOAD_CLASS(X, CLASS) \ 276 xstormy16_preferred_reload_class (X, CLASS) 277 278/* This chip has the interesting property that only the first eight 279 registers can be moved to/from memory. */ 280#define SECONDARY_RELOAD_CLASS(CLASS, MODE, X) \ 281 xstormy16_secondary_reload_class (CLASS, MODE, X) 282 283/* Normally the compiler avoids choosing registers that have been explicitly 284 mentioned in the rtl as spill registers (these registers are normally those 285 used to pass parameters and return values). However, some machines have so 286 few registers of certain classes that there would not be enough registers to 287 use as spill registers if this were done. 288 289 Define `SMALL_REGISTER_CLASSES' to be an expression with a nonzero value on 290 these machines. When this macro has a nonzero value, the compiler allows 291 registers explicitly used in the rtl to be used as spill registers but 292 avoids extending the lifetime of these registers. 293 294 It is always safe to define this macro with a nonzero value, but if you 295 unnecessarily define it, you will reduce the amount of optimizations that 296 can be performed in some cases. If you do not define this macro with a 297 nonzero value when it is required, the compiler will run out of spill 298 registers and print a fatal error message. For most machines, you should 299 not define this macro at all. */ 300/* #define SMALL_REGISTER_CLASSES */ 301 302/* This declaration is required. */ 303#define CLASS_MAX_NREGS(CLASS, MODE) \ 304 ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) 305 306/* If defined, a C expression for a class that contains registers which the 307 compiler must always access in a mode that is the same size as the mode in 308 which it loaded the register. 309 310 For the example, loading 32-bit integer or floating-point objects into 311 floating-point registers on the Alpha extends them to 64-bits. Therefore 312 loading a 64-bit object and then storing it as a 32-bit object does not 313 store the low-order 32-bits, as would be the case for a normal register. 314 Therefore, `alpha.h' defines this macro as `FLOAT_REGS'. */ 315/* #define CLASS_CANNOT_CHANGE_SIZE */ 316 317#define CONST_OK_FOR_LETTER_P(VALUE, C) \ 318 ( (C) == 'I' ? (VALUE) >= 0 && (VALUE) <= 3 \ 319 : (C) == 'J' ? exact_log2 (VALUE) != -1 \ 320 : (C) == 'K' ? exact_log2 (~(VALUE)) != -1 \ 321 : (C) == 'L' ? (VALUE) >= 0 && (VALUE) <= 255 \ 322 : (C) == 'M' ? (VALUE) >= -255 && (VALUE) <= 0 \ 323 : (C) == 'N' ? (VALUE) >= -3 && (VALUE) <= 0 \ 324 : (C) == 'O' ? (VALUE) >= 1 && (VALUE) <= 4 \ 325 : (C) == 'P' ? (VALUE) >= -4 && (VALUE) <= -1 \ 326 : 0 ) 327 328#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0 329 330#define EXTRA_CONSTRAINT(VALUE, C) \ 331 xstormy16_extra_constraint_p (VALUE, C) 332 333 334/* Basic Stack Layout */ 335 336/* We want to use post-increment instructions to push things on the stack, 337 because we don't have any pre-increment ones. */ 338#define STACK_PUSH_CODE POST_INC 339 340#define FRAME_GROWS_DOWNWARD 0 341 342#define ARGS_GROW_DOWNWARD 1 343 344#define STARTING_FRAME_OFFSET 0 345 346#define FIRST_PARM_OFFSET(FUNDECL) 0 347 348#define RETURN_ADDR_RTX(COUNT, FRAMEADDR) \ 349 ((COUNT) == 0 \ 350 ? gen_rtx_MEM (Pmode, arg_pointer_rtx) \ 351 : NULL_RTX) 352 353#define INCOMING_RETURN_ADDR_RTX \ 354 gen_rtx_MEM (SImode, gen_rtx_PLUS (Pmode, stack_pointer_rtx, GEN_INT (-4))) 355 356#define INCOMING_FRAME_SP_OFFSET (xstormy16_interrupt_function_p () ? 6 : 4) 357 358 359/* Register That Address the Stack Frame. */ 360 361#define STACK_POINTER_REGNUM 15 362 363#define FRAME_POINTER_REGNUM 17 364 365#define HARD_FRAME_POINTER_REGNUM 13 366 367#define ARG_POINTER_REGNUM 18 368 369#define STATIC_CHAIN_REGNUM 1 370 371 372/* Eliminating the Frame Pointer and the Arg Pointer */ 373 374#define FRAME_POINTER_REQUIRED 0 375 376#define ELIMINABLE_REGS \ 377{ \ 378 {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 379 {FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ 380 {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ 381 {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ 382} 383 384#define CAN_ELIMINATE(FROM, TO) \ 385 ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ 386 ? ! frame_pointer_needed \ 387 : 1) 388 389#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ 390 (OFFSET) = xstormy16_initial_elimination_offset (FROM, TO) 391 392 393/* Passing Function Arguments on the Stack */ 394 395#define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) 396 397#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0 398 399 400/* Function Arguments in Registers */ 401 402#define NUM_ARGUMENT_REGISTERS 6 403#define FIRST_ARGUMENT_REGISTER 2 404 405#define XSTORMY16_WORD_SIZE(TYPE, MODE) \ 406 ((((TYPE) ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \ 407 + 1) \ 408 / 2) 409 410#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ 411 xstormy16_function_arg (CUM, MODE, TYPE, NAMED) 412 413/* For this platform, the value of CUMULATIVE_ARGS is the number of words 414 of arguments that have been passed in registers so far. */ 415#define CUMULATIVE_ARGS int 416 417#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ 418 (CUM) = 0 419 420#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ 421 ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED)) 422 423#define FUNCTION_ARG_REGNO_P(REGNO) \ 424 ((REGNO) >= FIRST_ARGUMENT_REGISTER \ 425 && (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS) 426 427 428/* How Scalar Function Values are Returned */ 429 430/* The number of the hard register that is used to return a scalar value from a 431 function call. */ 432#define RETURN_VALUE_REGNUM FIRST_ARGUMENT_REGISTER 433 434#define FUNCTION_VALUE(VALTYPE, FUNC) \ 435 xstormy16_function_value (VALTYPE, FUNC) 436 437#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, RETURN_VALUE_REGNUM) 438 439#define FUNCTION_VALUE_REGNO_P(REGNO) ((REGNO) == RETURN_VALUE_REGNUM) 440 441 442/* Function Entry and Exit */ 443 444#define EPILOGUE_USES(REGNO) \ 445 xstormy16_epilogue_uses (REGNO) 446 447 448/* Generating Code for Profiling. */ 449 450/* This declaration must be present, but it can be an abort if profiling is 451 not implemented. */ 452 453#define FUNCTION_PROFILER(FILE, LABELNO) xstormy16_function_profiler () 454 455 456/* If the target has particular reasons why a function cannot be inlined, 457 it may define the TARGET_CANNOT_INLINE_P. This macro takes one argument, 458 the DECL describing the function. The function should NULL if the function 459 *can* be inlined. Otherwise it should return a pointer to a string containing 460 a message describing why the function could not be inlined. The message will 461 displayed if the '-Winline' command line switch has been given. If the message 462 contains a '%s' sequence, this will be replaced by the name of the function. */ 463/* #define TARGET_CANNOT_INLINE_P(FN_DECL) xstormy16_cannot_inline_p (FN_DECL) */ 464 465/* Implementing the Varargs Macros. */ 466 467/* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this 468 is stdarg.h instead of varargs.h. VALIST is the tree of the va_list 469 variable to initialize. NEXTARG is the machine independent notion of the 470 'next' argument after the variable arguments. If not defined, a standard 471 implementation will be defined that works for arguments passed on the stack. */ 472#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \ 473 xstormy16_expand_builtin_va_start (VALIST, NEXTARG) 474 475/* Trampolines for Nested Functions. */ 476 477#define TRAMPOLINE_SIZE 8 478 479#define TRAMPOLINE_ALIGNMENT 16 480 481#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \ 482 xstormy16_initialize_trampoline (ADDR, FNADDR, STATIC_CHAIN) 483 484 485/* Define this macro to override the type used by the library routines to pick 486 up arguments of type `float'. (By default, they use a union of `float' and 487 `int'.) 488 489 The obvious choice would be `float'--but that won't work with traditional C 490 compilers that expect all arguments declared as `float' to arrive as 491 `double'. To avoid this conversion, the library routines ask for the value 492 as some other type and then treat it as a `float'. */ 493/* #define FLOAT_ARG_TYPE */ 494 495/* Define this macro to override the way library routines redesignate a `float' 496 argument as a `float' instead of the type it was passed as. The default is 497 an expression which takes the `float' field of the union. */ 498/* #define FLOATIFY(PASSED_VALUE) */ 499 500/* Define this macro to override the type used by the library routines to 501 return values that ought to have type `float'. (By default, they use 502 `int'.) 503 504 The obvious choice would be `float'--but that won't work with traditional C 505 compilers gratuitously convert values declared as `float' into `double'. */ 506/* #define FLOAT_VALUE_TYPE */ 507 508/* Define this macro to override the way the value of a `float'-returning 509 library routine should be packaged in order to return it. These functions 510 are actually declared to return type `FLOAT_VALUE_TYPE' (normally `int'). 511 512 These values can't be returned as type `float' because traditional C 513 compilers would gratuitously convert the value to a `double'. 514 515 A local variable named `intify' is always available when the macro `INTIFY' 516 is used. It is a union of a `float' field named `f' and a field named `i' 517 whose type is `FLOAT_VALUE_TYPE' or `int'. 518 519 If you don't define this macro, the default definition works by copying the 520 value through that union. */ 521/* #define INTIFY(FLOAT_VALUE) */ 522 523/* Define this macro as the name of the data type corresponding to `SImode' in 524 the system's own C compiler. 525 526 You need not define this macro if that type is `long int', as it usually is. */ 527/* #define nongcc_SI_type */ 528 529/* Define this macro as the name of the data type corresponding to the 530 word_mode in the system's own C compiler. 531 532 You need not define this macro if that type is `long int', as it usually is. */ 533/* #define nongcc_word_type */ 534 535/* Define these macros to supply explicit C statements to carry out various 536 arithmetic operations on types `float' and `double' in the library routines 537 in `libgcc1.c'. See that file for a full list of these macros and their 538 arguments. 539 540 On most machines, you don't need to define any of these macros, because the 541 C compiler that comes with the system takes care of doing them. */ 542/* #define perform_... */ 543 544 545/* Addressing Modes */ 546 547#define HAVE_POST_INCREMENT 1 548 549#define HAVE_PRE_DECREMENT 1 550 551#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X) 552 553#define MAX_REGS_PER_ADDRESS 1 554 555#ifdef REG_OK_STRICT 556#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \ 557do { \ 558 if (xstormy16_legitimate_address_p (MODE, X, 1)) \ 559 goto LABEL; \ 560} while (0) 561#else 562#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \ 563do { \ 564 if (xstormy16_legitimate_address_p (MODE, X, 0)) \ 565 goto LABEL; \ 566} while (0) 567#endif 568 569#ifdef REG_OK_STRICT 570#define REG_OK_FOR_BASE_P(X) \ 571 (REGNO_OK_FOR_BASE_P (REGNO (X)) && (REGNO (X) < FIRST_PSEUDO_REGISTER)) 572#else 573#define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) 574#endif 575 576#define REG_OK_FOR_INDEX_P(X) REG_OK_FOR_BASE_P (X) 577 578/* On this chip, this is true if the address is valid with an offset 579 of 0 but not of 6, because in that case it cannot be used as an 580 address for DImode or DFmode, or if the address is a post-increment 581 or pre-decrement address. 582*/ 583#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ 584 if (xstormy16_mode_dependent_address_p (ADDR)) \ 585 goto LABEL 586 587#define LEGITIMATE_CONSTANT_P(X) 1 588 589 590/* Describing Relative Costs of Operations */ 591 592#define REGISTER_MOVE_COST(MODE, FROM, TO) 2 593 594#define MEMORY_MOVE_COST(M,C,I) (5 + memory_move_secondary_cost (M, C, I)) 595 596#define BRANCH_COST 5 597 598#define SLOW_BYTE_ACCESS 0 599 600#define NO_FUNCTION_CSE 601 602 603/* Dividing the output into sections. */ 604 605#define TEXT_SECTION_ASM_OP ".text" 606 607#define DATA_SECTION_ASM_OP ".data" 608 609#define BSS_SECTION_ASM_OP "\t.section\t.bss" 610 611/* Define the pseudo-ops used to switch to the .ctors and .dtors sections. 612 There are no shared libraries on this target so these sections need 613 not be writable. 614 615 Defined in elfos.h. */ 616 617#undef CTORS_SECTION_ASM_OP 618#undef DTORS_SECTION_ASM_OP 619#define CTORS_SECTION_ASM_OP "\t.section\t.ctors,\"a\"" 620#define DTORS_SECTION_ASM_OP "\t.section\t.dtors,\"a\"" 621#define EXTRA_SECTIONS in_bss100 622 623/* We define the function body in a separate macro so that if we ever 624 add another section, we can just add an entry to 625 EXTRA_SECTION_FUNCTIONS without making it difficult to read. It is 626 not used anywhere else. */ 627#define XSTORMY16_SECTION_FUNCTION(name, in, string, bits) \ 628 void \ 629 name () \ 630 { \ 631 if (in_section != in) \ 632 { \ 633 fprintf (asm_out_file, "\t.section %s,\"aw\",@%sbits\n", string, bits); \ 634 in_section = in; \ 635 } \ 636 } 637 638#undef EXTRA_SECTION_FUNCTIONS 639#define EXTRA_SECTION_FUNCTIONS \ 640 XSTORMY16_SECTION_FUNCTION (bss100_section, in_bss100, ".bss_below100", "no") 641 642#define JUMP_TABLES_IN_TEXT_SECTION 1 643 644 645/* The Overall Framework of an Assembler File. */ 646 647#define ASM_COMMENT_START ";" 648 649#define ASM_APP_ON "#APP\n" 650 651#define ASM_APP_OFF "#NO_APP\n" 652 653/* Output of Data. */ 654 655#define IS_ASM_LOGICAL_LINE_SEPARATOR(C) ((C) == '|') 656 657#define ASM_OUTPUT_ALIGNED_DECL_COMMON(STREAM, DECL, NAME, SIZE, ALIGNMENT) \ 658 xstormy16_asm_output_aligned_common (STREAM, DECL, NAME, SIZE, ALIGNMENT, 1) 659#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(STREAM, DECL, NAME, SIZE, ALIGNMENT) \ 660 xstormy16_asm_output_aligned_common (STREAM, DECL, NAME, SIZE, ALIGNMENT, 0) 661 662 663/* Output and Generation of Labels. */ 664#define SYMBOL_FLAG_XSTORMY16_BELOW100 (SYMBOL_FLAG_MACH_DEP << 0) 665 666#define ASM_OUTPUT_SYMBOL_REF(STREAM, SYMBOL) \ 667 do { \ 668 const char *rn = XSTR (SYMBOL, 0); \ 669 if (SYMBOL_REF_FUNCTION_P (SYMBOL)) \ 670 ASM_OUTPUT_LABEL_REF ((STREAM), rn); \ 671 else \ 672 assemble_name (STREAM, rn); \ 673 } while (0) 674 675#define ASM_OUTPUT_LABEL_REF(STREAM, NAME) \ 676do { \ 677 fputs ("@fptr(", STREAM); \ 678 assemble_name (STREAM, NAME); \ 679 fputc (')', STREAM); \ 680} while (0) 681 682/* Globalizing directive for a label. */ 683#define GLOBAL_ASM_OP "\t.globl " 684 685 686/* Macros Controlling Initialization Routines. */ 687 688/* When you are using special sections for 689 initialization and termination functions, this macro also controls how 690 `crtstuff.c' and `libgcc2.c' arrange to run the initialization functions. 691 692 Defined in svr4.h. */ 693/* #define INIT_SECTION_ASM_OP */ 694 695/* Define this macro as a C statement to output on the stream STREAM the 696 assembler code to arrange to call the function named NAME at initialization 697 time. 698 699 Assume that NAME is the name of a C function generated automatically by the 700 compiler. This function takes no arguments. Use the function 701 `assemble_name' to output the name NAME; this performs any system-specific 702 syntactic transformations such as adding an underscore. 703 704 If you don't define this macro, nothing special is output to arrange to call 705 the function. This is correct when the function will be called in some 706 other manner--for example, by means of the `collect2' program, which looks 707 through the symbol table to find these functions by their names. 708 709 Defined in svr4.h. */ 710/* #define ASM_OUTPUT_CONSTRUCTOR(STREAM, NAME) */ 711 712/* This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination functions 713 rather than initialization functions. 714 715 Defined in svr4.h. */ 716/* #define ASM_OUTPUT_DESTRUCTOR(STREAM, NAME) */ 717 718/* Define this macro if the system uses ELF format object files. 719 720 Defined in svr4.h. */ 721/* #define OBJECT_FORMAT_ELF */ 722 723 724/* Output of Assembler Instructions. */ 725 726#define REGISTER_NAMES \ 727{ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ 728 "r11", "r12", "r13", "psw", "sp", "carry", "fp", "ap" } 729 730#define ADDITIONAL_REGISTER_NAMES \ 731 { { "r14", 14 }, \ 732 { "r15", 15 } } 733 734#define PRINT_OPERAND(STREAM, X, CODE) xstormy16_print_operand (STREAM, X, CODE) 735 736#define PRINT_OPERAND_ADDRESS(STREAM, X) xstormy16_print_operand_address (STREAM, X) 737 738/* USER_LABEL_PREFIX is defined in svr4.h. */ 739#define REGISTER_PREFIX "" 740#define LOCAL_LABEL_PREFIX "." 741#define USER_LABEL_PREFIX "" 742#define IMMEDIATE_PREFIX "#" 743 744#define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ 745 fprintf (STREAM, "\tpush %d\n", REGNO) 746 747#define ASM_OUTPUT_REG_POP(STREAM, REGNO) \ 748 fprintf (STREAM, "\tpop %d\n", REGNO) 749 750 751/* Output of dispatch tables. */ 752 753/* This port does not use the ASM_OUTPUT_ADDR_VEC_ELT macro, because 754 this could cause label alignment to appear between the 'br' and the table, 755 which would be bad. Instead, it controls the output of the table 756 itself. */ 757#define ASM_OUTPUT_ADDR_VEC(LABEL, BODY) \ 758 xstormy16_output_addr_vec (file, LABEL, BODY) 759 760/* Alignment for ADDR_VECs is the same as for code. */ 761#define ADDR_VEC_ALIGN(ADDR_VEC) 1 762 763 764/* Assembler Commands for Exception Regions. */ 765 766#define DWARF2_UNWIND_INFO 0 767 768/* Don't use __builtin_setjmp for unwinding, since it's tricky to get 769 at the high 16 bits of an address. */ 770#define DONT_USE_BUILTIN_SETJMP 771#define JMP_BUF_SIZE 8 772 773/* Assembler Commands for Alignment. */ 774 775#define ASM_OUTPUT_ALIGN(STREAM, POWER) \ 776 fprintf ((STREAM), "\t.p2align %d\n", (POWER)) 777 778 779/* Macros Affecting all Debug Formats. */ 780 781/* Defined in svr4.h. */ 782#undef PREFERRED_DEBUGGING_TYPE 783#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG 784 785 786/* Macros for SDB and Dwarf Output. */ 787 788/* Define this macro if addresses in Dwarf 2 debugging info should not 789 be the same size as pointers on the target architecture. The 790 macro's value should be the size, in bytes, to use for addresses in 791 the debugging info. 792 793 Some architectures use word addresses to refer to code locations, 794 but Dwarf 2 info always uses byte addresses. On such machines, 795 Dwarf 2 addresses need to be larger than the architecture's 796 pointers. */ 797#define DWARF2_ADDR_SIZE 4 798 799 800/* Miscellaneous Parameters. */ 801 802#define CASE_VECTOR_MODE SImode 803 804#define WORD_REGISTER_OPERATIONS 805 806#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND 807 808#define MOVE_MAX 2 809 810#define SHIFT_COUNT_TRUNCATED 1 811 812#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 813 814#define Pmode HImode 815 816#define FUNCTION_MODE HImode 817 818#define NO_IMPLICIT_EXTERN_C 819 820/* Defined in svr4.h. */ 821#define HANDLE_SYSV_PRAGMA 1 822 823/* Define this if the target system supports the function `atexit' from the 824 ANSI C standard. If this is not defined, and `INIT_SECTION_ASM_OP' is not 825 defined, a default `exit' function will be provided to support C++. 826 827 Defined by svr4.h */ 828/* #define HAVE_ATEXIT */ 829 830/* A C statement which is executed by the Haifa scheduler after it has scheduled 831 an insn from the ready list. FILE is either a null pointer, or a stdio stream 832 to write any debug output to. VERBOSE is the verbose level provided by 833 -fsched-verbose-<n>. INSN is the instruction that was scheduled. MORE is the 834 number of instructions that can be issued in the current cycle. This macro 835 is responsible for updating the value of MORE (typically by (MORE)--). */ 836/* #define MD_SCHED_VARIABLE_ISSUE (FILE, VERBOSE, INSN, MORE) */ 837 838 839/* Define the information needed to generate branch and scc insns. This is 840 stored from the compare operation. Note that we can't use "rtx" here 841 since it hasn't been defined! */ 842 843extern struct rtx_def *xstormy16_compare_op0, *xstormy16_compare_op1; 844 845/* End of xstormy16.h */ 846