📄 romp.h
字号:
GCC's default value, 'P', is used by dbx to refers to an external procedure. The section 5 manual page for dbx implies that 'R' would be the right letter, but dbx 1.5 has a bug in it that precludes its use. Probably that is why neither hc or pcc use this. pcc puts in two stabs entries: one for the parameter location and one for the register location. The letter `r' (register) would be okay, but it loses parameter attribute of the stabs entry. */#define DBX_REGPARM_STABS_LETTER 'R'/* A C expression for the integer offset value of an automatic variable (N_LSYM) having address X (an RTX). This gets used in .stabs entries for the local variables. Compare with the default definition. */#define DEBUGGER_AUTO_OFFSET(X) \ (GET_CODE (X) == PLUS \ ? romp_debugger_auto_correction (INTVAL (XEXP (X, 1)) ) \ : 0 )/* A C expression for the integer offset value of an argument (N_PSYM) having address X (an RTX). The nominal offset is OFFSET. */#define DEBUGGER_ARG_OFFSET(OFFSET, X) \ romp_debugger_arg_correction (OFFSET);/* We don't have GAS for the RT yet, so don't write out special .stabs in cc1plus. */ #define FASCIST_ASSEMBLER/* Do not break .stabs pseudos into continuations. */#define DBX_CONTIN_LENGTH 0/* Don't try to use the `x' type-cross-reference character in DBX data. Also has the consequence of putting each struct, union or enum into a separate .stabs, containing only cross-refs to the others. */#define DBX_NO_XREFS/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits is done just by pretending it is already truncated. */#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1/* Specify the machine mode that pointers have. After generation of rtl, the compiler makes no further distinction between pointers and any other objects of this machine mode. */#define Pmode SImode/* Mode of a function address in a call instruction (for indexing purposes). Doesn't matter on ROMP. */#define FUNCTION_MODE SImode/* Define this if addresses of constant functions shouldn't be put through pseudo regs where they can be cse'd. Desirable on machines where ordinary constants are expensive but a CALL with constant address is cheap. */#define NO_FUNCTION_CSE/* Define this if shift instructions ignore all but the low-order few bits. This is not true on the RT since it uses the low-order 6, not 5, bits. At some point, this should be extended to see how to express that. *//* #define SHIFT_COUNT_TRUNCATED *//* Compute the cost of computing a constant rtl expression RTX whose rtx-code is CODE, contained within an expression of code OUTER_CODE. The body of this macro is a portion of a switch statement. If the code is computed here, return it with a return statement. Otherwise, break from the switch. */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \ case CONST_INT: \ if (((OUTER_CODE) == IOR && exact_log2 (INTVAL (RTX)) >= 0) \ || ((OUTER_CODE) == AND && exact_log2 (~INTVAL (RTX)) >= 0) \ || (((OUTER_CODE) == PLUS || (OUTER_CODE) == MINUS) \ && (unsigned int) (INTVAL (RTX) + 15) < 31) \ || ((OUTER_CODE) == SET && (unsigned int) INTVAL (RTX) < 16))\ return 0; \ return ((unsigned int) (INTVAL(RTX) + 0x8000) < 0x10000 \ || (INTVAL (RTX) & 0xffff0000) == 0) ? 0 : COSTS_N_INSNS (2);\ case CONST: \ case LABEL_REF: \ case SYMBOL_REF: \ if (current_function_operand (RTX, Pmode)) return 0; \ return COSTS_N_INSNS (2); \ case CONST_DOUBLE: \ if ((RTX) == CONST0_RTX (GET_MODE (RTX))) return 2; \ return ((GET_MODE_CLASS (GET_MODE (RTX)) == MODE_FLOAT) \ ? COSTS_N_INSNS (5) : COSTS_N_INSNS (4));/* Provide the costs of a rtl expression. This is in the body of a switch on CODE. References to our own data area are really references to r14, so they are very cheap. Multiples and divides are very expensive. */#define RTX_COSTS(X,CODE,OUTER_CODE) \ case MEM: \ return current_function_operand (X, Pmode) ? 0 : COSTS_N_INSNS (2); \ case MULT: \ return (TARGET_IN_LINE_MUL && GET_MODE_CLASS (GET_MODE (X)) == MODE_INT)\ ? COSTS_N_INSNS (19) : COSTS_N_INSNS (25); \ case DIV: \ case UDIV: \ case MOD: \ case UMOD: \ return COSTS_N_INSNS (45);/* Compute the cost of an address. This is meant to approximate the size and/or execution delay of an insn using that address. If the cost is approximated by the RTL complexity, including CONST_COSTS above, as is usually the case for CISC machines, this macro should not be defined. For aggressively RISCy machines, only one insn format is allowed, so this macro should be a constant. The value of this macro only matters for valid addresses. For the ROMP, everything is cost 0 except for addresses involving symbolic constants, which are cost 1. */#define ADDRESS_COST(RTX) \ ((GET_CODE (RTX) == SYMBOL_REF \ && ! CONSTANT_POOL_ADDRESS_P (RTX)) \ || GET_CODE (RTX) == LABEL_REF \ || (GET_CODE (RTX) == CONST \ && ! constant_pool_address_operand (RTX, Pmode)) \ || (GET_CODE (RTX) == PLUS \ && ((GET_CODE (XEXP (RTX, 1)) == SYMBOL_REF \ && ! CONSTANT_POOL_ADDRESS_P (XEXP (RTX, 0))) \ || GET_CODE (XEXP (RTX, 1)) == LABEL_REF \ || GET_CODE (XEXP (RTX, 1)) == CONST)))/* Adjust the length of an INSN. LENGTH is the currently-computed length and should be adjusted to reflect any required changes. This macro is used when there is some systematic length adjustment required that would be difficult to express in the length attribute. On the ROMP, there are two adjustments: First, a 2-byte insn in the delay slot of a CALL (including floating-point operations) actually takes four bytes. Second, we have to make the worst-case alignment assumption for address vectors. */#define ADJUST_INSN_LENGTH(X,LENGTH) \ if (GET_CODE (X) == INSN && GET_CODE (PATTERN (X)) == SEQUENCE \ && GET_CODE (XVECEXP (PATTERN (X), 0, 0)) != JUMP_INSN \ && get_attr_length (XVECEXP (PATTERN (X), 0, 1)) == 2) \ (LENGTH) += 2; \ else if (GET_CODE (X) == JUMP_INSN && GET_CODE (PATTERN (X)) == ADDR_VEC) \ (LENGTH) += 2;/* Tell final.c how to eliminate redundant test instructions. *//* Here we define machine-dependent flags and fields in cc_status (see `conditions.h'). *//* Set if condition code (really not-Z) is stored in `test bit'. */#define CC_IN_TB 01000/* Set if condition code is set by an unsigned compare. */#define CC_UNSIGNED 02000/* Store in cc_status the expressions that the condition codes will describe after execution of an instruction whose pattern is EXP. Do not alter them if the instruction would not alter the cc's. */#define NOTICE_UPDATE_CC(BODY,INSN) \ update_cc (BODY, INSN)/* Control the assembler format that we output. *//* Output at beginning of assembler file. */#define ASM_FILE_START(FILE) \{ const char *p; \ \ fprintf (FILE, "\t.globl .oVncs\n\t.set .oVncs,0\n") ; \ fprintf (FILE, "\t.globl .oVgcc"); \ for (p = version_string; *p != ' ' && *p != 0; p++) \ fprintf (FILE, "%c", *p); \ fprintf (FILE, "\n\t.set .oVgcc"); \ for (p = version_string; *p != ' ' && *p != 0; p++) \ fprintf (FILE, "%c", *p); \ fprintf (FILE, ",0\n"); \}/* Output to assembler file text saying following lines may contain character constants, extra white space, comments, etc. */#define ASM_APP_ON ""/* Output to assembler file text saying following lines no longer contain unusual constructs. */#define ASM_APP_OFF ""/* Output before instructions and read-only data. */#define TEXT_SECTION_ASM_OP "\t.text"/* Output before writable data. */#define DATA_SECTION_ASM_OP "\t.data"/* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */#define REGISTER_NAMES \{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", \ "r10", "r11", "r12", "r13", "r14", "r15", "ap", \ "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7" }/* Globalizing directive for a label. */#define GLOBAL_ASM_OP "\t.globl "/* The prefix to add to user-visible assembler symbols. */#define USER_LABEL_PREFIX "_"/* This is how to output an internal numbered label where PREFIX is the class of label and NUM is the number within the class. */#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, "%s%d:\n", PREFIX, NUM)/* This is how to output a label for a jump table. Arguments are the same as for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is passed. */#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }/* This is how to store into the string LABEL the symbol_ref name of an internal numbered label where PREFIX is the class of label and NUM is the number within the class. This is suitable for output with `assemble_name'. */#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ sprintf (LABEL, "*%s%d", PREFIX, NUM)/* This is how to output code to push a register on the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ fprintf (FILE, "\tsis r1,4\n\tsts %s,0(r1)\n", reg_names[REGNO])/* This is how to output an insn to pop a register from the stack. It need not be very fast code. */#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ fprintf (FILE, "\tls r1,0(r1)\n\tais r1,4\n", reg_names[REGNO])/* This is how to output an element of a case-vector that is absolute. */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ fprintf (FILE, "\t.long L%d\n", VALUE)/* This is how to output an element of a case-vector that is relative. Don't define this if it is not supported. *//* #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) *//* This is how to output an assembler line that says to advance the location counter to a multiple of 2**LOG bytes. */#define ASM_OUTPUT_ALIGN(FILE,LOG) \ if ((LOG) != 0) \ fprintf (FILE, "\t.align %d\n", (LOG))#define ASM_OUTPUT_SKIP(FILE,SIZE) \ fprintf (FILE, "\t.space %d\n", (SIZE))/* This says how to output an assembler line to define a global common symbol. */#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \( fputs (".comm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%d\n", (SIZE)))/* This says how to output an assembler line to define a local common symbol. */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \( fputs (".lcomm ", (FILE)), \ assemble_name ((FILE), (NAME)), \ fprintf ((FILE), ",%d\n", (SIZE)))/* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable named NAME. LABELNO is an integer which is different for each call. */#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO)))/* Print operand X (an rtx) in assembler syntax to file FILE. CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. For `%' followed by punctuation, CODE is the punctuation and X is null. */#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)/* Define which CODE values are valid. */#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ((CODE) == '.' || (CODE) == '#')/* Print a memory address as an operand to reference that memory location. */#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \{ register rtx addr = ADDR; \ register rtx base = 0, offset = addr; \ if (GET_CODE (addr) == REG) \ base = addr, offset = const0_rtx; \ else if (GET_CODE (addr) == PLUS \ && GET_CODE (XEXP (addr, 0)) == REG) \ base = XEXP (addr, 0), offset = XEXP (addr, 1); \ else if (GET_CODE (addr) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (addr)) \ { \ offset = GEN_INT (get_pool_offset (addr) + 12); \ base = gen_rtx_REG (SImode, 14); \ } \ else if (GET_CODE (addr) == CONST \ && GET_CODE (XEXP (addr, 0)) == PLUS \ && GET_CODE (XEXP (XEXP (addr, 0), 1)) == CONST_INT \ && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF \ && CONSTANT_POOL_ADDRESS_P (XEXP (XEXP (addr, 0), 0))) \ { \ offset = plus_constant (XEXP (XEXP (addr, 0), 1), \ (get_pool_offset (XEXP (XEXP (addr, 0), 0)) \ + 12)); \ base = gen_rtx_REG (SImode, 14); \ } \ output_addr_const (FILE, offset); \ if (base) \ fprintf (FILE, "(%s)", reg_names [REGNO (base)]); \}/* Define the codes that are matched by predicates in aux-output.c. */#define PREDICATE_CODES \ {"zero_memory_operand", {SUBREG, MEM}}, \ {"short_memory_operand", {SUBREG, MEM}}, \ {"symbolic_memory_operand", {SUBREG, MEM}}, \ {"current_function_operand", {MEM}}, \ {"constant_pool_address_operand", {SUBREG, CONST}}, \ {"romp_symbolic_operand", {LABEL_REF, SYMBOL_REF, CONST}}, \ {"constant_operand", {LABEL_REF, SYMBOL_REF, PLUS, CONST, CONST_INT}}, \ {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_any_cint_operand", {SUBREG, REG, CONST_INT}}, \ {"short_cint_operand", {CONST_INT}}, \ {"reg_or_D_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_add_operand", {SUBREG, REG, LABEL_REF, SYMBOL_REF, \ PLUS, CONST, CONST_INT}}, \ {"reg_or_and_operand", {SUBREG, REG, CONST_INT}}, \ {"reg_or_mem_operand", {SUBREG, REG, MEM}}, \ {"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \ {"romp_operand", {SUBREG, MEM, REG, CONST_INT, CONST, LABEL_REF, \ SYMBOL_REF, CONST_DOUBLE}}, \ {"reg_0_operand", {REG}}, \ {"reg_15_operand", {REG}}, \ {"float_binary", {PLUS, MINUS, MULT, DIV}}, \ {"float_unary", {NEG, ABS}}, \ {"float_conversion", {FLOAT_TRUNCATE, FLOAT_EXTEND, FLOAT, FIX}},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -