📄 sparc.c
字号:
return 0;}/* Nonzero if OP is an integer register. */intintreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return (register_operand (op, SImode) || (TARGET_ARCH64 && register_operand (op, DImode)));}/* Nonzero if OP is a floating point condition code register. */intfcc_reg_operand (rtx op, enum machine_mode mode){ /* This can happen when recog is called from combine. Op may be a MEM. Fail instead of calling abort in this case. */ if (GET_CODE (op) != REG) return 0; if (mode != VOIDmode && mode != GET_MODE (op)) return 0; if (mode == VOIDmode && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) return 0;#if 0 /* ??? ==> 1 when %fcc0-3 are pseudos first. See gen_compare_reg(). */ if (reg_renumber == 0) return REGNO (op) >= FIRST_PSEUDO_REGISTER; return REGNO_OK_FOR_CCFP_P (REGNO (op));#else return (unsigned) REGNO (op) - SPARC_FIRST_V9_FCC_REG < 4;#endif}/* Nonzero if OP is a floating point condition code fcc0 register. */intfcc0_reg_operand (rtx op, enum machine_mode mode){ /* This can happen when recog is called from combine. Op may be a MEM. Fail instead of calling abort in this case. */ if (GET_CODE (op) != REG) return 0; if (mode != VOIDmode && mode != GET_MODE (op)) return 0; if (mode == VOIDmode && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) return 0; return REGNO (op) == SPARC_FCC_REG;}/* Nonzero if OP is an integer or floating point condition code register. */inticc_or_fcc_reg_operand (rtx op, enum machine_mode mode){ if (GET_CODE (op) == REG && REGNO (op) == SPARC_ICC_REG) { if (mode != VOIDmode && mode != GET_MODE (op)) return 0; if (mode == VOIDmode && GET_MODE (op) != CCmode && GET_MODE (op) != CCXmode) return 0; return 1; } return fcc_reg_operand (op, mode);}/* Call insn on SPARC can take a PC-relative constant address, or any regular memory address. */intcall_operand (rtx op, enum machine_mode mode){ if (GET_CODE (op) != MEM) abort (); op = XEXP (op, 0); return (symbolic_operand (op, mode) || memory_address_p (Pmode, op));}intcall_operand_address (rtx op, enum machine_mode mode){ return (symbolic_operand (op, mode) || memory_address_p (Pmode, op));}/* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode, otherwise return 0. */inttls_symbolic_operand (rtx op){ if (GET_CODE (op) != SYMBOL_REF) return 0; return SYMBOL_REF_TLS_MODEL (op);}inttgd_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return tls_symbolic_operand (op) == TLS_MODEL_GLOBAL_DYNAMIC;}inttld_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_DYNAMIC;}inttie_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return tls_symbolic_operand (op) == TLS_MODEL_INITIAL_EXEC;}inttle_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_EXEC;}/* Returns 1 if OP is either a symbol reference or a sum of a symbol reference and a constant. */intsymbolic_operand (register rtx op, enum machine_mode mode){ enum machine_mode omode = GET_MODE (op); if (omode != mode && omode != VOIDmode && mode != VOIDmode) return 0; switch (GET_CODE (op)) { case SYMBOL_REF: return !SYMBOL_REF_TLS_MODEL (op); case LABEL_REF: return 1; case CONST: op = XEXP (op, 0); return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) || GET_CODE (XEXP (op, 0)) == LABEL_REF) && GET_CODE (XEXP (op, 1)) == CONST_INT); default: return 0; }}/* Return truth value of statement that OP is a symbolic memory operand of mode MODE. */intsymbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ if (GET_CODE (op) == SUBREG) op = SUBREG_REG (op); if (GET_CODE (op) != MEM) return 0; op = XEXP (op, 0); return ((GET_CODE (op) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (op)) || GET_CODE (op) == CONST || GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF);}/* Return truth value of statement that OP is a LABEL_REF of mode MODE. */intlabel_ref_operand (rtx op, enum machine_mode mode){ if (GET_CODE (op) != LABEL_REF) return 0; if (GET_MODE (op) != mode) return 0; return 1;}/* Return 1 if the operand is an argument used in generating pic references in either the medium/low or medium/anywhere code models of sparc64. */intsp64_medium_pic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ /* Check for (const (minus (symbol_ref:GOT) (const (minus (label) (pc))))). */ if (GET_CODE (op) != CONST) return 0; op = XEXP (op, 0); if (GET_CODE (op) != MINUS) return 0; if (GET_CODE (XEXP (op, 0)) != SYMBOL_REF) return 0; /* ??? Ensure symbol is GOT. */ if (GET_CODE (XEXP (op, 1)) != CONST) return 0; if (GET_CODE (XEXP (XEXP (op, 1), 0)) != MINUS) return 0; return 1;}/* Return 1 if the operand is a data segment reference. This includes the readonly data segment, or in other words anything but the text segment. This is needed in the medium/anywhere code model on v9. These values are accessed with EMBMEDANY_BASE_REG. */intdata_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ switch (GET_CODE (op)) { case SYMBOL_REF : return ! SYMBOL_REF_FUNCTION_P (op); case PLUS : /* Assume canonical format of symbol + constant. Fall through. */ case CONST : return data_segment_operand (XEXP (op, 0), VOIDmode); default : return 0; }}/* Return 1 if the operand is a text segment reference. This is needed in the medium/anywhere code model on v9. */inttext_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ switch (GET_CODE (op)) { case LABEL_REF : return 1; case SYMBOL_REF : return SYMBOL_REF_FUNCTION_P (op); case PLUS : /* Assume canonical format of symbol + constant. Fall through. */ case CONST : return text_segment_operand (XEXP (op, 0), VOIDmode); default : return 0; }}/* Return 1 if the operand is either a register or a memory operand that is not symbolic. */intreg_or_nonsymb_mem_operand (register rtx op, enum machine_mode mode){ if (register_operand (op, mode)) return 1; if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode)) return 1; return 0;}intsplittable_symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ if (GET_CODE (op) != MEM) return 0; if (! symbolic_operand (XEXP (op, 0), Pmode)) return 0; return 1;}intsplittable_immediate_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ if (GET_CODE (op) != MEM) return 0; if (! immediate_operand (XEXP (op, 0), Pmode)) return 0; return 1;}/* Return truth value of whether OP is EQ or NE. */inteq_or_neq (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return (GET_CODE (op) == EQ || GET_CODE (op) == NE);}/* Return 1 if this is a comparison operator, but not an EQ, NE, GEU, or LTU for non-floating-point. We handle those specially. */intnormal_comp_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ enum rtx_code code; if (!COMPARISON_P (op)) return 0; if (GET_MODE (XEXP (op, 0)) == CCFPmode || GET_MODE (XEXP (op, 0)) == CCFPEmode) return 1; code = GET_CODE (op); return (code != NE && code != EQ && code != GEU && code != LTU);}/* Return 1 if this is a comparison operator. This allows the use of MATCH_OPERATOR to recognize all the branch insns. */intnoov_compare_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ enum rtx_code code; if (!COMPARISON_P (op)) return 0; code = GET_CODE (op); if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) /* These are the only branches which work with CC_NOOVmode. */ return (code == EQ || code == NE || code == GE || code == LT); return 1;}/* Return 1 if this is a 64-bit comparison operator. This allows the use of MATCH_OPERATOR to recognize all the branch insns. */intnoov_compare64_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ enum rtx_code code; if (! TARGET_V9) return 0; if (!COMPARISON_P (op)) return 0; code = GET_CODE (op); if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) /* These are the only branches which work with CCX_NOOVmode. */ return (code == EQ || code == NE || code == GE || code == LT); return (GET_MODE (XEXP (op, 0)) == CCXmode);}/* Nonzero if OP is a comparison operator suitable for use in v9 conditional move or branch on register contents instructions. */intv9_regcmp_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ enum rtx_code code; if (!COMPARISON_P (op)) return 0; code = GET_CODE (op); return v9_regcmp_p (code);}/* Return 1 if this is a SIGN_EXTEND or ZERO_EXTEND operation. */intextend_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ return GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND;}/* Return nonzero if OP is an operator of mode MODE which can set the condition codes explicitly. We do not include PLUS and MINUS because these require CC_NOOVmode, which we handle explicitly. */intcc_arithop (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ if (GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR) return 1; return 0;}/* Return nonzero if OP is an operator of mode MODE which can bitwise complement its second operand and set the condition codes explicitly. */intcc_arithopn (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ /* XOR is not here because combine canonicalizes (xor (not ...) ...) and (xor ... (not ...)) to (not (xor ...)). */ return (GET_CODE (op) == AND || GET_CODE (op) == IOR);}/* Return true if OP is a register, or is a CONST_INT that can fit in a signed 13 bit immediate field. This is an acceptable SImode operand for most 3 address instructions. */intarith_operand (rtx op, enum machine_mode mode){ if (register_operand (op, mode)) return 1; if (GET_CODE (op) != CONST_INT) return 0; return SMALL_INT32 (op);}/* Return true if OP is a constant 4096 */intarith_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){ if (GET_CODE (op) != CONST_INT) return 0; else return INTVAL (op) == 4096;}/* Return true if OP is suitable as second operand for add/sub */intarith_add_operand (rtx op, enum machine_mode mode){ return arith_operand (op, mode) || arith_4096_operand (op, mode);}/* Return true if OP is a CONST_INT or a CONST_DOUBLE which can fit in the immediate field of OR and XOR instructions. Used for 64-bit constant formation patterns. */intconst64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -