diff options
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/c4x/c4x-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.c | 26 | ||||
-rw-r--r-- | gcc/config/c4x/c4x.h | 57 |
3 files changed, 47 insertions, 38 deletions
diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h index 4814e97..9685f39 100644 --- a/gcc/config/c4x/c4x-protos.h +++ b/gcc/config/c4x/c4x-protos.h @@ -91,8 +91,6 @@ extern int c4x_hard_regno_mode_ok PARAMS ((unsigned int, enum machine_mode)); extern struct rtx_def *c4x_legitimize_address PARAMS ((rtx, enum machine_mode)); -extern struct rtx_def *c4x_legitimize_reload_address PARAMS ((rtx, enum machine_mode, rtx)); - extern int c4x_address_cost PARAMS ((rtx)); extern void c4x_print_operand PARAMS ((FILE *, rtx, int)); diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 3ce7987..346459f 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1679,32 +1679,6 @@ c4x_legitimize_address (orig, mode) } -rtx -c4x_legitimize_reload_address (orig, mode, insn) - rtx orig ATTRIBUTE_UNUSED; - enum machine_mode mode; - rtx insn; -{ - if (mode != HImode - && mode != HFmode - && GET_MODE (orig) != HImode - && GET_MODE (orig) != HFmode - && (GET_CODE (orig) == CONST - || GET_CODE (orig) == SYMBOL_REF - || GET_CODE (orig) == LABEL_REF)) - { - rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO); - if (! TARGET_SMALL) - emit_insn_before (gen_rtx_SET (VOIDmode, dp_reg, - gen_rtx_HIGH (Pmode, orig)), - insn); - return gen_rtx_LO_SUM (Pmode, dp_reg, orig); - } - - return NULL_RTX; -} - - /* Provide the costs of an addressing mode that contains ADDR. If ADDR is not a valid address, its cost is irrelevant. This is used in cse and loop optimisation to determine diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index 49b979e..ce1493d 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -1705,18 +1705,55 @@ CUMULATIVE_ARGS; #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \ { \ - rtx new; \ - new = c4x_legitimize_reload_address (X, MODE, insn); \ - if (new != NULL_RTX) \ - { \ - (X) = new; \ - /* We do not have to call push_reload because we do not require \ - any more reloads. */ \ - goto WIN; \ - } \ + if (MODE != HImode \ + && MODE != HFmode \ + && GET_MODE (X) != HImode \ + && GET_MODE (X) != HFmode \ + && (GET_CODE (X) == CONST \ + || GET_CODE (X) == SYMBOL_REF \ + || GET_CODE (X) == LABEL_REF)) \ + { \ + if (! TARGET_SMALL) \ + { \ + int i; \ + X = gen_rtx_LO_SUM (GET_MODE (X), \ + gen_rtx_HIGH (GET_MODE (X), X), X); \ + i = push_reload (XEXP (X, 0), NULL_RTX, \ + &XEXP (X, 0), NULL_PTR, \ + DP_REG, GET_MODE (X), VOIDmode, 0, 0, \ + OPNUM, TYPE); \ + /* The only valid reg is DP. This is a fixed reg and will \ + normally not be used so force it. */ \ + rld[i].reg_rtx = gen_rtx_REG (Pmode, DP_REGNO); \ + rld[i].nocombine = 1; \ + } \ + goto WIN; \ + } \ + else if (MODE != HImode \ + && MODE != HFmode \ + && GET_MODE (X) != HImode \ + && GET_MODE (X) != HFmode \ + && GET_CODE (X) == LO_SUM \ + && GET_CODE (XEXP (X,0)) == HIGH \ + && (GET_CODE (XEXP (XEXP (X,0),0)) == CONST \ + || GET_CODE (XEXP (XEXP (X,0),0)) == SYMBOL_REF \ + || GET_CODE (XEXP (XEXP (X,0),0)) == LABEL_REF)) \ + { \ + if (! TARGET_SMALL) \ + { \ + int i = push_reload (XEXP (X, 0), NULL_RTX, \ + &XEXP (X, 0), NULL_PTR, \ + DP_REG, GET_MODE (X), VOIDmode, 0, 0, \ + OPNUM, TYPE); \ + /* The only valid reg is DP. This is a fixed reg and will \ + normally not be used so force it. */ \ + rld[i].reg_rtx = gen_rtx_REG (Pmode, DP_REGNO); \ + rld[i].nocombine = 1; \ + } \ + goto WIN; \ + } \ } - /* No mode-dependent addresses on the C4x are autoincrements. */ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ |