159692Selan /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. 259692Selan Copyright (C) 1987, 1988 Free Software Foundation, Inc. 359692Selan 459692Selan This file is part of GNU CC. 559692Selan 659692Selan GNU CC is free software; you can redistribute it and/or modify 759692Selan it under the terms of the GNU General Public License as published by 859692Selan the Free Software Foundation; either version 2, or (at your option) 959692Selan any later version. 1059692Selan 1159692Selan GNU CC is distributed in the hope that it will be useful, 1259692Selan but WITHOUT ANY WARRANTY; without even the implied warranty of 1359692Selan MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1459692Selan GNU General Public License for more details. 1559692Selan 1659692Selan You should have received a copy of the GNU General Public License 1759692Selan along with GNU CC; see the file COPYING. If not, write to 1859692Selan the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 1959692Selan 2059692Selan 2159692Selan /* Note that some other tm.h files include this one and then override 2259692Selan many of the definitions that relate to assembler syntax. */ 2359692Selan 2459692Selan 2559692Selan /* Names to predefine in the preprocessor for this target machine. */ 2659692Selan 2759692Selan /* See sun3.h, sun2.h, isi.h for different CPP_PREDEFINES. */ 2859692Selan 2959692Selan /* Print subsidiary information on the compiler version in use. */ 3059692Selan #ifdef MOTOROLA 3159692Selan #define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)"); 3259692Selan #else 3359692Selan #define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)"); 3459692Selan #endif 3559692Selan 3659692Selan /* Define SUPPORT_SUN_FPA to include support for generating code for 3759692Selan the Sun Floating Point Accelerator, an optional product for Sun 3 3859692Selan machines. By default, it is not defined. Avoid defining it unless 3959692Selan you need to output code for the Sun3+FPA architecture, as it has the 4059692Selan effect of slowing down the register set operations in hard-reg-set.h 4159692Selan (total number of registers will exceed number of bits in a long, 4259692Selan if defined, causing the set operations to expand to loops). 4359692Selan SUPPORT_SUN_FPA is typically defined in sun3.h. */ 4459692Selan 4559692Selan /* Run-time compilation parameters selecting different hardware subsets. */ 4659692Selan 4759692Selan extern int target_flags; 4859692Selan 4959692Selan /* Macros used in the machine description to test the flags. */ 5059692Selan 5159692Selan /* Compile for a 68020 (not a 68000 or 68010). */ 5259692Selan #define TARGET_68020 (target_flags & 1) 5359692Selan 5459692Selan /* Compile 68881 insns for floating point (not library calls). */ 5559692Selan #define TARGET_68881 (target_flags & 2) 5659692Selan 5759692Selan /* Compile using 68020 bitfield insns. */ 5859692Selan #define TARGET_BITFIELD (target_flags & 4) 5959692Selan 6059692Selan /* Compile using rtd insn calling sequence. 6159692Selan This will not work unless you use prototypes at least 6259692Selan for all functions that can take varying numbers of args. */ 6359692Selan #define TARGET_RTD (target_flags & 8) 6459692Selan 6559692Selan /* Compile passing first two args in regs 0 and 1. 6659692Selan This exists only to test compiler features that will 6759692Selan be needed for RISC chips. It is not usable 6859692Selan and is not intended to be usable on this cpu. */ 6959692Selan #define TARGET_REGPARM (target_flags & 020) 7059692Selan 7159692Selan /* Compile with 16-bit `int'. */ 7259692Selan #define TARGET_SHORT (target_flags & 040) 7359692Selan 7459692Selan /* Compile with special insns for Sun FPA. */ 7559692Selan #ifdef SUPPORT_SUN_FPA 7659692Selan #define TARGET_FPA (target_flags & 0100) 7759692Selan #else 7859692Selan #define TARGET_FPA 0 7959692Selan #endif 8059692Selan 8159692Selan /* Compile (actually, link) for Sun SKY board. */ 8259692Selan #define TARGET_SKY (target_flags & 0200) 8359692Selan 8459692Selan /* Optimize for 68040, but still allow execution on 68020 8559692Selan (-m68020-40 or -m68040). 8659692Selan The 68040 will execute all 68030 and 68881/2 instructions, but some 8759692Selan of them must be emulated in software by the OS. When TARGET_68040 is 8859692Selan turned on, these instructions won't be used. This code will still 8959692Selan run on a 68030 and 68881/2. */ 9059692Selan #define TARGET_68040 (target_flags & 01400) 9159692Selan 9259692Selan /* Use the 68040-only fp instructions (-m68040). */ 9359692Selan #define TARGET_68040_ONLY (target_flags & 01000) 9459692Selan 9559692Selan /* Macro to define tables used to set the flags. 9659692Selan This is a list in braces of pairs in braces, 9759692Selan each pair being { "NAME", VALUE } 9859692Selan where VALUE is the bits to set or minus the bits to clear. 9959692Selan An empty string NAME is used to identify the default VALUE. */ 10059692Selan 10159692Selan #define TARGET_SWITCHES \ 10259692Selan { { "68020", 5}, \ 10359692Selan { "c68020", 5}, \ 10459692Selan { "68881", 2}, \ 10559692Selan { "bitfield", 4}, \ 10659692Selan { "68000", -5}, \ 10759692Selan { "c68000", -5}, \ 10859692Selan { "soft-float", -0102}, \ 10959692Selan { "nobitfield", -4}, \ 11059692Selan { "rtd", 8}, \ 11159692Selan { "nortd", -8}, \ 11259692Selan { "short", 040}, \ 11359692Selan { "noshort", -040}, \ 11459692Selan { "fpa", 0100}, \ 11559692Selan { "nofpa", -0100}, \ 11659692Selan { "sky", 0200}, \ 11759692Selan { "nosky", -0200}, \ 11859692Selan { "68020-40", 0407}, \ 11959692Selan { "68030", -01400}, \ 12059692Selan { "68030", 7}, \ 12159692Selan { "68040", 01007}, \ 12259692Selan { "", TARGET_DEFAULT}} 12359692Selan /* TARGET_DEFAULT is defined in sun*.h and isi.h, etc. */ 12459692Selan 12559692Selan #ifdef SUPPORT_SUN_FPA 12659692Selan /* Blow away 68881 flag silently on TARGET_FPA (since we can't clear 12759692Selan any bits in TARGET_SWITCHES above) */ 12859692Selan #define OVERRIDE_OPTIONS \ 12959692Selan { \ 13059692Selan if (TARGET_FPA) target_flags &= ~2; \ 13159692Selan if (! TARGET_68020 && flag_pic == 2) \ 13259692Selan error("-fPIC is not currently supported on the 68000 or 68010\n"); \ 13359692Selan } 13459692Selan #else 13559692Selan #define OVERRIDE_OPTIONS \ 13659692Selan { \ 13759692Selan if (! TARGET_68020 && flag_pic == 2) \ 13859692Selan error("-fPIC is not currently supported on the 68000 or 68010\n"); \ 13959692Selan } 14059692Selan #endif /* defined SUPPORT_SUN_FPA */ 14159692Selan 14259692Selan /* target machine storage layout */ 14359692Selan 14459692Selan /* Define this if most significant bit is lowest numbered 14559692Selan in instructions that operate on numbered bit-fields. 14659692Selan This is true for 68020 insns such as bfins and bfexts. 14759692Selan We make it true always by avoiding using the single-bit insns 14859692Selan except in special cases with constant bit numbers. */ 14959692Selan #define BITS_BIG_ENDIAN 1 15059692Selan 15159692Selan /* Define this if most significant byte of a word is the lowest numbered. */ 15259692Selan /* That is true on the 68000. */ 15359692Selan #define BYTES_BIG_ENDIAN 1 15459692Selan 15559692Selan /* Define this if most significant word of a multiword number is the lowest 15659692Selan numbered. */ 15759692Selan /* For 68000 we can decide arbitrarily 15859692Selan since there are no machine instructions for them. 15959692Selan So let's be consistent. */ 16059692Selan #define WORDS_BIG_ENDIAN 1 16159692Selan 16259692Selan /* number of bits in an addressable storage unit */ 16359692Selan #define BITS_PER_UNIT 8 16459692Selan 16559692Selan /* Width in bits of a "word", which is the contents of a machine register. 16659692Selan Note that this is not necessarily the width of data type `int'; 16759692Selan if using 16-bit ints on a 68000, this would still be 32. 16859692Selan But on a machine with 16-bit registers, this would be 16. */ 16959692Selan #define BITS_PER_WORD 32 17059692Selan 17159692Selan /* Width of a word, in units (bytes). */ 17259692Selan #define UNITS_PER_WORD 4 17359692Selan 17459692Selan /* Width in bits of a pointer. 17559692Selan See also the macro `Pmode' defined below. */ 17659692Selan #define POINTER_SIZE 32 17759692Selan 17859692Selan /* Allocation boundary (in *bits*) for storing arguments in argument list. */ 17959692Selan #define PARM_BOUNDARY (TARGET_SHORT ? 16 : 32) 18059692Selan 18159692Selan /* Boundary (in *bits*) on which stack pointer should be aligned. */ 18259692Selan #define STACK_BOUNDARY 16 18359692Selan 18459692Selan /* Allocation boundary (in *bits*) for the code of a function. */ 18559692Selan #define FUNCTION_BOUNDARY 16 18659692Selan 18759692Selan /* Alignment of field after `int : 0' in a structure. */ 18859692Selan #define EMPTY_FIELD_BOUNDARY 16 18959692Selan 19059692Selan /* No data type wants to be aligned rounder than this. */ 19159692Selan #define BIGGEST_ALIGNMENT 16 19259692Selan 19359692Selan /* Set this nonzero if move instructions will actually fail to work 19459692Selan when given unaligned data. */ 19559692Selan #define STRICT_ALIGNMENT 1 19659692Selan 19759692Selan #define SELECT_RTX_SECTION(MODE, X) \ 19859692Selan { \ 19959692Selan if (!flag_pic) \ 20059692Selan readonly_data_section(); \ 20159692Selan else if (LEGITIMATE_PIC_OPERAND_P (X)) \ 20259692Selan readonly_data_section(); \ 20359692Selan else \ 20459692Selan data_section(); \ 20559692Selan } 20659692Selan 20759692Selan /* Define number of bits in most basic integer type. 20859692Selan (If undefined, default is BITS_PER_WORD). */ 20959692Selan 21059692Selan #define INT_TYPE_SIZE (TARGET_SHORT ? 16 : 32) 21159692Selan 21259692Selan /* Define these to avoid dependence on meaning of `int'. 21359692Selan Note that WCHAR_TYPE_SIZE is used in cexp.y, 21459692Selan where TARGET_SHORT is not available. */ 21559692Selan 21659692Selan #define WCHAR_TYPE "long int" 21759692Selan #define WCHAR_TYPE_SIZE 32 21859692Selan 21959692Selan /* Standard register usage. */ 22059692Selan 22159692Selan /* Number of actual hardware registers. 22259692Selan The hardware registers are assigned numbers for the compiler 22359692Selan from 0 to just below FIRST_PSEUDO_REGISTER. 22459692Selan All registers that the compiler knows about must be given numbers, 22559692Selan even those that are not normally considered general registers. 22659692Selan For the 68000, we give the data registers numbers 0-7, 22759692Selan the address registers numbers 010-017, 22859692Selan and the 68881 floating point registers numbers 020-027. */ 22959692Selan #ifndef SUPPORT_SUN_FPA 23059692Selan #define FIRST_PSEUDO_REGISTER 24 23159692Selan #else 23259692Selan #define FIRST_PSEUDO_REGISTER 56 23359692Selan #endif 23459692Selan 23559692Selan /* This defines the register which is used to hold the offset table for PIC. */ 23659692Selan #define PIC_OFFSET_TABLE_REGNUM 13 23759692Selan 23859692Selan /* Used to output a (use pic_offset_table_rtx) so that we 23959692Selan always save/restore a5 in functions that use PIC relocation 24059692Selan at *any* time during the compilation process. */ 24159692Selan #define FINALIZE_PIC finalize_pic() 24259692Selan 24359692Selan #ifndef SUPPORT_SUN_FPA 24459692Selan 24559692Selan /* 1 for registers that have pervasive standard uses 24659692Selan and are not available for the register allocator. 24759692Selan On the 68000, only the stack pointer is such. */ 24859692Selan 24959692Selan #define FIXED_REGISTERS \ 25059692Selan {/* Data registers. */ \ 25159692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 25259692Selan \ 25359692Selan /* Address registers. */ \ 25459692Selan 0, 0, 0, 0, 0, 0, 0, 1, \ 25559692Selan \ 25659692Selan /* Floating point registers \ 25759692Selan (if available). */ \ 25859692Selan 0, 0, 0, 0, 0, 0, 0, 0 } 25959692Selan 26059692Selan /* 1 for registers not available across function calls. 26159692Selan These must include the FIXED_REGISTERS and also any 26259692Selan registers that can be used without being saved. 26359692Selan The latter must include the registers where values are returned 26459692Selan and the register where structure-value addresses are passed. 26559692Selan Aside from that, you can include as many other registers as you like. */ 26659692Selan #define CALL_USED_REGISTERS \ 26759692Selan {1, 1, 0, 0, 0, 0, 0, 0, \ 26859692Selan 1, 1, 0, 0, 0, 0, 0, 1, \ 26959692Selan 1, 1, 0, 0, 0, 0, 0, 0 } 27059692Selan 27159692Selan #else /* SUPPORT_SUN_FPA */ 27259692Selan 27359692Selan /* 1 for registers that have pervasive standard uses 27459692Selan and are not available for the register allocator. 27559692Selan On the 68000, only the stack pointer is such. */ 27659692Selan 27759692Selan /* fpa0 is also reserved so that it can be used to move shit back and 27859692Selan forth between high fpa regs and everything else. */ 27959692Selan 28059692Selan #define FIXED_REGISTERS \ 28159692Selan {/* Data registers. */ \ 28259692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 28359692Selan \ 28459692Selan /* Address registers. */ \ 28559692Selan 0, 0, 0, 0, 0, 0, 0, 1, \ 28659692Selan \ 28759692Selan /* Floating point registers \ 28859692Selan (if available). */ \ 28959692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 29059692Selan \ 29159692Selan /* Sun3 FPA registers. */ \ 29259692Selan 1, 0, 0, 0, 0, 0, 0, 0, \ 29359692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 29459692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 29559692Selan 0, 0, 0, 0, 0, 0, 0, 0 } 29659692Selan 29759692Selan /* 1 for registers not available across function calls. 29859692Selan These must include the FIXED_REGISTERS and also any 29959692Selan registers that can be used without being saved. 30059692Selan The latter must include the registers where values are returned 30159692Selan and the register where structure-value addresses are passed. 30259692Selan Aside from that, you can include as many other registers as you like. */ 30359692Selan #define CALL_USED_REGISTERS \ 30459692Selan {1, 1, 0, 0, 0, 0, 0, 0, \ 30559692Selan 1, 1, 0, 0, 0, 0, 0, 1, \ 30659692Selan 1, 1, 0, 0, 0, 0, 0, 0, \ 30759692Selan /* FPA registers. */ \ 30859692Selan 1, 1, 1, 1, 0, 0, 0, 0, \ 30959692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 31059692Selan 0, 0, 0, 0, 0, 0, 0, 0, \ 31159692Selan 0, 0, 0, 0, 0, 0, 0, 0 } 31259692Selan 31359692Selan #endif /* defined SUPPORT_SUN_FPA */ 31459692Selan 31559692Selan 31659692Selan /* Make sure everything's fine if we *don't* have a given processor. 31759692Selan This assumes that putting a register in fixed_regs will keep the 31859692Selan compiler's mitts completely off it. We don't bother to zero it out 31959692Selan of register classes. If neither TARGET_FPA or TARGET_68881 is set, 32059692Selan the compiler won't touch since no instructions that use these 32159692Selan registers will be valid. 32259692Selan 32359692Selan Reserve PIC_OFFSET_TABLE_REGNUM (a5) for doing PIC relocation if 32459692Selan position independent code is being generated by making it a 32559692Selan fixed register */ 32659692Selan 32759692Selan #ifndef SUPPORT_SUN_FPA 32859692Selan 32959692Selan #define CONDITIONAL_REGISTER_USAGE \ 33059692Selan { \ 33159692Selan if (flag_pic) \ 33259692Selan fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ 33359692Selan } 33459692Selan 33559692Selan #else /* defined SUPPORT_SUN_FPA */ 33659692Selan 33759692Selan #define CONDITIONAL_REGISTER_USAGE \ 33859692Selan { \ 33959692Selan int i; \ 34059692Selan HARD_REG_SET x; \ 34159692Selan if (!TARGET_FPA) \ 34259692Selan { \ 34359692Selan COPY_HARD_REG_SET (x, reg_class_contents[(int)FPA_REGS]); \ 34459692Selan for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \ 34559692Selan if (TEST_HARD_REG_BIT (x, i)) \ 34659692Selan fixed_regs[i] = call_used_regs[i] = 1; \ 34759692Selan } \ 34859692Selan if (TARGET_FPA) \ 34959692Selan { \ 35059692Selan COPY_HARD_REG_SET (x, reg_class_contents[(int)FP_REGS]); \ 35159692Selan for (i = 0; i < FIRST_PSEUDO_REGISTER; i++ ) \ 35259692Selan if (TEST_HARD_REG_BIT (x, i)) \ 35359692Selan fixed_regs[i] = call_used_regs[i] = 1; \ 35459692Selan } \ 35559692Selan if (flag_pic) \ 35659692Selan fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ 35759692Selan } 35859692Selan 35959692Selan #endif /* defined SUPPORT_SUN_FPA */ 36059692Selan 36159692Selan /* Return number of consecutive hard regs needed starting at reg REGNO 36259692Selan to hold something of mode MODE. 36359692Selan This is ordinarily the length in words of a value of mode MODE 36459692Selan but can be less for certain modes in special long registers. 36559692Selan 36659692Selan On the 68000, ordinary registers hold 32 bits worth; 36759692Selan for the 68881 registers, a single register is always enough for 36859692Selan anything that can be stored in them at all. */ 36959692Selan #define HARD_REGNO_NREGS(REGNO, MODE) \ 37059692Selan ((REGNO) >= 16 ? GET_MODE_NUNITS (MODE) \ 37159692Selan : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) 37259692Selan 37359692Selan #ifndef SUPPORT_SUN_FPA 37459692Selan 37559692Selan /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. 37659692Selan On the 68000, the cpu registers can hold any mode but the 68881 registers 37759692Selan can hold only SFmode or DFmode. The 68881 registers can't hold anything 37859692Selan if 68881 use is disabled. */ 37959692Selan 38059692Selan #define HARD_REGNO_MODE_OK(REGNO, MODE) \ 38159692Selan (((REGNO) < 16) \ 38259692Selan || ((REGNO) < 24 \ 38359692Selan && TARGET_68881 \ 38459692Selan && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ 38559692Selan || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT))) 38659692Selan 38759692Selan #else /* defined SUPPORT_SUN_FPA */ 38859692Selan 38959692Selan /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. 39059692Selan On the 68000, the cpu registers can hold any mode but the 68881 registers 39159692Selan can hold only SFmode or DFmode. And the 68881 registers can't hold anything 39259692Selan if 68881 use is disabled. However, the Sun FPA register can 39359692Selan (apparently) hold whatever you feel like putting in them. 39459692Selan If using the fpa, don't put a double in d7/a0. */ 39559692Selan 39659692Selan #define HARD_REGNO_MODE_OK(REGNO, MODE) \ 39759692Selan (((REGNO) < 16 \ 39859692Selan && !(TARGET_FPA \ 39959692Selan && GET_MODE_CLASS ((MODE)) != MODE_INT \ 40059692Selan && GET_MODE_UNIT_SIZE ((MODE)) > 4 \ 40159692Selan && (REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8 \ 40259692Selan && (REGNO) % (GET_MODE_UNIT_SIZE ((MODE)) / 4) != 0)) \ 40359692Selan || ((REGNO) < 24 \ 40459692Selan ? TARGET_68881 && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ 40559692Selan || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ 40659692Selan : ((REGNO) < 56 ? TARGET_FPA : 0))) 40759692Selan 40859692Selan #endif /* defined SUPPORT_SUN_FPA */ 40959692Selan 41059692Selan /* Value is 1 if it is a good idea to tie two pseudo registers 41159692Selan when one has mode MODE1 and one has mode MODE2. 41259692Selan If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, 41359692Selan for any hard reg, then this must be 0 for correct output. */ 41459692Selan #define MODES_TIEABLE_P(MODE1, MODE2) \ 41559692Selan (! TARGET_68881 \ 41659692Selan || ((GET_MODE_CLASS (MODE1) == MODE_FLOAT \ 41759692Selan || GET_MODE_CLASS (MODE1) == MODE_COMPLEX_FLOAT) \ 41859692Selan == (GET_MODE_CLASS (MODE2) == MODE_FLOAT \ 41959692Selan || GET_MODE_CLASS (MODE2) == MODE_COMPLEX_FLOAT))) 42059692Selan 42159692Selan /* Specify the registers used for certain standard purposes. 42259692Selan The values of these macros are register numbers. */ 42359692Selan 42459692Selan /* m68000 pc isn't overloaded on a register. */ 42559692Selan /* #define PC_REGNUM */ 42659692Selan 42759692Selan /* Register to use for pushing function arguments. */ 42859692Selan #define STACK_POINTER_REGNUM 15 42959692Selan 43059692Selan /* Base register for access to local variables of the function. */ 43159692Selan #define FRAME_POINTER_REGNUM 14 43259692Selan 43359692Selan /* Value should be nonzero if functions must have frame pointers. 43459692Selan Zero means the frame pointer need not be set up (and parms 43559692Selan may be accessed via the stack pointer) in functions that seem suitable. 43659692Selan This is computed in `reload', in reload1.c. */ 43759692Selan #define FRAME_POINTER_REQUIRED 0 43859692Selan 43959692Selan /* Base register for access to arguments of the function. */ 44059692Selan #define ARG_POINTER_REGNUM 14 44159692Selan 44259692Selan /* Register in which static-chain is passed to a function. */ 44359692Selan #define STATIC_CHAIN_REGNUM 8 44459692Selan 44559692Selan /* Register in which address to store a structure value 44659692Selan is passed to a function. */ 44759692Selan #define STRUCT_VALUE_REGNUM 9 44859692Selan 44959692Selan /* Define the classes of registers for register constraints in the 45059692Selan machine description. Also define ranges of constants. 45159692Selan 45259692Selan One of the classes must always be named ALL_REGS and include all hard regs. 45359692Selan If there is more than one class, another class must be named NO_REGS 45459692Selan and contain no registers. 45559692Selan 45659692Selan The name GENERAL_REGS must be the name of a class (or an alias for 45759692Selan another name such as ALL_REGS). This is the class of registers 45859692Selan that is allowed by "g" or "r" in a register constraint. 45959692Selan Also, registers outside this class are allocated only when 46059692Selan instructions express preferences for them. 46159692Selan 46259692Selan The classes must be numbered in nondecreasing order; that is, 46359692Selan a larger-numbered class must never be contained completely 46459692Selan in a smaller-numbered class. 46559692Selan 46659692Selan For any two classes, it is very desirable that there be another 46759692Selan class that represents their union. */ 46859692Selan 46959692Selan /* The 68000 has three kinds of registers, so eight classes would be 47059692Selan a complete set. One of them is not needed. */ 47159692Selan 47259692Selan #ifndef SUPPORT_SUN_FPA 47359692Selan 47459692Selan enum reg_class { 47559692Selan NO_REGS, DATA_REGS, 47659692Selan ADDR_REGS, FP_REGS, 47759692Selan GENERAL_REGS, DATA_OR_FP_REGS, 47859692Selan ADDR_OR_FP_REGS, ALL_REGS, 47959692Selan LIM_REG_CLASSES }; 48059692Selan 48159692Selan #define N_REG_CLASSES (int) LIM_REG_CLASSES 48259692Selan 48359692Selan /* Give names of register classes as strings for dump file. */ 48459692Selan 48559692Selan #define REG_CLASS_NAMES \ 48659692Selan { "NO_REGS", "DATA_REGS", \ 48759692Selan "ADDR_REGS", "FP_REGS", \ 48859692Selan "GENERAL_REGS", "DATA_OR_FP_REGS", \ 48959692Selan "ADDR_OR_FP_REGS", "ALL_REGS" } 49059692Selan 49159692Selan /* Define which registers fit in which classes. 49259692Selan This is an initializer for a vector of HARD_REG_SET 49359692Selan of length N_REG_CLASSES. */ 49459692Selan 49559692Selan #define REG_CLASS_CONTENTS \ 49659692Selan { \ 49759692Selan 0x00000000, /* NO_REGS */ \ 49859692Selan 0x000000ff, /* DATA_REGS */ \ 49959692Selan 0x0000ff00, /* ADDR_REGS */ \ 50059692Selan 0x00ff0000, /* FP_REGS */ \ 50159692Selan 0x0000ffff, /* GENERAL_REGS */ \ 50259692Selan 0x00ff00ff, /* DATA_OR_FP_REGS */ \ 50359692Selan 0x00ffff00, /* ADDR_OR_FP_REGS */ \ 50459692Selan 0x00ffffff, /* ALL_REGS */ \ 50559692Selan } 50659692Selan 50759692Selan /* The same information, inverted: 50859692Selan Return the class number of the smallest class containing 50959692Selan reg number REGNO. This could be a conditional expression 51059692Selan or could index an array. */ 51159692Selan 51259692Selan #define REGNO_REG_CLASS(REGNO) (((REGNO)>>3)+1) 51359692Selan 51459692Selan #else /* defined SUPPORT_SUN_FPA */ 51559692Selan 51659692Selan /* 51759692Selan * Notes on final choices: 51859692Selan * 51959692Selan * 1) Didn't feel any need to union-ize LOW_FPA_REGS with anything 52059692Selan * else. 52159692Selan * 2) Removed all unions that involve address registers with 52259692Selan * floating point registers (left in unions of address and data with 52359692Selan * floating point). 52459692Selan * 3) Defined GENERAL_REGS as ADDR_OR_DATA_REGS. 52559692Selan * 4) Defined ALL_REGS as FPA_OR_FP_OR_GENERAL_REGS. 52659692Selan * 4) Left in everything else. 52759692Selan */ 52859692Selan enum reg_class { NO_REGS, LO_FPA_REGS, FPA_REGS, FP_REGS, 52959692Selan FP_OR_FPA_REGS, DATA_REGS, DATA_OR_FPA_REGS, DATA_OR_FP_REGS, 53059692Selan DATA_OR_FP_OR_FPA_REGS, ADDR_REGS, GENERAL_REGS, 53159692Selan GENERAL_OR_FPA_REGS, GENERAL_OR_FP_REGS, ALL_REGS, 53259692Selan LIM_REG_CLASSES }; 53359692Selan 53459692Selan #define N_REG_CLASSES (int) LIM_REG_CLASSES 53559692Selan 53659692Selan /* Give names of register classes as strings for dump file. */ 53759692Selan 53859692Selan #define REG_CLASS_NAMES \ 53959692Selan { "NO_REGS", "LO_FPA_REGS", "FPA_REGS", "FP_REGS", \ 54059692Selan "FP_OR_FPA_REGS", "DATA_REGS", "DATA_OR_FPA_REGS", "DATA_OR_FP_REGS", \ 54159692Selan "DATA_OR_FP_OR_FPA_REGS", "ADDR_REGS", "GENERAL_REGS", \ 54259692Selan "GENERAL_OR_FPA_REGS", "GENERAL_OR_FP_REGS", "ALL_REGS" } 54359692Selan 54459692Selan /* Define which registers fit in which classes. 54559692Selan This is an initializer for a vector of HARD_REG_SET 54659692Selan of length N_REG_CLASSES. */ 54759692Selan 54859692Selan #define REG_CLASS_CONTENTS \ 54959692Selan { \ 55059692Selan {0, 0}, /* NO_REGS */ \ 55159692Selan {0xff000000, 0x000000ff}, /* LO_FPA_REGS */ \ 55259692Selan {0xff000000, 0x00ffffff}, /* FPA_REGS */ \ 55359692Selan {0x00ff0000, 0x00000000}, /* FP_REGS */ \ 55459692Selan {0xffff0000, 0x00ffffff}, /* FP_OR_FPA_REGS */ \ 55559692Selan {0x000000ff, 0x00000000}, /* DATA_REGS */ \ 55659692Selan {0xff0000ff, 0x00ffffff}, /* DATA_OR_FPA_REGS */ \ 55759692Selan {0x00ff00ff, 0x00000000}, /* DATA_OR_FP_REGS */ \ 55859692Selan {0xffff00ff, 0x00ffffff}, /* DATA_OR_FP_OR_FPA_REGS */\ 55959692Selan {0x0000ff00, 0x00000000}, /* ADDR_REGS */ \ 56059692Selan {0x0000ffff, 0x00000000}, /* GENERAL_REGS */ \ 56159692Selan {0xff00ffff, 0x00ffffff}, /* GENERAL_OR_FPA_REGS */\ 56259692Selan {0x00ffffff, 0x00000000}, /* GENERAL_OR_FP_REGS */\ 56359692Selan {0xffffffff, 0x00ffffff}, /* ALL_REGS */ \ 56459692Selan } 56559692Selan 56659692Selan /* The same information, inverted: 56759692Selan Return the class number of the smallest class containing 56859692Selan reg number REGNO. This could be a conditional expression 56959692Selan or could index an array. */ 57059692Selan 57159692Selan extern enum reg_class regno_reg_class[]; 57259692Selan #define REGNO_REG_CLASS(REGNO) (regno_reg_class[(REGNO)>>3]) 57359692Selan 57459692Selan #endif /* SUPPORT_SUN_FPA */ 57559692Selan 57659692Selan /* The class value for index registers, and the one for base regs. */ 57759692Selan 57859692Selan #define INDEX_REG_CLASS GENERAL_REGS 57959692Selan #define BASE_REG_CLASS ADDR_REGS 58059692Selan 58159692Selan /* Get reg_class from a letter such as appears in the machine description. 58259692Selan We do a trick here to modify the effective constraints on the 58359692Selan machine description; we zorch the constraint letters that aren't 58459692Selan appropriate for a specific target. This allows us to guarantee 58559692Selan that a specific kind of register will not be used for a given target 58659692Selan without fiddling with the register classes above. */ 58759692Selan 58859692Selan #ifndef SUPPORT_SUN_FPA 58959692Selan 59059692Selan #define REG_CLASS_FROM_LETTER(C) \ 59159692Selan ((C) == 'a' ? ADDR_REGS : \ 59259692Selan ((C) == 'd' ? DATA_REGS : \ 59359692Selan ((C) == 'f' ? (TARGET_68881 ? FP_REGS : \ 59459692Selan NO_REGS) : \ 59559692Selan NO_REGS))) 59659692Selan 59759692Selan #else /* defined SUPPORT_SUN_FPA */ 59859692Selan 59959692Selan #define REG_CLASS_FROM_LETTER(C) \ 60059692Selan ((C) == 'a' ? ADDR_REGS : \ 60159692Selan ((C) == 'd' ? DATA_REGS : \ 60259692Selan ((C) == 'f' ? (TARGET_68881 ? FP_REGS : \ 60359692Selan NO_REGS) : \ 60459692Selan ((C) == 'x' ? (TARGET_FPA ? FPA_REGS : \ 60559692Selan NO_REGS) : \ 60659692Selan ((C) == 'y' ? (TARGET_FPA ? LO_FPA_REGS : \ 60759692Selan NO_REGS) : \ 60859692Selan NO_REGS))))) 60959692Selan 61059692Selan #endif /* defined SUPPORT_SUN_FPA */ 61159692Selan 61259692Selan /* The letters I, J, K, L and M in a register constraint string 61359692Selan can be used to stand for particular ranges of immediate operands. 61459692Selan This macro defines what the ranges are. 61559692Selan C is the letter, and VALUE is a constant value. 61659692Selan Return 1 if VALUE is in the range specified by C. 61759692Selan 61859692Selan For the 68000, `I' is used for the range 1 to 8 61959692Selan allowed as immediate shift counts and in addq. 62059692Selan `J' is used for the range of signed numbers that fit in 16 bits. 62159692Selan `K' is for numbers that moveq can't handle. 62259692Selan `L' is for range -8 to -1, range of values that can be added with subq. */ 62359692Selan 62459692Selan #define CONST_OK_FOR_LETTER_P(VALUE, C) \ 62559692Selan ((C) == 'I' ? (VALUE) > 0 && (VALUE) <= 8 : \ 62659692Selan (C) == 'J' ? (VALUE) >= -0x8000 && (VALUE) <= 0x7FFF : \ 62759692Selan (C) == 'K' ? (VALUE) < -0x80 || (VALUE) >= 0x80 : \ 62859692Selan (C) == 'L' ? (VALUE) < 0 && (VALUE) >= -8 : 0) 62959692Selan 63059692Selan /* 63159692Selan * A small bit of explanation: 63259692Selan * "G" defines all of the floating constants that are *NOT* 68881 63359692Selan * constants. this is so 68881 constants get reloaded and the 63459692Selan * fpmovecr is used. "H" defines *only* the class of constants that 63559692Selan * the fpa can use, because these can be gotten at in any fpa 63659692Selan * instruction and there is no need to force reloads. 63759692Selan */ 63859692Selan #ifndef SUPPORT_SUN_FPA 63959692Selan #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ 64059692Selan ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : 0 ) 64159692Selan #else /* defined SUPPORT_SUN_FPA */ 64259692Selan #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ 64359692Selan ((C) == 'G' ? ! (TARGET_68881 && standard_68881_constant_p (VALUE)) : \ 64459692Selan (C) == 'H' ? (TARGET_FPA && standard_sun_fpa_constant_p (VALUE)) : 0) 64559692Selan #endif /* defined SUPPORT_SUN_FPA */ 64659692Selan 64759692Selan /* Given an rtx X being reloaded into a reg required to be 64859692Selan in class CLASS, return the class of reg to actually use. 64959692Selan In general this is just CLASS; but on some machines 65059692Selan in some cases it is preferable to use a more restrictive class. 65159692Selan On the 68000 series, use a data reg if possible when the 65259692Selan value is a constant in the range where moveq could be used 65359692Selan and we ensure that QImodes are reloaded into data regs. 65459692Selan Also, if a floating constant needs reloading, put it in memory 65559692Selan if possible. */ 65659692Selan 65759692Selan #define PREFERRED_RELOAD_CLASS(X,CLASS) \ 65859692Selan ((GET_CODE (X) == CONST_INT \ 65959692Selan && (unsigned) (INTVAL (X) + 0x80) < 0x100 \ 66059692Selan && (CLASS) != ADDR_REGS) \ 66159692Selan ? DATA_REGS \ 66259692Selan : (GET_MODE (X) == QImode && (CLASS) != ADDR_REGS) \ 66359692Selan ? DATA_REGS \ 66459692Selan : (GET_CODE (X) == CONST_DOUBLE \ 66559692Selan && GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT) \ 66659692Selan ? NO_REGS \ 66759692Selan : (CLASS)) 66859692Selan 66959692Selan /* Return the maximum number of consecutive registers 67059692Selan needed to represent mode MODE in a register of class CLASS. */ 67159692Selan /* On the 68000, this is the size of MODE in words, 67259692Selan except in the FP regs, where a single reg is always enough. */ 67359692Selan #ifndef SUPPORT_SUN_FPA 67459692Selan 67559692Selan #define CLASS_MAX_NREGS(CLASS, MODE) \ 67659692Selan ((CLASS) == FP_REGS ? 1 \ 67759692Selan : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) 67859692Selan 67959692Selan /* Moves between fp regs and other regs are two insns. */ 68059692Selan #define REGISTER_MOVE_COST(CLASS1, CLASS2) \ 68159692Selan (((CLASS1) == FP_REGS && (CLASS2) != FP_REGS) \ 68259692Selan || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS) \ 68359692Selan ? 4 : 2) 68459692Selan 68559692Selan #else /* defined SUPPORT_SUN_FPA */ 68659692Selan 68759692Selan #define CLASS_MAX_NREGS(CLASS, MODE) \ 68859692Selan ((CLASS) == FP_REGS || (CLASS) == FPA_REGS || (CLASS) == LO_FPA_REGS ? 1 \ 68959692Selan : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)) 69059692Selan 69159692Selan /* Moves between fp regs and other regs are two insns. */ 69259692Selan /* Likewise for high fpa regs and other regs. */ 69359692Selan #define REGISTER_MOVE_COST(CLASS1, CLASS2) \ 69459692Selan ((((CLASS1) == FP_REGS && (CLASS2) != FP_REGS) \ 69559692Selan || ((CLASS2) == FP_REGS && (CLASS1) != FP_REGS) \ 69659692Selan || ((CLASS1) == FPA_REGS && (CLASS2) != FPA_REGS) \ 69759692Selan || ((CLASS2) == FPA_REGS && (CLASS1) != FPA_REGS)) \ 69859692Selan ? 4 : 2) 69959692Selan 70059692Selan #endif /* define SUPPORT_SUN_FPA */ 70159692Selan 70259692Selan /* Stack layout; function entry, exit and calling. */ 70359692Selan 70459692Selan /* Define this if pushing a word on the stack 70559692Selan makes the stack pointer a smaller address. */ 70659692Selan #define STACK_GROWS_DOWNWARD 70759692Selan 70859692Selan /* Nonzero if we need to generate stack-probe insns. 70959692Selan On most systems they are not needed. 71059692Selan When they are needed, define this as the stack offset to probe at. */ 71159692Selan #define NEED_PROBE 0 71259692Selan 71359692Selan /* Define this if the nominal address of the stack frame 71459692Selan is at the high-address end of the local variables; 71559692Selan that is, each additional local variable allocated 71659692Selan goes at a more negative offset in the frame. */ 71759692Selan #define FRAME_GROWS_DOWNWARD 71859692Selan 71959692Selan /* Offset within stack frame to start allocating local variables at. 72059692Selan If FRAME_GROWS_DOWNWARD, this is the offset to the END of the 72159692Selan first local allocated. Otherwise, it is the offset to the BEGINNING 72259692Selan of the first local allocated. */ 72359692Selan #define STARTING_FRAME_OFFSET 0 72459692Selan 72559692Selan /* If we generate an insn to push BYTES bytes, 72659692Selan this says how many the stack pointer really advances by. 72759692Selan On the 68000, sp@- in a byte insn really pushes a word. */ 72859692Selan #define PUSH_ROUNDING(BYTES) (((BYTES) + 1) & ~1) 72959692Selan 73059692Selan /* Offset of first parameter from the argument pointer register value. */ 73159692Selan #define FIRST_PARM_OFFSET(FNDECL) 8 73259692Selan 73359692Selan /* Value is the number of byte of arguments automatically 73459692Selan popped when returning from a subroutine call. 73559692Selan FUNTYPE is the data type of the function (as a tree), 73659692Selan or for a library call it is an identifier node for the subroutine name. 73759692Selan SIZE is the number of bytes of arguments passed on the stack. 73859692Selan 73959692Selan On the 68000, the RTS insn cannot pop anything. 74059692Selan On the 68010, the RTD insn may be used to pop them if the number 74159692Selan of args is fixed, but if the number is variable then the caller 74259692Selan must pop them all. RTD can't be used for library calls now 74359692Selan because the library is compiled with the Unix compiler. 74459692Selan Use of RTD is a selectable option, since it is incompatible with 74559692Selan standard Unix calling sequences. If the option is not selected, 74659692Selan the caller must always pop the args. */ 74759692Selan 74859692Selan #define RETURN_POPS_ARGS(FUNTYPE,SIZE) \ 74959692Selan ((TARGET_RTD && TREE_CODE (FUNTYPE) != IDENTIFIER_NODE \ 75059692Selan && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ 75159692Selan || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ 75259692Selan == void_type_node))) \ 75359692Selan ? (SIZE) : 0) 75459692Selan 75559692Selan /* Define how to find the value returned by a function. 75659692Selan VALTYPE is the data type of the value (as a tree). 75759692Selan If the precise function being called is known, FUNC is its FUNCTION_DECL; 75859692Selan otherwise, FUNC is 0. */ 75959692Selan 76059692Selan /* On the 68000 the return value is in D0 regardless. */ 76159692Selan 76259692Selan #define FUNCTION_VALUE(VALTYPE, FUNC) \ 76359692Selan gen_rtx (REG, TYPE_MODE (VALTYPE), 0) 76459692Selan 76559692Selan /* Define how to find the value returned by a library function 76659692Selan assuming the value has mode MODE. */ 76759692Selan 76859692Selan /* On the 68000 the return value is in D0 regardless. */ 76959692Selan 77059692Selan #define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, 0) 77159692Selan 77259692Selan /* 1 if N is a possible register number for a function value. 77359692Selan On the 68000, d0 is the only register thus used. */ 77459692Selan 77559692Selan #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0) 77659692Selan 77759692Selan /* Define this if PCC uses the nonreentrant convention for returning 77859692Selan structure and union values. */ 77959692Selan 78059692Selan #define PCC_STATIC_STRUCT_RETURN 78159692Selan 78259692Selan /* 1 if N is a possible register number for function argument passing. 78359692Selan On the 68000, no registers are used in this way. */ 78459692Selan 78559692Selan #define FUNCTION_ARG_REGNO_P(N) 0 78659692Selan 78759692Selan /* Define a data type for recording info about an argument list 78859692Selan during the scan of that argument list. This data type should 78959692Selan hold all necessary information about the function itself 79059692Selan and about the args processed so far, enough to enable macros 79159692Selan such as FUNCTION_ARG to determine where the next arg should go. 79259692Selan 79359692Selan On the m68k, this is a single integer, which is a number of bytes 79459692Selan of arguments scanned so far. */ 79559692Selan 79659692Selan #define CUMULATIVE_ARGS int 79759692Selan 79859692Selan /* Initialize a variable CUM of type CUMULATIVE_ARGS 79959692Selan for a call to a function whose data type is FNTYPE. 80059692Selan For a library call, FNTYPE is 0. 80159692Selan 80259692Selan On the m68k, the offset starts at 0. */ 80359692Selan 80459692Selan #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME) \ 80559692Selan ((CUM) = 0) 80659692Selan 80759692Selan /* Update the data in CUM to advance over an argument 80859692Selan of mode MODE and data type TYPE. 80959692Selan (TYPE is null for libcalls where that information may not be available.) */ 81059692Selan 81159692Selan #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ 81259692Selan ((CUM) += ((MODE) != BLKmode \ 81359692Selan ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ 81459692Selan : (int_size_in_bytes (TYPE) + 3) & ~3)) 81559692Selan 81659692Selan /* Define where to put the arguments to a function. 81759692Selan Value is zero to push the argument on the stack, 81859692Selan or a hard register in which to store the argument. 81959692Selan 82059692Selan MODE is the argument's machine mode. 82159692Selan TYPE is the data type of the argument (as a tree). 82259692Selan This is null for libcalls where that information may 82359692Selan not be available. 82459692Selan CUM is a variable of type CUMULATIVE_ARGS which gives info about 82559692Selan the preceding args and about the function being called. 82659692Selan NAMED is nonzero if this argument is a named parameter 82759692Selan (otherwise it is an extra parameter matching an ellipsis). */ 82859692Selan 82959692Selan /* On the 68000 all args are pushed, except if -mregparm is specified 83059692Selan then the first two words of arguments are passed in d0, d1. 83159692Selan *NOTE* -mregparm does not work. 83259692Selan It exists only to test register calling conventions. */ 83359692Selan 83459692Selan #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ 83559692Selan ((TARGET_REGPARM && (CUM) < 8) ? gen_rtx (REG, (MODE), (CUM) / 4) : 0) 83659692Selan 83759692Selan /* For an arg passed partly in registers and partly in memory, 83859692Selan this is the number of registers used. 83959692Selan For args passed entirely in registers or entirely in memory, zero. */ 84059692Selan 84159692Selan #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ 84259692Selan ((TARGET_REGPARM && (CUM) < 8 \ 84359692Selan && 8 < ((CUM) + ((MODE) == BLKmode \ 84459692Selan ? int_size_in_bytes (TYPE) \ 84559692Selan : GET_MODE_SIZE (MODE)))) \ 84659692Selan ? 2 - (CUM) / 4 : 0) 84759692Selan 84859692Selan /* Generate the assembly code for function entry. */ 84959692Selan #define FUNCTION_PROLOGUE(FILE, SIZE) output_function_prologue(FILE, SIZE) 85059692Selan 85159692Selan /* Output assembler code to FILE to increment profiler label # LABELNO 85259692Selan for profiling a function entry. */ 85359692Selan 85459692Selan #define FUNCTION_PROFILER(FILE, LABELNO) \ 85559692Selan asm_fprintf (FILE, "\tlea %LLP%d,%Ra0\n\tjsr mcount\n", (LABELNO)) 85659692Selan 85759692Selan /* Output assembler code to FILE to initialize this source file's 85859692Selan basic block profiling info, if that has not already been done. */ 85959692Selan 86059692Selan #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ 86159692Selan asm_fprintf (FILE, "\ttstl %LLPBX0\n\tbne %LLPI%d\n\tpea %LLPBX0\n\tjsr %U__bb_init_func\n\taddql %I4,%Rsp\n%LLPI%d:\n", \ 86259692Selan LABELNO, LABELNO); 86359692Selan 86459692Selan /* Output assembler code to FILE to increment the entry-count for 86559692Selan the BLOCKNO'th basic block in this source file. */ 86659692Selan 86759692Selan #define BLOCK_PROFILER(FILE, BLOCKNO) \ 86859692Selan asm_fprintf (FILE, "\taddql %I1,%LLPBX2+%d\n", 4 * BLOCKNO) 86959692Selan 87059692Selan /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, 87159692Selan the stack pointer does not matter. The value is tested only in 87259692Selan functions that have frame pointers. 87359692Selan No definition is equivalent to always zero. */ 87459692Selan 87559692Selan #define EXIT_IGNORE_STACK 1 87659692Selan 87759692Selan /* Generate the assembly code for function exit. */ 87859692Selan #define FUNCTION_EPILOGUE(FILE, SIZE) output_function_epilogue (FILE, SIZE) 87959692Selan 88059692Selan /* This is a hook for other tm files to change. */ 88159692Selan /* #define FUNCTION_EXTRA_EPILOGUE(FILE, SIZE) */ 88259692Selan 88359692Selan /* Determine if the epilogue should be output as RTL. 88459692Selan You should override this if you define FUNCTION_EXTRA_EPILOGUE. */ 88559692Selan #define USE_RETURN_INSN use_return_insn () 88659692Selan 88759692Selan /* Store in the variable DEPTH the initial difference between the 88859692Selan frame pointer reg contents and the stack pointer reg contents, 88959692Selan as of the start of the function body. This depends on the layout 89059692Selan of the fixed parts of the stack frame and on how registers are saved. 89159692Selan 89259692Selan On the 68k, if we have a frame, we must add one word to its length 89359692Selan to allow for the place that a6 is stored when we do have a frame pointer. 89459692Selan Otherwise, we would need to compute the offset from the frame pointer 89559692Selan of a local variable as a function of frame_pointer_needed, which 89659692Selan is hard. */ 89759692Selan 89859692Selan #define INITIAL_FRAME_POINTER_OFFSET(DEPTH) \ 89959692Selan { int regno; \ 90059692Selan int offset = -4; \ 90159692Selan for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \ 90259692Selan if (regs_ever_live[regno] && ! call_used_regs[regno]) \ 90359692Selan offset += 12; \ 90459692Selan for (regno = 0; regno < 16; regno++) \ 90559692Selan if (regs_ever_live[regno] && ! call_used_regs[regno]) \ 90659692Selan offset += 4; \ 90759692Selan (DEPTH) = (offset + ((get_frame_size () + 3) & -4) \ 90859692Selan + (get_frame_size () == 0 ? 0 : 4)); \ 90959692Selan } 91059692Selan 91159692Selan /* Output assembler code for a block containing the constant parts 91259692Selan of a trampoline, leaving space for the variable parts. */ 91359692Selan 91459692Selan /* On the 68k, the trampoline looks like this: 91559692Selan mov @#.,a0 91659692Selan jsr @#___trampoline 91759692Selan jsr @#___trampoline 91859692Selan .long STATIC 91959692Selan .long FUNCTION 92059692Selan The reason for having three jsr insns is so that an entire line 92159692Selan of the instruction cache is filled in a predictable way 92259692Selan that will always be the same. 92359692Selan 92459692Selan We always use the assembler label ___trampoline 92559692Selan regardless of whether the system adds underscores. */ 92659692Selan 92759692Selan #define TRAMPOLINE_TEMPLATE(FILE) \ 92859692Selan { \ 92959692Selan ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x207c)); \ 93059692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 93159692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 93259692Selan ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \ 93359692Selan ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\ 93459692Selan ASM_OUTPUT_SHORT (FILE, gen_rtx (CONST_INT, VOIDmode, 0x4eb9)); \ 93559692Selan ASM_OUTPUT_INT (FILE, gen_rtx (SYMBOL_REF, SImode, "*___trampoline"));\ 93659692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 93759692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 93859692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 93959692Selan ASM_OUTPUT_SHORT (FILE, const0_rtx); \ 94059692Selan } 94159692Selan 94259692Selan /* Length in units of the trampoline for entering a nested function. */ 94359692Selan 94459692Selan #define TRAMPOLINE_SIZE 26 94559692Selan 94659692Selan /* Alignment required for a trampoline. 16 is used to find the 94759692Selan beginning of a line in the instruction cache. */ 94859692Selan 94959692Selan #define TRAMPOLINE_ALIGN 16 95059692Selan 95159692Selan /* Emit RTL insns to initialize the variable parts of a trampoline. 95259692Selan FNADDR is an RTX for the address of the function's pure code. 95359692Selan CXT is an RTX for the static chain value for the function. */ 95459692Selan 95559692Selan #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ 95659692Selan { \ 95759692Selan emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), TRAMP); \ 95859692Selan emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 18)), CXT); \ 95959692Selan emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 22)), FNADDR); \ 96059692Selan } 96159692Selan 96259692Selan /* This is the library routine that is used 96359692Selan to transfer control from the trampoline 96459692Selan to the actual nested function. */ 96559692Selan 96659692Selan /* A colon is used with no explicit operands 96759692Selan to cause the template string to be scanned for %-constructs. */ 96859692Selan /* The function name __transfer_from_trampoline is not actually used. 96959692Selan The function definition just permits use of "asm with operands" 97059692Selan (though the operand list is empty). */ 97159692Selan #define TRANSFER_FROM_TRAMPOLINE \ 97259692Selan void \ 97359692Selan __transfer_from_trampoline () \ 97459692Selan { \ 97559692Selan register char *a0 asm ("%a0"); \ 97659692Selan asm (GLOBAL_ASM_OP " ___trampoline"); \ 97759692Selan asm ("___trampoline:"); \ 97859692Selan asm volatile ("move%.l %0,%@" : : "m" (a0[22])); \ 97959692Selan asm volatile ("move%.l %1,%0" : "=a" (a0) : "m" (a0[18])); \ 98059692Selan asm ("rts":); \ 98159692Selan } 98259692Selan 98359692Selan /* Addressing modes, and classification of registers for them. */ 98459692Selan 98559692Selan #define HAVE_POST_INCREMENT 98659692Selan /* #define HAVE_POST_DECREMENT */ 98759692Selan 98859692Selan #define HAVE_PRE_DECREMENT 98959692Selan /* #define HAVE_PRE_INCREMENT */ 99059692Selan 99159692Selan /* Macros to check register numbers against specific register classes. */ 99259692Selan 99359692Selan /* These assume that REGNO is a hard or pseudo reg number. 99459692Selan They give nonzero only if REGNO is a hard reg of the suitable class 99559692Selan or a pseudo reg currently allocated to a suitable hard reg. 99659692Selan Since they use reg_renumber, they are safe only once reg_renumber 99759692Selan has been allocated, which happens in local-alloc.c. */ 99859692Selan 99959692Selan #define REGNO_OK_FOR_INDEX_P(REGNO) \ 100059692Selan ((REGNO) < 16 || (unsigned) reg_renumber[REGNO] < 16) 100159692Selan #define REGNO_OK_FOR_BASE_P(REGNO) \ 100259692Selan (((REGNO) ^ 010) < 8 || (unsigned) (reg_renumber[REGNO] ^ 010) < 8) 100359692Selan #define REGNO_OK_FOR_DATA_P(REGNO) \ 100459692Selan ((REGNO) < 8 || (unsigned) reg_renumber[REGNO] < 8) 100559692Selan #define REGNO_OK_FOR_FP_P(REGNO) \ 100659692Selan (((REGNO) ^ 020) < 8 || (unsigned) (reg_renumber[REGNO] ^ 020) < 8) 100759692Selan #ifdef SUPPORT_SUN_FPA 100859692Selan #define REGNO_OK_FOR_FPA_P(REGNO) \ 100959692Selan (((REGNO) >= 24 && (REGNO) < 56) || (reg_renumber[REGNO] >= 24 && reg_renumber[REGNO] < 56)) 101059692Selan #endif 101159692Selan 101259692Selan /* Now macros that check whether X is a register and also, 101359692Selan strictly, whether it is in a specified class. 101459692Selan 101559692Selan These macros are specific to the 68000, and may be used only 101659692Selan in code for printing assembler insns and in conditions for 101759692Selan define_optimization. */ 101859692Selan 101959692Selan /* 1 if X is a data register. */ 102059692Selan 102159692Selan #define DATA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_DATA_P (REGNO (X))) 102259692Selan 102359692Selan /* 1 if X is an fp register. */ 102459692Selan 102559692Selan #define FP_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FP_P (REGNO (X))) 102659692Selan 102759692Selan /* 1 if X is an address register */ 102859692Selan 102959692Selan #define ADDRESS_REG_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X))) 103059692Selan 103159692Selan #ifdef SUPPORT_SUN_FPA 103259692Selan /* 1 if X is a register in the Sun FPA. */ 103359692Selan #define FPA_REG_P(X) (REG_P (X) && REGNO_OK_FOR_FPA_P (REGNO (X))) 103459692Selan #else 103559692Selan /* Answer must be no if we don't have an FPA. */ 103659692Selan #define FPA_REG_P(X) 0 103759692Selan #endif 103859692Selan 103959692Selan /* Maximum number of registers that can appear in a valid memory address. */ 104059692Selan 104159692Selan #define MAX_REGS_PER_ADDRESS 2 104259692Selan 104359692Selan /* Recognize any constant value that is a valid address. */ 104459692Selan 104559692Selan #define CONSTANT_ADDRESS_P(X) CONSTANT_P (X) 104659692Selan 104759692Selan /* Nonzero if the constant value X is a legitimate general operand. 104859692Selan It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ 104959692Selan 105059692Selan #define LEGITIMATE_CONSTANT_P(X) 1 105159692Selan 105259692Selan /* Nonzero if the constant value X is a legitimate general operand 105359692Selan when generating PIC code. It is given that flag_pic is on and 105459692Selan that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ 105559692Selan 105659692Selan #define LEGITIMATE_PIC_OPERAND_P(X) \ 105759692Selan (! symbolic_operand (X, VOIDmode)) 105859692Selan 105959692Selan /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx 106059692Selan and check its validity for a certain class. 106159692Selan We have two alternate definitions for each of them. 106259692Selan The usual definition accepts all pseudo regs; the other rejects 106359692Selan them unless they have been allocated suitable hard regs. 106459692Selan The symbol REG_OK_STRICT causes the latter definition to be used. 106559692Selan 106659692Selan Most source files want to accept pseudo regs in the hope that 106759692Selan they will get allocated to the class that the insn wants them to be in. 106859692Selan Source files for reload pass need to be strict. 106959692Selan After reload, it makes no difference, since pseudo regs have 107059692Selan been eliminated by then. */ 107159692Selan 107259692Selan #ifndef REG_OK_STRICT 107359692Selan 107459692Selan /* Nonzero if X is a hard reg that can be used as an index 107559692Selan or if it is a pseudo reg. */ 107659692Selan #define REG_OK_FOR_INDEX_P(X) ((REGNO (X) ^ 020) >= 8) 107759692Selan /* Nonzero if X is a hard reg that can be used as a base reg 107859692Selan or if it is a pseudo reg. */ 107959692Selan #define REG_OK_FOR_BASE_P(X) ((REGNO (X) & ~027) != 0) 108059692Selan 108159692Selan #else 108259692Selan 108359692Selan /* Nonzero if X is a hard reg that can be used as an index. */ 108459692Selan #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X)) 108559692Selan /* Nonzero if X is a hard reg that can be used as a base reg. */ 108659692Selan #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) 108759692Selan 108859692Selan #endif 108959692Selan 109059692Selan /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression 109159692Selan that is a valid memory address for an instruction. 109259692Selan The MODE argument is the machine mode for the MEM expression 109359692Selan that wants to use this address. 109459692Selan 109559692Selan When generating PIC, an address involving a SYMBOL_REF is legitimate 109659692Selan if and only if it is the sum of pic_offset_table_rtx and the SYMBOL_REF. 109759692Selan We use LEGITIMATE_PIC_OPERAND_P to throw out the illegitimate addresses, 109859692Selan and we explicitly check for the sum of pic_offset_table_rtx and a SYMBOL_REF. 109959692Selan 110059692Selan Likewise for a LABEL_REF when generating PIC. 110159692Selan 110259692Selan The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS. */ 110359692Selan 110459692Selan #define INDIRECTABLE_1_ADDRESS_P(X) \ 110559692Selan ((CONSTANT_ADDRESS_P (X) && (!flag_pic || LEGITIMATE_PIC_OPERAND_P (X))) \ 110659692Selan || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ 110759692Selan || ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \ 110859692Selan && REG_P (XEXP (X, 0)) \ 110959692Selan && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ 111059692Selan || (GET_CODE (X) == PLUS \ 111159692Selan && REG_P (XEXP (X, 0)) && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ 111259692Selan && GET_CODE (XEXP (X, 1)) == CONST_INT \ 111359692Selan && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000) \ 111459692Selan || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx \ 111559692Selan && flag_pic && GET_CODE (XEXP (X, 1)) == SYMBOL_REF) \ 111659692Selan || (GET_CODE (X) == PLUS && XEXP (X, 0) == pic_offset_table_rtx \ 111759692Selan && flag_pic && GET_CODE (XEXP (X, 1)) == LABEL_REF)) \ 111859692Selan 111959692Selan #if 0 112059692Selan /* This should replace the last two (non-pic) lines 112159692Selan except that Sun's assembler does not seem to handle such operands. */ 112259692Selan && (TARGET_68020 ? CONSTANT_ADDRESS_P (XEXP (X, 1)) \ 112359692Selan : (GET_CODE (XEXP (X, 1)) == CONST_INT \ 112459692Selan && ((unsigned) INTVAL (XEXP (X, 1)) + 0x8000) < 0x10000)))) 112559692Selan #endif 112659692Selan 112759692Selan 112859692Selan #define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ 112959692Selan { if (INDIRECTABLE_1_ADDRESS_P (X)) goto ADDR; } 113059692Selan 113159692Selan /* Only labels on dispatch tables are valid for indexing from. */ 113259692Selan #define GO_IF_INDEXABLE_BASE(X, ADDR) \ 113359692Selan { rtx temp; \ 113459692Selan if (GET_CODE (X) == LABEL_REF \ 113559692Selan && (temp = next_nonnote_insn (XEXP (X, 0))) != 0 \ 113659692Selan && GET_CODE (temp) == JUMP_INSN \ 113759692Selan && (GET_CODE (PATTERN (temp)) == ADDR_VEC \ 113859692Selan || GET_CODE (PATTERN (temp)) == ADDR_DIFF_VEC)) \ 113959692Selan goto ADDR; \ 114059692Selan if (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) goto ADDR; } 114159692Selan 114259692Selan #define GO_IF_INDEXING(X, ADDR) \ 114359692Selan { if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 0))) \ 114459692Selan { GO_IF_INDEXABLE_BASE (XEXP (X, 1), ADDR); } \ 114559692Selan if (GET_CODE (X) == PLUS && LEGITIMATE_INDEX_P (XEXP (X, 1))) \ 114659692Selan { GO_IF_INDEXABLE_BASE (XEXP (X, 0), ADDR); } } 114759692Selan 114859692Selan #define GO_IF_INDEXED_ADDRESS(X, ADDR) \ 114959692Selan { GO_IF_INDEXING (X, ADDR); \ 115059692Selan if (GET_CODE (X) == PLUS) \ 115159692Selan { if (GET_CODE (XEXP (X, 1)) == CONST_INT \ 115259692Selan && (unsigned) INTVAL (XEXP (X, 1)) + 0x80 < 0x100) \ 115359692Selan { rtx go_temp = XEXP (X, 0); GO_IF_INDEXING (go_temp, ADDR); } \ 115459692Selan if (GET_CODE (XEXP (X, 0)) == CONST_INT \ 115559692Selan && (unsigned) INTVAL (XEXP (X, 0)) + 0x80 < 0x100) \ 115659692Selan { rtx go_temp = XEXP (X, 1); GO_IF_INDEXING (go_temp, ADDR); } } } 115759692Selan 115859692Selan #define LEGITIMATE_INDEX_REG_P(X) \ 115959692Selan ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X)) \ 116059692Selan || (GET_CODE (X) == SIGN_EXTEND \ 116159692Selan && GET_CODE (XEXP (X, 0)) == REG \ 116259692Selan && GET_MODE (XEXP (X, 0)) == HImode \ 116359692Selan && REG_OK_FOR_INDEX_P (XEXP (X, 0)))) 116459692Selan 116559692Selan #define LEGITIMATE_INDEX_P(X) \ 116659692Selan (LEGITIMATE_INDEX_REG_P (X) \ 116759692Selan || (TARGET_68020 && GET_CODE (X) == MULT \ 116859692Selan && LEGITIMATE_INDEX_REG_P (XEXP (X, 0)) \ 116959692Selan && GET_CODE (XEXP (X, 1)) == CONST_INT \ 117059692Selan && (INTVAL (XEXP (X, 1)) == 2 \ 117159692Selan || INTVAL (XEXP (X, 1)) == 4 \ 117259692Selan || INTVAL (XEXP (X, 1)) == 8))) 117359692Selan 117459692Selan #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ 117559692Selan { GO_IF_NONINDEXED_ADDRESS (X, ADDR); \ 117659692Selan GO_IF_INDEXED_ADDRESS (X, ADDR); } 117759692Selan 117859692Selan /* Try machine-dependent ways of modifying an illegitimate address 117959692Selan to be legitimate. If we find one, return the new, valid address. 118059692Selan This macro is used in only one place: `memory_address' in explow.c. 118159692Selan 118259692Selan OLDX is the address as it was before break_out_memory_refs was called. 118359692Selan In some cases it is useful to look at this to decide what needs to be done. 118459692Selan 118559692Selan MODE and WIN are passed so that this macro can use 118659692Selan GO_IF_LEGITIMATE_ADDRESS. 118759692Selan 118859692Selan It is always safe for this macro to do nothing. It exists to recognize 118959692Selan opportunities to optimize the output. 119059692Selan 119159692Selan For the 68000, we handle X+REG by loading X into a register R and 119259692Selan using R+REG. R will go in an address reg and indexing will be used. 119359692Selan However, if REG is a broken-out memory address or multiplication, 119459692Selan nothing needs to be done because REG can certainly go in an address reg. */ 119559692Selan 119659692Selan #define COPY_ONCE(Y) if (!copied) { Y = copy_rtx (Y); copied = ch = 1; } 119759692Selan #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ 119859692Selan { register int ch = (X) != (OLDX); \ 119959692Selan if (GET_CODE (X) == PLUS) \ 120059692Selan { int copied = 0; \ 120159692Selan if (GET_CODE (XEXP (X, 0)) == MULT) \ 120259692Selan { COPY_ONCE (X); XEXP (X, 0) = force_operand (XEXP (X, 0), 0);} \ 120359692Selan if (GET_CODE (XEXP (X, 1)) == MULT) \ 120459692Selan { COPY_ONCE (X); XEXP (X, 1) = force_operand (XEXP (X, 1), 0);} \ 120559692Selan if (ch && GET_CODE (XEXP (X, 1)) == REG \ 120659692Selan && GET_CODE (XEXP (X, 0)) == REG) \ 120759692Selan goto WIN; \ 120859692Selan if (ch) { GO_IF_LEGITIMATE_ADDRESS (MODE, X, WIN); } \ 120959692Selan if (GET_CODE (XEXP (X, 0)) == REG \ 121059692Selan || (GET_CODE (XEXP (X, 0)) == SIGN_EXTEND \ 121159692Selan && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG \ 121259692Selan && GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode)) \ 121359692Selan { register rtx temp = gen_reg_rtx (Pmode); \ 121459692Selan register rtx val = force_operand (XEXP (X, 1), 0); \ 121559692Selan emit_move_insn (temp, val); \ 121659692Selan COPY_ONCE (X); \ 121759692Selan XEXP (X, 1) = temp; \ 121859692Selan goto WIN; } \ 121959692Selan else if (GET_CODE (XEXP (X, 1)) == REG \ 122059692Selan || (GET_CODE (XEXP (X, 1)) == SIGN_EXTEND \ 122159692Selan && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG \ 122259692Selan && GET_MODE (XEXP (XEXP (X, 1), 0)) == HImode)) \ 122359692Selan { register rtx temp = gen_reg_rtx (Pmode); \ 122459692Selan register rtx val = force_operand (XEXP (X, 0), 0); \ 122559692Selan emit_move_insn (temp, val); \ 122659692Selan COPY_ONCE (X); \ 122759692Selan XEXP (X, 0) = temp; \ 122859692Selan goto WIN; }}} 122959692Selan 123059692Selan /* Go to LABEL if ADDR (a legitimate address expression) 123159692Selan has an effect that depends on the machine mode it is used for. 123259692Selan On the 68000, only predecrement and postincrement address depend thus 123359692Selan (the amount of decrement or increment being the length of the operand). */ 123459692Selan 123559692Selan #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ 123659692Selan if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) goto LABEL 123759692Selan 123859692Selan /* Specify the machine mode that this machine uses 123959692Selan for the index in the tablejump instruction. */ 124059692Selan #define CASE_VECTOR_MODE HImode 124159692Selan 124259692Selan /* Define this if the tablejump instruction expects the table 124359692Selan to contain offsets from the address of the table. 124459692Selan Do not define this if the table should contain absolute addresses. */ 124559692Selan #define CASE_VECTOR_PC_RELATIVE 124659692Selan 124759692Selan /* Specify the tree operation to be used to convert reals to integers. */ 124859692Selan #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR 124959692Selan 125059692Selan /* This is the kind of divide that is easiest to do in the general case. */ 125159692Selan #define EASY_DIV_EXPR TRUNC_DIV_EXPR 125259692Selan 125359692Selan /* Define this as 1 if `char' should by default be signed; else as 0. */ 125459692Selan #define DEFAULT_SIGNED_CHAR 1 125559692Selan 125659692Selan /* Don't cse the address of the function being compiled. */ 125759692Selan #define NO_RECURSIVE_FUNCTION_CSE 125859692Selan 125959692Selan /* Max number of bytes we can move from memory to memory 126059692Selan in one reasonably fast instruction. */ 126159692Selan #define MOVE_MAX 4 126259692Selan 126359692Selan /* Define this if zero-extension is slow (more than one real instruction). */ 126459692Selan #define SLOW_ZERO_EXTEND 126559692Selan 126659692Selan /* Nonzero if access to memory by bytes is slow and undesirable. */ 126759692Selan #define SLOW_BYTE_ACCESS 0 126859692Selan 126959692Selan /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits 127059692Selan is done just by pretending it is already truncated. */ 127159692Selan #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 127259692Selan 127359692Selan /* We assume that the store-condition-codes instructions store 0 for false 127459692Selan and some other value for true. This is the value stored for true. */ 127559692Selan 127659692Selan #define STORE_FLAG_VALUE -1 127759692Selan 127859692Selan /* When a prototype says `char' or `short', really pass an `int'. */ 127959692Selan #define PROMOTE_PROTOTYPES 128059692Selan 128159692Selan /* Specify the machine mode that pointers have. 128259692Selan After generation of rtl, the compiler makes no further distinction 128359692Selan between pointers and any other objects of this machine mode. */ 128459692Selan #define Pmode SImode 128559692Selan 128659692Selan /* A function address in a call instruction 128759692Selan is a byte address (for indexing purposes) 128859692Selan so give the MEM rtx a byte's mode. */ 128959692Selan #define FUNCTION_MODE QImode 129059692Selan 129159692Selan /* Compute the cost of computing a constant rtl expression RTX 129259692Selan whose rtx-code is CODE. The body of this macro is a portion 129359692Selan of a switch statement. If the code is computed here, 129459692Selan return it with a return statement. Otherwise, break from the switch. */ 129559692Selan 129659692Selan #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ 129759692Selan case CONST_INT: \ 129859692Selan /* Constant zero is super cheap due to clr instruction. */ \ 129959692Selan if (RTX == const0_rtx) return 0; \ 130059692Selan /* Constants between -128 and 127 are cheap due to moveq */ \ 130159692Selan if (INTVAL (RTX) >= -128 && INTVAL (RTX) <= 127) return 1; \ 130259692Selan /* Constants between -136 and 254 are easily generated */ \ 130359692Selan /* by intelligent uses of moveq, add[q], and subq */ \ 130459692Selan if ((OUTER_CODE) == SET && INTVAL (RTX) >= -136 \ 130559692Selan && INTVAL (RTX) <= 254) return 2; \ 130659692Selan case CONST: \ 130759692Selan case LABEL_REF: \ 130859692Selan case SYMBOL_REF: \ 130959692Selan return 3; \ 131059692Selan case CONST_DOUBLE: \ 131159692Selan return 5; 131259692Selan 131359692Selan /* Compute the cost of various arithmetic operations. 131459692Selan These are vaguely right for a 68020. */ 131559692Selan /* The costs for long multiply have been adjusted to 131659692Selan work properly in synth_mult on the 68020, 131759692Selan relative to an average of the time for add and the time for shift, 131859692Selan taking away a little more because sometimes move insns are needed. */ 131959692Selan #define MULL_COST (TARGET_68040 ? 5 : 13) 132059692Selan #define MULW_COST (TARGET_68040 ? 3 : 8) 132159692Selan 132259692Selan #define RTX_COSTS(X,CODE,OUTER_CODE) \ 132359692Selan case PLUS: \ 132459692Selan /* An lea costs about three times as much as a simple add. */ \ 132559692Selan if (GET_MODE (X) == SImode \ 132659692Selan && GET_CODE (XEXP (X, 0)) == REG \ 132759692Selan && GET_CODE (XEXP (X, 1)) == MULT \ 132859692Selan && GET_CODE (XEXP (XEXP (X, 1), 0)) == REG \ 132959692Selan && GET_CODE (XEXP (XEXP (X, 1), 1)) == CONST_INT \ 133059692Selan && (INTVAL (XEXP (XEXP (X, 1), 1)) == 2 \ 133159692Selan || INTVAL (XEXP (XEXP (X, 1), 1)) == 4 \ 133259692Selan || INTVAL (XEXP (XEXP (X, 1), 1)) == 8)) \ 133359692Selan return COSTS_N_INSNS (3); /* lea an@(dx:l:i),am */ \ 133459692Selan break; \ 133559692Selan case ASHIFT: \ 133659692Selan case ASHIFTRT: \ 133759692Selan case LSHIFT: \ 133859692Selan case LSHIFTRT: \ 133959692Selan /* A shift by a big integer takes an extra instruction. */ \ 134059692Selan if (GET_CODE (XEXP (X, 1)) == CONST_INT \ 134159692Selan && (INTVAL (XEXP (X, 1)) == 16)) \ 134259692Selan return COSTS_N_INSNS (2); /* clrw;swap */ \ 134359692Selan if (GET_CODE (XEXP (X, 1)) == CONST_INT \ 134459692Selan && !(INTVAL (XEXP (X, 1)) > 0 \ 134559692Selan && INTVAL (XEXP (X, 1)) <= 8)) \ 134659692Selan return COSTS_N_INSNS (3); /* lsr #i,dn */ \ 134759692Selan break; \ 134859692Selan case MULT: \ 134959692Selan if (GET_CODE (XEXP (x, 1)) == CONST_INT \ 135059692Selan && exact_log2 (INTVAL (XEXP (x, 1))) >= 0) \ 135159692Selan { \ 135259692Selan /* A shift by a big integer takes an extra instruction. */ \ 135359692Selan if (GET_CODE (XEXP (X, 1)) == CONST_INT \ 135459692Selan && (INTVAL (XEXP (X, 1)) == (1 << 16))) \ 135559692Selan return COSTS_N_INSNS (2); /* clrw;swap */ \ 135659692Selan if (GET_CODE (XEXP (X, 1)) == CONST_INT \ 135759692Selan && !(INTVAL (XEXP (X, 1)) > 1 \ 135859692Selan && INTVAL (XEXP (X, 1)) <= 256)) \ 135959692Selan return COSTS_N_INSNS (3); /* lsr #i,dn */ \ 136059692Selan break; \ 136159692Selan } \ 136259692Selan else if (GET_MODE (X) == QImode || GET_MODE (X) == HImode) \ 136359692Selan return COSTS_N_INSNS (MULW_COST); \ 136459692Selan else \ 136559692Selan return COSTS_N_INSNS (MULL_COST); \ 136659692Selan break; \ 136759692Selan case DIV: \ 136859692Selan case UDIV: \ 136959692Selan case MOD: \ 137059692Selan case UMOD: \ 137159692Selan if (GET_MODE (X) == QImode || GET_MODE (X) == HImode) \ 137259692Selan return COSTS_N_INSNS (27); /* div.w */ \ 137359692Selan return COSTS_N_INSNS (43); /* div.l */ 137459692Selan 137559692Selan /* Tell final.c how to eliminate redundant test instructions. */ 137659692Selan 137759692Selan /* Here we define machine-dependent flags and fields in cc_status 137859692Selan (see `conditions.h'). */ 137959692Selan 138059692Selan /* Set if the cc value is actually in the 68881, so a floating point 138159692Selan conditional branch must be output. */ 138259692Selan #define CC_IN_68881 04000 138359692Selan 138459692Selan /* Store in cc_status the expressions that the condition codes will 138559692Selan describe after execution of an instruction whose pattern is EXP. 138659692Selan Do not alter them if the instruction would not alter the cc's. */ 138759692Selan 138859692Selan /* On the 68000, all the insns to store in an address register fail to 138959692Selan set the cc's. However, in some cases these instructions can make it 139059692Selan possibly invalid to use the saved cc's. In those cases we clear out 139159692Selan some or all of the saved cc's so they won't be used. */ 139259692Selan 139359692Selan #define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN) 139459692Selan 139559692Selan #define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \ 139659692Selan { if (cc_prev_status.flags & CC_IN_68881) \ 139759692Selan return FLOAT; \ 139859692Selan if (cc_prev_status.flags & CC_NO_OVERFLOW) \ 139959692Selan return NO_OV; \ 140059692Selan return NORMAL; } 140159692Selan 140259692Selan /* Control the assembler format that we output. */ 140359692Selan 140459692Selan /* Output at beginning of assembler file. */ 140559692Selan 140659692Selan #define ASM_FILE_START(FILE) \ 140759692Selan fprintf (FILE, "#NO_APP\n"); 140859692Selan 140959692Selan /* Output to assembler file text saying following lines 141059692Selan may contain character constants, extra white space, comments, etc. */ 141159692Selan 141259692Selan #define ASM_APP_ON "#APP\n" 141359692Selan 141459692Selan /* Output to assembler file text saying following lines 141559692Selan no longer contain unusual constructs. */ 141659692Selan 141759692Selan #define ASM_APP_OFF "#NO_APP\n" 141859692Selan 141959692Selan /* Output before read-only data. */ 142059692Selan 142159692Selan #define TEXT_SECTION_ASM_OP ".text" 142259692Selan 142359692Selan /* Output before writable data. */ 142459692Selan 142559692Selan #define DATA_SECTION_ASM_OP ".data" 142659692Selan 142759692Selan /* Here are four prefixes that are used by asm_fprintf to 142859692Selan facilitate customization for alternate assembler syntaxes. 142959692Selan Machines with no likelihood of an alternate syntax need not 143059692Selan define these and need not use asm_fprintf. */ 143159692Selan 143259692Selan /* The prefix for register names. Note that REGISTER_NAMES 143359692Selan is supposed to include this prefix. */ 143459692Selan 143559692Selan #define REGISTER_PREFIX "" 143659692Selan 143759692Selan /* The prefix for local labels. You should be able to define this as 143859692Selan an empty string, or any arbitrary string (such as ".", ".L%", etc) 143959692Selan without having to make any other changes to account for the specific 144059692Selan definition. Note it is a string literal, not interpreted by printf 144159692Selan and friends. */ 144259692Selan 144359692Selan #define LOCAL_LABEL_PREFIX "" 144459692Selan 144559692Selan /* The prefix to add to user-visible assembler symbols. */ 144659692Selan 144759692Selan #define USER_LABEL_PREFIX "_" 144859692Selan 144959692Selan /* The prefix for immediate operands. */ 145059692Selan 145159692Selan #define IMMEDIATE_PREFIX "#" 145259692Selan 145359692Selan /* How to refer to registers in assembler output. 145459692Selan This sequence is indexed by compiler's hard-register-number (see above). */ 145559692Selan 145659692Selan #ifndef SUPPORT_SUN_FPA 145759692Selan 145859692Selan #define REGISTER_NAMES \ 145959692Selan {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \ 146059692Selan "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp", \ 146159692Selan "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7" } 146259692Selan 146359692Selan #else /* SUPPORTED_SUN_FPA */ 146459692Selan 146559692Selan #define REGISTER_NAMES \ 146659692Selan {"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", \ 146759692Selan "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp", \ 146859692Selan "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", \ 146959692Selan "fpa0", "fpa1", "fpa2", "fpa3", "fpa4", "fpa5", "fpa6", "fpa7", \ 147059692Selan "fpa8", "fpa9", "fpa10", "fpa11", "fpa12", "fpa13", "fpa14", "fpa15", \ 147159692Selan "fpa16", "fpa17", "fpa18", "fpa19", "fpa20", "fpa21", "fpa22", "fpa23", \ 147259692Selan "fpa24", "fpa25", "fpa26", "fpa27", "fpa28", "fpa29", "fpa30", "fpa31" } 147359692Selan 147459692Selan #endif /* defined SUPPORT_SUN_FPA */ 147559692Selan 147659692Selan /* How to renumber registers for dbx and gdb. 147759692Selan On the Sun-3, the floating point registers have numbers 147859692Selan 18 to 25, not 16 to 23 as they do in the compiler. */ 147959692Selan 148059692Selan #define DBX_REGISTER_NUMBER(REGNO) ((REGNO) < 16 ? (REGNO) : (REGNO) + 2) 148159692Selan 148259692Selan /* This is how to output the definition of a user-level label named NAME, 148359692Selan such as the label on a static function or variable NAME. */ 148459692Selan 148559692Selan #define ASM_OUTPUT_LABEL(FILE,NAME) \ 148659692Selan do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0) 148759692Selan 148859692Selan /* This is how to output a command to make the user-level label named NAME 148959692Selan defined for reference from other files. */ 149059692Selan 149159692Selan #define GLOBAL_ASM_OP ".globl" 149259692Selan #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ 149359692Selan do { fprintf (FILE, "%s ", GLOBAL_ASM_OP); \ 149459692Selan assemble_name (FILE, NAME); \ 149559692Selan fputs ("\n", FILE);} while (0) 149659692Selan 149759692Selan /* This is how to output a reference to a user-level label named NAME. 149859692Selan `assemble_name' uses this. */ 149959692Selan 150059692Selan #define ASM_OUTPUT_LABELREF(FILE,NAME) \ 150159692Selan asm_fprintf (FILE, "%0U%s", NAME) 150259692Selan 150359692Selan /* This is how to output an internal numbered label where 150459692Selan PREFIX is the class of label and NUM is the number within the class. */ 150559692Selan 150659692Selan #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 150759692Selan asm_fprintf (FILE, "%0L%s%d:\n", PREFIX, NUM) 150859692Selan 150959692Selan /* This is how to store into the string LABEL 151059692Selan the symbol_ref name of an internal numbered label where 151159692Selan PREFIX is the class of label and NUM is the number within the class. 151259692Selan This is suitable for output with `assemble_name'. */ 151359692Selan 151459692Selan #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ 151559692Selan sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM) 151659692Selan 151759692Selan /* This is how to output an assembler line defining a `double' constant. */ 151859692Selan 151959692Selan #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ 152059692Selan fprintf (FILE, "\t.double 0r%.20g\n", (VALUE)) 152159692Selan 152259692Selan /* This is how to output an assembler line defining a `float' constant. */ 152359692Selan 152459692Selan /* Sun's assembler can't handle floating constants written as floating. 152559692Selan However, when cross-compiling, always use that in case format differs. */ 152659692Selan 152759692Selan #ifdef CROSS_COMPILE 152859692Selan 152959692Selan #define ASM_OUTPUT_FLOAT(FILE,VALUE) \ 153059692Selan fprintf (FILE, "\t.float 0r%.10g\n", (VALUE)) 153159692Selan 153259692Selan #else 153359692Selan 153459692Selan #define ASM_OUTPUT_FLOAT(FILE,VALUE) \ 153559692Selan do { union { float f; long l;} tem; \ 153659692Selan tem.f = (VALUE); \ 153759692Selan fprintf (FILE, "\t.long 0x%x\n", tem.l); \ 153859692Selan } while (0) 153959692Selan 154059692Selan #endif /* not CROSS_COMPILE */ 154159692Selan 154259692Selan /* This is how to output an assembler line defining an `int' constant. */ 154359692Selan 154459692Selan #define ASM_OUTPUT_INT(FILE,VALUE) \ 154559692Selan ( fprintf (FILE, "\t.long "), \ 154659692Selan output_addr_const (FILE, (VALUE)), \ 154759692Selan fprintf (FILE, "\n")) 154859692Selan 154959692Selan /* Likewise for `char' and `short' constants. */ 155059692Selan 155159692Selan #define ASM_OUTPUT_SHORT(FILE,VALUE) \ 155259692Selan ( fprintf (FILE, "\t.word "), \ 155359692Selan output_addr_const (FILE, (VALUE)), \ 155459692Selan fprintf (FILE, "\n")) 155559692Selan 155659692Selan #define ASM_OUTPUT_CHAR(FILE,VALUE) \ 155759692Selan ( fprintf (FILE, "\t.byte "), \ 155859692Selan output_addr_const (FILE, (VALUE)), \ 155959692Selan fprintf (FILE, "\n")) 156059692Selan 156159692Selan /* This is how to output an assembler line for a numeric constant byte. */ 156259692Selan 156359692Selan #define ASM_OUTPUT_BYTE(FILE,VALUE) \ 156459692Selan fprintf (FILE, "\t.byte 0x%x\n", (VALUE)) 156559692Selan 156659692Selan /* This is how to output an insn to push a register on the stack. 156759692Selan It need not be very fast code. */ 156859692Selan 156959692Selan #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ 157059692Selan asm_fprintf (FILE, "\tmovel %s,%Rsp@-\n", reg_names[REGNO]) 157159692Selan 157259692Selan /* This is how to output an insn to pop a register from the stack. 157359692Selan It need not be very fast code. */ 157459692Selan 157559692Selan #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ 157659692Selan asm_fprintf (FILE, "\tmovel %Rsp@+,%s\n", reg_names[REGNO]) 157759692Selan 157859692Selan /* This is how to output an element of a case-vector that is absolute. 157959692Selan (The 68000 does not use such vectors, 158059692Selan but we must define this macro anyway.) */ 158159692Selan 158259692Selan #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ 158359692Selan asm_fprintf (FILE, "\t.long %LL%d\n", VALUE) 158459692Selan 158559692Selan /* This is how to output an element of a case-vector that is relative. */ 158659692Selan 158759692Selan #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ 158859692Selan asm_fprintf (FILE, "\t.word %LL%d-%LL%d\n", VALUE, REL) 158959692Selan 159059692Selan /* This is how to output an assembler line 159159692Selan that says to advance the location counter 159259692Selan to a multiple of 2**LOG bytes. */ 159359692Selan 159459692Selan /* We don't have a way to align to more than a two-byte boundary, so do the 159559692Selan best we can and don't complain. */ 159659692Selan #define ASM_OUTPUT_ALIGN(FILE,LOG) \ 159759692Selan if ((LOG) >= 1) \ 159859692Selan fprintf (FILE, "\t.even\n"); 159959692Selan 160059692Selan #define ASM_OUTPUT_SKIP(FILE,SIZE) \ 160159692Selan fprintf (FILE, "\t.skip %u\n", (SIZE)) 160259692Selan 160359692Selan /* This says how to output an assembler line 160459692Selan to define a global common symbol. */ 160559692Selan 160659692Selan #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ 160759692Selan ( fputs (".comm ", (FILE)), \ 160859692Selan assemble_name ((FILE), (NAME)), \ 160959692Selan fprintf ((FILE), ",%u\n", (ROUNDED))) 161059692Selan 161159692Selan /* This says how to output an assembler line 161259692Selan to define a local common symbol. */ 161359692Selan 161459692Selan #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ 161559692Selan ( fputs (".lcomm ", (FILE)), \ 161659692Selan assemble_name ((FILE), (NAME)), \ 161759692Selan fprintf ((FILE), ",%u\n", (ROUNDED))) 161859692Selan 161959692Selan /* Store in OUTPUT a string (made with alloca) containing 162059692Selan an assembler-name for a local static variable named NAME. 162159692Selan LABELNO is an integer which is different for each call. */ 162259692Selan 162359692Selan #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ 162459692Selan ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ 162559692Selan sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) 162659692Selan 162759692Selan /* Define the parentheses used to group arithmetic operations 162859692Selan in assembler code. */ 162959692Selan 163059692Selan #define ASM_OPEN_PAREN "(" 163159692Selan #define ASM_CLOSE_PAREN ")" 163259692Selan 163359692Selan /* Define results of standard character escape sequences. */ 163459692Selan #define TARGET_BELL 007 163559692Selan #define TARGET_BS 010 163659692Selan #define TARGET_TAB 011 163759692Selan #define TARGET_NEWLINE 012 163859692Selan #define TARGET_VT 013 163959692Selan #define TARGET_FF 014 164059692Selan #define TARGET_CR 015 164159692Selan 164259692Selan /* Output a float value (represented as a C double) as an immediate operand. 164359692Selan This macro is a 68k-specific macro. */ 164459692Selan #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \ 164559692Selan asm_fprintf (FILE, "%I0r%.9g", (VALUE)) 164659692Selan 164759692Selan /* Output a double value (represented as a C double) as an immediate operand. 164859692Selan This macro is a 68k-specific macro. */ 164959692Selan #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ 165059692Selan asm_fprintf (FILE, "%I0r%.20g", (VALUE)) 165159692Selan 165259692Selan /* Print operand X (an rtx) in assembler syntax to file FILE. 165359692Selan CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. 165459692Selan For `%' followed by punctuation, CODE is the punctuation and X is null. 165559692Selan 165659692Selan On the 68000, we use several CODE characters: 165759692Selan '.' for dot needed in Motorola-style opcode names. 165859692Selan '-' for an operand pushing on the stack: 165959692Selan sp@-, -(sp) or -(%sp) depending on the style of syntax. 166059692Selan '+' for an operand pushing on the stack: 166159692Selan sp@+, (sp)+ or (%sp)+ depending on the style of syntax. 166259692Selan '@' for a reference to the top word on the stack: 166359692Selan sp@, (sp) or (%sp) depending on the style of syntax. 166459692Selan '#' for an immediate operand prefix (# in MIT and Motorola syntax 166559692Selan but & in SGS syntax). 166659692Selan '!' for the fpcr register (used in some float-to-fixed conversions). 166759692Selan '$' for the letter `s' in an op code, but only on the 68040. 166859692Selan '&' for the letter `d' in an op code, but only on the 68040. 1669*60382Selan '/' for register prefix needed by longlong.h. 167059692Selan 167159692Selan 'b' for byte insn (no effect, on the Sun; this is for the ISI). 167259692Selan 'd' to force memory addressing to be absolute, not relative. 167359692Selan 'f' for float insn (print a CONST_DOUBLE as a float rather than in hex) 167459692Selan 'w' for FPA insn (print a CONST_DOUBLE as a SunFPA constant rather 167559692Selan than directly). Second part of 'y' below. 167659692Selan 'x' for float insn (print a CONST_DOUBLE as a float rather than in hex), 167759692Selan or print pair of registers as rx:ry. 167859692Selan 'y' for a FPA insn (print pair of registers as rx:ry). This also outputs 167959692Selan CONST_DOUBLE's as SunFPA constant RAM registers if 168059692Selan possible, so it should not be used except for the SunFPA. */ 168159692Selan 168259692Selan #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ 168359692Selan ((CODE) == '.' || (CODE) == '#' || (CODE) == '-' \ 168459692Selan || (CODE) == '+' || (CODE) == '@' || (CODE) == '!' \ 1685*60382Selan || (CODE) == '$' || (CODE) == '&' || (CODE) == '/') 168659692Selan 168759692Selan #ifdef HOST_WORDS_BIG_ENDIAN 168859692Selan #define PRINT_OPERAND_EXTRACT_FLOAT(X) \ 168959692Selan u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); 169059692Selan #else 169159692Selan #define PRINT_OPERAND_EXTRACT_FLOAT(X) \ 169259692Selan u.i[0] = CONST_DOUBLE_HIGH (X); u.i[1] = CONST_DOUBLE_LOW (X); 169359692Selan #endif 169459692Selan 169559692Selan #ifdef CROSS_COMPILE 169659692Selan #define PRINT_OPERAND_PRINT_FLOAT(CODE, FILE) \ 169759692Selan ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f); 169859692Selan #else 169959692Selan #define PRINT_OPERAND_PRINT_FLOAT(CODE, FILE) \ 170059692Selan { if (CODE == 'f') \ 170159692Selan ASM_OUTPUT_FLOAT_OPERAND (FILE, u1.f); \ 170259692Selan else \ 170359692Selan asm_fprintf (FILE, "%I0x%x", u1.i); } 170459692Selan #endif 170559692Selan 170659692Selan /* A C compound statement to output to stdio stream STREAM the 170759692Selan assembler syntax for an instruction operand X. X is an RTL 170859692Selan expression. 170959692Selan 171059692Selan CODE is a value that can be used to specify one of several ways 171159692Selan of printing the operand. It is used when identical operands 171259692Selan must be printed differently depending on the context. CODE 171359692Selan comes from the `%' specification that was used to request 171459692Selan printing of the operand. If the specification was just `%DIGIT' 171559692Selan then CODE is 0; if the specification was `%LTR DIGIT' then CODE 171659692Selan is the ASCII code for LTR. 171759692Selan 171859692Selan If X is a register, this macro should print the register's name. 171959692Selan The names can be found in an array `reg_names' whose type is 172059692Selan `char *[]'. `reg_names' is initialized from `REGISTER_NAMES'. 172159692Selan 172259692Selan When the machine description has a specification `%PUNCT' (a `%' 172359692Selan followed by a punctuation character), this macro is called with 172459692Selan a null pointer for X and the punctuation character for CODE. 172559692Selan 172659692Selan See m68k.c for the m68k specific codes. */ 172759692Selan 172859692Selan #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) 172959692Selan 173059692Selan /* A C compound statement to output to stdio stream STREAM the 173159692Selan assembler syntax for an instruction operand that is a memory 173259692Selan reference whose address is ADDR. ADDR is an RTL expression. 173359692Selan 173459692Selan On some machines, the syntax for a symbolic address depends on 173559692Selan the section that the address refers to. On these machines, 173659692Selan define the macro `ENCODE_SECTION_INFO' to store the information 173759692Selan into the `symbol_ref', and then check for it here. */ 173859692Selan 173959692Selan #define PRINT_OPERAND_ADDRESS(FILE, ADDR) print_operand_address (FILE, ADDR) 174059692Selan 174159692Selan 174259692Selan /* Define functions defined in aux-output.c and used in templates. */ 174359692Selan 174459692Selan extern char *output_move_double (); 174559692Selan extern char *output_move_const_single (); 174659692Selan extern char *output_move_const_double (); 174759692Selan extern char *output_btst (); 174859692Selan 174959692Selan /* 175059692Selan Local variables: 175159692Selan version-control: t 175259692Selan End: 175359692Selan */ 1754