diff options
author | Rask Ingemann Lambertsen <rask@sygehus.dk> | 2007-09-18 13:24:44 +0000 |
---|---|---|
committer | Rask Ingemann Lambertsen <rask@sygehus.dk> | 2007-09-18 13:24:44 +0000 |
commit | a33f80cf3fce2250e24d40bb13fa51cefa7476d9 (patch) | |
tree | 3793e6188f7bc696e01268348adc6d0ef3bf4772 /gcc/config/fr30 | |
parent | 69b3c7453b616d00ef9a45accd178b1b6d526692 (diff) |
PR target/33388
PR target/33397
* config/fr30/fr30.md (addsi3): Check REG_P() before calling REGNO().
(addsi_small_int): Likewise.
(addsi_big_int): Use rtx_equal_p() instead of REGNO() comparison.
(one_cmplsi2): Likewise.
(negsi2): Delete.
(enter_func): Expand insn using hard_frame_pointer_rtx and
stack_pointer_rtx.
(*enter_func): New.
* config/fr30/fr30.c (fr30_expand_prologue): Check for
hard_frame_pointer_rtx instead of using REGNO() check.
Properly sign extend GEN_INT() argument.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@128577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/fr30')
-rw-r--r-- | gcc/config/fr30/fr30.c | 5 | ||||
-rw-r--r-- | gcc/config/fr30/fr30.md | 67 |
2 files changed, 28 insertions, 44 deletions
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 7856f879090..343dd02ba09 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -308,7 +308,7 @@ fr30_expand_prologue (void) G++ testsuite. */ if (! frame_pointer_needed && GET_CODE (part) == SET - && REGNO (SET_DEST (part)) == HARD_FRAME_POINTER_REGNUM) + && SET_DEST (part) == hard_frame_pointer_rtx) RTX_FRAME_RELATED_P (part) = 0; else RTX_FRAME_RELATED_P (part) = 1; @@ -336,7 +336,8 @@ fr30_expand_prologue (void) ; /* Nothing to do. */ else if (current_frame_info.frame_size <= 512) { - insn = emit_insn (gen_add_to_stack (GEN_INT (- current_frame_info.frame_size))); + insn = emit_insn (gen_add_to_stack + (GEN_INT (- (signed) current_frame_info.frame_size))); RTX_FRAME_RELATED_P (insn) = 1; } else diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md index 8bd0c35ef37..a198ea3544d 100644 --- a/gcc/config/fr30/fr30.md +++ b/gcc/config/fr30/fr30.md @@ -660,7 +660,8 @@ emit_insn (gen_addsi_big_int (operands[0], operands[1], operands[2])); else if (INTVAL (operands[2]) >= -16 && INTVAL (operands[2]) <= 15 - && (!REGNO_PTR_FRAME_P (REGNO (operands[1])) + && (!REG_P (operands[1]) + || !REGNO_PTR_FRAME_P (REGNO (operands[1])) || REGNO (operands[1]) == STACK_POINTER_REGNUM)) emit_insn (gen_addsi_small_int (operands[0], operands[1], operands[2])); else @@ -684,7 +685,8 @@ [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "0,0") (match_operand:SI 2 "add_immediate_operand" "I,J")))] - "! REGNO_PTR_FRAME_P (REGNO (operands[1])) + "!REG_P (operands[1]) + || !REGNO_PTR_FRAME_P (REGNO (operands[1])) || REGNO (operands[1]) == STACK_POINTER_REGNUM" "@ addn %2, %0 @@ -698,7 +700,7 @@ "" "{ /* Cope with the possibility that ops 0 and 1 are the same register. */ - if (REGNO (operands[0]) == REGNO (operands[1])) + if (rtx_equal_p (operands[0], operands[1])) { if (reload_in_progress || reload_completed) { @@ -804,43 +806,6 @@ ) ;;}}} -;;{{{ Negation - -(define_expand "negsi2" - [(set (match_operand:SI 0 "register_operand" "") - (neg:SI (match_operand:SI 1 "register_operand" "")))] - "" - "{ - if (REGNO (operands[0]) == REGNO (operands[1])) - { - if (reload_in_progress || reload_completed) - { - rtx reg = gen_rtx_REG (SImode, 0/*COMPILER_SCRATCH_REGISTER*/); - - emit_insn (gen_movsi (reg, const0_rtx)); - emit_insn (gen_subsi3 (reg, reg, operands[0])); - emit_insn (gen_movsi (operands[0], reg)); - } - else - { - rtx reg = gen_reg_rtx (SImode); - - emit_insn (gen_movsi (reg, const0_rtx)); - emit_insn (gen_subsi3 (reg, reg, operands[0])); - emit_insn (gen_movsi (operands[0], reg)); - } - } - else - { - emit_insn (gen_movsi_internal (operands[0], const0_rtx)); - emit_insn (gen_subsi3 (operands[0], operands[0], operands[1])); - } - DONE; - }" -) - -;;}}} - ;;}}} ;;{{{ Shifts @@ -922,7 +887,7 @@ (not:SI (match_operand:SI 1 "register_operand" "")))] "" "{ - if (REGNO (operands[0]) == REGNO (operands[1])) + if (rtx_equal_p (operands[0], operands[1])) { if (reload_in_progress || reload_completed) { @@ -1406,7 +1371,25 @@ "leave" ) -(define_insn "enter_func" +(define_expand "enter_func" + [(parallel + [(set:SI (mem:SI (minus:SI (match_dup 1) + (const_int 4))) + (match_dup 2)) + (set:SI (match_dup 2) + (minus:SI (match_dup 1) + (const_int 4))) + (set:SI (match_dup 1) + (minus:SI (match_dup 1) + (match_operand:SI 0 "immediate_operand")))] + )] + "" +{ + operands[1] = stack_pointer_rtx; + operands[2] = hard_frame_pointer_rtx; +}) + +(define_insn "*enter_func" [(set:SI (mem:SI (minus:SI (reg:SI 15) (const_int 4))) (reg:SI 14)) |