(LP_REGNUM 31) ; Return address register
(CC_REGNUM 32) ; Condition code pseudo register
(FCC_REGNUM 33) ; Floating Condition code pseudo register
+ (UNSPEC_LOOP 200) ; loop counter
]
)
(define_attr "type" "load,store,bit1,mult,macc,div,fpu,single,other"
(const_string "other"))
-(define_attr "cpu" "none,v850,v850e,v850e1,v850e2,v850e2v3"
+(define_attr "cpu" "none,v850,v850e,v850e1,v850e2,v850e2v3,v850e3v5"
(cond [(match_test "TARGET_V850")
(const_string "v850")
(match_test "TARGET_V850E")
(const_string "v850e1")
(match_test "TARGET_V850E2")
(const_string "v850e2")
- (match_test "TARGET_V850E2")
- (const_string "v850e2v3")]
+ (match_test "TARGET_V850E2V3")
+ (const_string "v850e2v3")
+ (match_test "TARGET_V850E3V5")
+ (const_string "v850e3v5")]
(const_string "none")))
;; Condition code settings.
(sign_extend:SI
(mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "disp23_operand" "W")))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"ld.b %2[%1],%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
(zero_extend:SI
(mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "disp23_operand" "W")))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"ld.bu %2[%1],%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
(sign_extend:SI
(mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "disp23_operand" "W")))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"ld.h %2[%1],%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
(zero_extend:SI
(mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "disp23_operand" "W")))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"ld.hu %2[%1],%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
[(set (match_operand:SI 0 "register_operand" "=r")
(mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "disp23_operand" "W"))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"ld.w %2[%1],%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
[(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand 1 "disp23_operand" "W")))
(match_operand:QI 2 "register_operand" "r"))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"st.b %2,%1[%0]"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
[(set (mem:HI (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand 1 "disp23_operand" "W")))
(match_operand:HI 2 "register_operand" "r"))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"st.h %2,%1[%0]"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
[(set (mem:SI (plus:SI (match_operand:SI 0 "register_operand" "r")
(match_operand 1 "disp23_operand" "W")))
(match_operand:SI 2 "register_operand" "r"))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"st.w %2,%1[%0]"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
+;; movdi
+
+(define_expand "movdi"
+ [(set (match_operand:DI 0 "general_operand")
+ (match_operand:DI 1 "general_operand"))]
+ "TARGET_V850E3V5_UP"
+ {
+ /* One of the ops has to be in a register or 0. */
+ if (!register_operand (operand0, DImode)
+ && !register_operand (operand1, DImode))
+ operands[1] = copy_to_mode_reg (DImode, operand1);
+
+ if (register_operand (operand0, DImode)
+ && (CONST_INT_P (operands[1]) || CONST_DOUBLE_P (operands[1])))
+ {
+ int i;
+
+ for (i = 0; i < UNITS_PER_WORD * 2; i += UNITS_PER_WORD)
+ emit_move_insn (simplify_gen_subreg (SImode, operands[0], DImode, i),
+ simplify_gen_subreg (SImode, operands[1], DImode, i));
+ DONE;
+ }
+ }
+)
+
+(define_insn "*movdi_internal"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=r,e!r,m")
+ (match_operand:DI 1 "nonimmediate_operand" "r,m,e!r"))]
+ "TARGET_V850E3V5_UP
+ || (register_operand (operands[0], DImode) && register_operand (operands[1], DImode))"
+ { return v850_gen_movdi (operands); }
+ [(set_attr "length" "4,12,12")
+ (set_attr "cc" "none_0hit")
+ (set_attr "type" "other,load,store")]
+)
+
;; movqi
(define_expand "movqi"
must be done with HIGH & LO_SUM patterns. */
if (CONSTANT_P (operands[1])
&& GET_CODE (operands[1]) != HIGH
- && ! (TARGET_V850E || TARGET_V850E2_ALL)
+ && ! (TARGET_V850E_UP)
&& !special_symbolref_operand (operands[1], VOIDmode)
&& !(GET_CODE (operands[1]) == CONST_INT
&& (CONST_OK_FOR_J (INTVAL (operands[1]))
(define_insn "*movsi_internal_v850e"
[(set (match_operand:SI 0 "general_operand" "=r,r,r,r,Q,r,r,m,m,r")
(match_operand:SI 1 "general_operand" "Jr,K,L,Q,Ir,m,R,r,I,i"))]
- "(TARGET_V850E || TARGET_V850E2_ALL)
+ "(TARGET_V850E_UP)
&& (register_operand (operands[0], SImode)
|| reg_or_0_operand (operands[1], SImode))"
{
(label_ref (match_operand 3 ""))
(pc)))
(clobber (cc0))]
- "TARGET_V850E2V3"
+ "TARGET_USE_FPU"
{
- v850_compare_op0 = operands[1];
- v850_compare_op1 = operands[2];
-
- enum rtx_code cond = GET_CODE(operands[0]);
+ enum rtx_code cond = GET_CODE (operands[0]);
enum machine_mode mode;
rtx fcc_reg;
rtx cc_reg;
rtx tmp;
+ v850_compare_op0 = operands[1];
+ v850_compare_op1 = operands[2];
+
if (GET_MODE_CLASS (GET_MODE (v850_compare_op0)) != MODE_FLOAT)
FAIL;
(match_operator:SI 1 "ordered_comparison_operator"
[(match_operand:SF 2 "register_operand" "r")
(match_operand:SF 3 "register_operand" "r")]))]
- "TARGET_V850E2V3"
+ "TARGET_USE_FPU"
{
if (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GE)
return "cmpf.s %c1, %z2, %z3 ; trfsr ; setf nz, %0";
(label_ref (match_operand 3 ""))
(pc)))
(clobber (cc0))]
- "TARGET_V850E2V3"
+ "TARGET_USE_FPU"
{
- v850_compare_op0 = operands[1];
- v850_compare_op1 = operands[2];
-
- enum rtx_code cond = GET_CODE(operands[0]);
+ enum rtx_code cond = GET_CODE (operands[0]);
enum machine_mode mode;
rtx fcc_reg;
rtx cc_reg;
rtx tmp;
+ v850_compare_op0 = operands[1];
+ v850_compare_op1 = operands[2];
+
if (GET_MODE_CLASS (GET_MODE (v850_compare_op0)) != MODE_FLOAT)
FAIL;
(match_operator:SI 1 "ordered_comparison_operator"
[(match_operand:DF 2 "even_reg_operand" "r")
(match_operand:DF 3 "even_reg_operand" "r")]))]
- "TARGET_V850E2V3"
+ "TARGET_USE_FPU"
{
if (GET_CODE (operands[1]) == GT || GET_CODE (operands[1]) == GE)
return "cmpf.d %c1, %z2, %z3 ; trfsr ; setf nz, %0";
[(set (match_operand:SI 0 "register_operand" "=r")
(mult:SI (match_operand:SI 1 "register_operand" "%0")
(match_operand:SI 2 "reg_or_int9_operand" "rO")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"mul %2,%1,%."
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")
(mod:SI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E || TARGET_V850E2_ALL"
+ "TARGET_V850E_UP"
{
- if (TARGET_V850E2_ALL)
+ if (TARGET_V850E2_UP)
return "divq %2,%0,%3";
else
return "div %2,%0,%3";
(umod:SI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E || TARGET_V850E2_ALL"
+ "TARGET_V850E_UP"
{
- if (TARGET_V850E2_ALL)
+ if (TARGET_V850E2_UP)
return "divqu %2,%0,%3";
else
return "divu %2,%0,%3";
(mod:HI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E || TARGET_V850E2_ALL"
+ "TARGET_V850E_UP"
"divh %2,%0,%3"
[(set_attr "length" "4")
(set_attr "cc" "clobber")
(umod:HI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E || TARGET_V850E2_ALL"
+ "TARGET_V850E_UP"
"zxh %0 ; divhu %2,%0,%3"
[(set_attr "length" "4")
(set_attr "cc" "clobber")
;; optimize_bitfield_compare in fold-const usually converts single
;; bit extracts into an AND with a mask.
+(define_insn "insv"
+ [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r")
+ (match_operand:SI 1 "immediate_operand" "n")
+ (match_operand:SI 2 "immediate_operand" "n"))
+ (match_operand:SI 3 "register_operand" "r"))]
+ "TARGET_V850E3V5_UP"
+ "bins %3, %2, %1, %0"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_zn")]
+)
+
;; -----------------------------------------------------------------
;; Scc INSTRUCTIONS
;; -----------------------------------------------------------------
(define_insn "set_z_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand 1 "v850_float_z_comparison_operator" ""))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"setf z,%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
(define_insn "set_nz_insn"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand 1 "v850_float_nz_comparison_operator" ""))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
"setf nz,%0"
[(set_attr "length" "4")
(set_attr "cc" "none_0hit")])
(match_operand 1 "comparison_operator")
(match_operand:SI 2 "reg_or_const_operand" "rJ")
(match_operand:SI 3 "reg_or_const_operand" "rI")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
{
/* Make sure that we have an integer comparison... */
if (GET_MODE (XEXP (operands[1], 0)) != CCmode
[(reg:CC CC_REGNUM) (const_int 0)])
(match_operand:SI 2 "reg_or_int5_operand" "rJ")
(match_operand:SI 3 "reg_or_0_operand" "rI")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"cmov %c1,%2,%z3,%0";
[(set_attr "length" "6")
(set_attr "cc" "compare")])
[(reg:CC CC_REGNUM) (const_int 0)])
(match_operand:SI 2 "reg_or_0_operand" "rI")
(match_operand:SI 3 "reg_or_int5_operand" "rJ")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"cmov %C1,%3,%z2,%0"
[(set_attr "length" "6")
(set_attr "cc" "compare")])
(match_operand:SI 5 "reg_or_int5_operand" "rJ")])
(match_operand:SI 2 "reg_or_int5_operand" "rJ")
(match_operand:SI 3 "reg_or_0_operand" "rI")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"cmp %5,%4 ; cmov %c1,%2,%z3,%0"
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
(match_operand:SI 5 "reg_or_int5_operand" "rJ")])
(match_operand:SI 2 "reg_or_0_operand" "rI")
(match_operand:SI 3 "reg_or_int5_operand" "rJ")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"cmp %5,%4 ; cmov %C1,%3,%z2,%0"
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
(const_int 0)])
(match_operand:SI 4 "reg_or_int5_operand" "rJ")
(match_operand:SI 5 "reg_or_0_operand" "rI")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"tst1 %3,%2 ; cmov %c1,%4,%z5,%0"
[(set_attr "length" "8")
(set_attr "cc" "clobber")])
(const_int 0)])
(match_operand:SI 4 "reg_or_0_operand" "rI")
(match_operand:SI 5 "reg_or_int5_operand" "rJ")))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"tst1 %3,%2 ; cmov %C1,%5,%z4,%0"
[(set_attr "length" "8")
(set_attr "cc" "clobber")])
(ashift:SI (match_operand:SI 2 "register_operand" "0")
(const_int 1))))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"cmp %4,%3 ; sasf %c1,%0"
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
(match_operand:SI 2 "const_int_operand" "")
(match_operand:SI 3 "const_int_operand" "")))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)
+ "(TARGET_V850E_UP)
&& ((INTVAL (operands[2]) ^ INTVAL (operands[3])) == 1)
&& ((INTVAL (operands[2]) + INTVAL (operands[3])) != 1)
&& (GET_CODE (operands[5]) == CONST_INT
(rotate:HI (match_operand:HI 1 "register_operand" "")
(match_operand:HI 2 "const_int_operand" "")))
(clobber (reg:CC CC_REGNUM))])]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
{
if (INTVAL (operands[2]) != 8)
FAIL;
(rotate:HI (match_operand:HI 1 "register_operand" "r")
(const_int 8)))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"bsh %1,%0"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
(rotate:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "const_int_operand" "")))
(clobber (reg:CC CC_REGNUM))])]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
{
if (INTVAL (operands[2]) != 16)
FAIL;
})
+(define_insn "rotlsi3_a"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (match_operator:SI 4 "ior_operator"
+ [(ashift:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "const_int_operand" "n"))
+ (lshiftrt:SI (match_dup 1)
+ (match_operand:SI 3 "const_int_operand" "n"))]))]
+ "TARGET_V850E3V5_UP && (INTVAL (operands[2]) + INTVAL (operands[3]) == 32)"
+ "rotl %2, %1, %0"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_zn")]
+)
+
+(define_insn "rotlsi3_b"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (match_operator:SI 4 "ior_operator"
+ [(lshiftrt:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 3 "const_int_operand" "n"))
+ (ashift:SI (match_dup 1)
+ (match_operand:SI 2 "const_int_operand" "n"))]))]
+ "TARGET_V850E3V5_UP && (INTVAL (operands[2]) + INTVAL (operands[3]) == 32)"
+ "rotl %2, %1, %0"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_zn")]
+)
+
+(define_insn "rotlsi3_v850e3v5"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (rotate:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "e3v5_shift_operand" "rn")))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_V850E3V5_UP"
+ "rotl %2, %1, %0"
+ [(set_attr "length" "4")
+ (set_attr "cc" "set_zn")]
+)
+
(define_insn "*rotlsi3_16"
[(set (match_operand:SI 0 "register_operand" "=r")
(rotate:SI (match_operand:SI 1 "register_operand" "r")
(const_int 16)))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"hsw %1,%0"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
;; JUMP INSTRUCTIONS
;; ----------------------------------------------------------------------
+;; Doloop
+
+(define_expand "doloop_begin"
+ [(use (match_operand 0 "" "")) ; loop pseudo
+ (use (match_operand 1 "" "")) ; iterations; zero if unknown
+ (use (match_operand 2 "" "")) ; max iterations
+ (use (match_operand 3 "" "")) ; loop level
+ (use (match_operand 4 "" ""))] ; condition
+ "TARGET_V850E3V5_UP && TARGET_LOOP"
+ {
+ rtx loop_cnt = operands[0];
+ rtx loop_level = operands[3];
+
+ if (INTVAL (loop_level) > 1)
+ FAIL;
+ if (GET_MODE (loop_cnt) != SImode)
+ FAIL;
+
+ emit_insn (gen_fix_loop_counter (loop_cnt));
+ DONE;
+ }
+)
+
+(define_insn "fix_loop_counter"
+ [(unspec:SI [(match_operand:SI 0 "register_operand" "+r,!m")
+ (clobber (match_scratch:SI 1 "=X,r"))] UNSPEC_LOOP)]
+ "TARGET_V850E3V5_UP && TARGET_LOOP"
+ {
+ switch (which_alternative)
+ {
+ case 0: return "add 1, %0 # LOOP_BEGIN";
+ case 1: return "ld.w %0, %1; add 1, %1; st.w %1, %0 # LOOP_BEGIN";
+ default: gcc_unreachable ();
+ }
+ }
+ [(set_attr "length" "2,6")
+ (set_attr "cc" "none")]
+)
+
+(define_expand "doloop_end"
+ [(use (match_operand 0 "" "")) ; loop pseudo
+ (use (match_operand 1 "" "")) ; iterations; zero if unknown
+ (use (match_operand 2 "" "")) ; max iterations
+ (use (match_operand 3 "" "")) ; loop level
+ (use (match_operand 4 "" "")) ; label
+ (use (match_operand 5 "" ""))] ; entered at top
+ "TARGET_V850E3V5_UP && TARGET_LOOP"
+ {
+ rtx loop_cnt = operands[0];
+ rtx loop_level = operands[3];
+ rtx label = operands[4];
+
+ if (INTVAL (loop_level) > 1)
+ FAIL;
+ if (GET_MODE (loop_cnt) != SImode)
+ FAIL;
+
+ emit_jump_insn (gen_doloop_end_internal_loop (label, loop_cnt));
+ DONE;
+ }
+)
+
+(define_insn "doloop_end_internal_loop"
+ [(set (pc)
+ (if_then_else (ne (match_operand:SI 1 "register_operand" "+r,!m")
+ (const_int 0))
+ (label_ref (match_operand 0 "" ""))
+ (pc)))
+ (set (match_dup 1) (plus:SI (match_dup 1) (const_int -1)))
+ (clobber (match_scratch:SI 2 "=X,r"))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_V850E3V5_UP && TARGET_LOOP"
+ {
+ switch (which_alternative)
+ {
+ case 0:
+ if (get_attr_length (insn) == 4)
+ return "loop %1, %0 # LOOP.1.0";
+
+ return "add -1, %1; bne %l0 # LOOP.1.1";
+ case 1:
+ return "ld.w %1, %2; add -1, %2; st.w %2, %1; bne %l0 # LOOP.2.1";
+ default:
+ gcc_unreachable ();
+ }
+ }
+ [(set (attr "length")
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65534))
+ (const_int 4)
+ (const_int 14)))
+ (set_attr "cc" "none")])
+
;; Conditional jump instructions
(define_insn "*branch_normal"
if (get_attr_length (insn) == 2)
return "b%b1 %l0";
- else
- return "b%B1 .+6 ; jr %l0";
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "b%b1 %l0";
+ return "b%B1 .+6 ; jr %l0";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
(define_insn "*branch_invert"
|| GET_CODE (operands[1]) == GE
|| GET_CODE (operands[1]) == LE
|| GET_CODE (operands[1]) == LT))
- return 0;
+ return NULL;
+
if (get_attr_length (insn) == 2)
return "b%B1 %l0";
- else
- return "b%b1 .+6 ; jr %l0";
+
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "b%B1 %l0";
+
+ return "b%b1 .+6 ; jr %l0";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
(define_insn "branch_z_normal"
(if_then_else (match_operand 1 "v850_float_z_comparison_operator" "")
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
{
if (get_attr_length (insn) == 2)
return "bz %l0";
- else
- return "bnz 1f ; jr %l0 ; 1:";
+
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "bz %l0";
+
+ return "bnz 1f ; jr %l0 ; 1:";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
(define_insn "*branch_z_invert"
(if_then_else (match_operand 1 "v850_float_z_comparison_operator" "")
(pc)
(label_ref (match_operand 0 "" ""))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
{
if (get_attr_length (insn) == 2)
return "bnz %l0";
- else
- return "bz 1f ; jr %l0 ; 1:";
+
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "bnz %l0";
+
+ return "bz 1f ; jr %l0 ; 1:";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
(define_insn "branch_nz_normal"
(if_then_else (match_operand 1 "v850_float_nz_comparison_operator" "")
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
{
if (get_attr_length (insn) == 2)
return "bnz %l0";
- else
- return "bz 1f ; jr %l0 ; 1:";
+
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "bnz %l0";
+
+ return "bz 1f ; jr %l0 ; 1:";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
(define_insn "*branch_nz_invert"
(if_then_else (match_operand 1 "v850_float_nz_comparison_operator" "")
(pc)
(label_ref (match_operand 0 "" ""))))]
- "TARGET_V850E2V3"
+ "TARGET_V850E2V3_UP"
{
if (get_attr_length (insn) == 2)
return "bz %l0";
- else
- return "bnz 1f ; jr %l0 ; 1:";
+
+ if (TARGET_V850E3V5_UP && get_attr_length (insn) == 4)
+ return "bz %l0";
+
+ return "bnz 1f ; jr %l0 ; 1:";
}
[(set (attr "length")
(if_then_else (lt (abs (minus (match_dup 0) (pc)))
(const_int 256))
(const_int 2)
- (const_int 6)))
+ (if_then_else (lt (abs (minus (match_dup 0) (pc)))
+ (const_int 65536))
+ (const_int 4)
+ (const_int 6))))
(set_attr "cc" "none")])
;; Unconditional and other jump instructions.
(const_int 1))
(label_ref (match_operand 1 "" "")))))
(label_ref (match_dup 1))))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"switch %0"
[(set_attr "length" "2")
(set_attr "cc" "none")])
(match_operand:SI 1 "general_operand" "g,g"))
(clobber (reg:SI 31))]
"! TARGET_LONG_CALLS"
- "@
- jarl %0,r31
- jarl .+4,r31 ; add 4,r31 ; jmp %0"
+ {
+ if (which_alternative == 1)
+ {
+ if (TARGET_V850E3V5_UP)
+ return "jarl [%0], r31";
+
+ return "jarl .+4, r31 ; add 4, r31 ; jmp %0";
+ }
+
+ return "jarl %0, r31";
+ }
[(set_attr "length" "4,8")
(set_attr "cc" "clobber,clobber")]
)
{
if (GET_CODE (operands[0]) == REG)
return "jarl %0,r31";
- else
- return "movhi hi(%0), r0, r11 ; movea lo(%0), r11, r11 ; jarl .+4,r31 ; add 4, r31 ; jmp r11";
+
+ if (TARGET_V850E3V5_UP)
+ return "mov hilo(%0), r11 ; jarl [r11], r31";
+
+ return "movhi hi(%0), r0, r11 ; movea lo(%0), r11, r11 ; jarl .+4,r31 ; add 4, r31 ; jmp r11";
}
- else
- return "jarl .+4,r31 ; add 4,r31 ; jmp %0";
+
+ if (TARGET_V850E3V5_UP)
+ return "jarl [%0], r31";
+
+ return "jarl .+4,r31 ; add 4,r31 ; jmp %0";
}
[(set_attr "length" "16,8")
(set_attr "cc" "clobber,clobber")]
(match_operand:SI 2 "general_operand" "g,g")))
(clobber (reg:SI 31))]
"! TARGET_LONG_CALLS"
- "@
- jarl %1,r31
- jarl .+4,r31 ; add 4,r31 ; jmp %1"
+ {
+ if (which_alternative == 1)
+ {
+ if (TARGET_V850E3V5_UP)
+ return "jarl [%1], r31";
+
+ return "jarl .+4, r31 ; add 4, r31 ; jmp %1";
+ }
+
+ return "jarl %1, r31";
+ }
[(set_attr "length" "4,8")
(set_attr "cc" "clobber,clobber")]
)
{
if (GET_CODE (operands[1]) == REG)
return "jarl %1, r31";
- else
+
/* Reload can generate this pattern.... */
- return "movhi hi(%1), r0, r11 ; movea lo(%1), r11, r11 ; jarl .+4, r31 ; add 4, r31 ; jmp r11";
+ if (TARGET_V850E3V5_UP)
+ return "mov hilo(%1), r11 ; jarl [r11], r31";
+
+ return "movhi hi(%1), r0, r11 ; movea lo(%1), r11, r11 ; jarl .+4, r31 ; add 4, r31 ; jmp r11";
}
- else
- return "jarl .+4, r31 ; add 4, r31 ; jmp %1";
+
+ if (TARGET_V850E3V5_UP)
+ return "jarl [%1], r31";
+
+ return "jarl .+4, r31 ; add 4, r31 ; jmp %1";
}
[(set_attr "length" "16,8")
(set_attr "cc" "clobber,clobber")]
(zero_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "0,r,T,m")))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"@
zxh %0
andi 65535,%1,%0
(clobber (reg:CC CC_REGNUM))])]
""
{
- if (! (TARGET_V850E || TARGET_V850E2_ALL))
+ if (! (TARGET_V850E_UP))
operands[1] = force_reg (HImode, operands[1]);
})
(zero_extend:SI
(match_operand:QI 1 "nonimmediate_operand" "0,r,T,m")))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"@
zxb %0
andi 255,%1,%0
(clobber (reg:CC CC_REGNUM))])]
""
{
- if (! (TARGET_V850E || TARGET_V850E2_ALL))
+ if (! (TARGET_V850E_UP))
operands[1] = force_reg (QImode, operands[1]);
})
[(set (match_operand:SI 0 "register_operand" "=r,r,r")
(sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "0,Q,m")))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"@
sxh %0
sld.h %1,%0
[(set (match_operand:SI 0 "register_operand" "=r,r,r")
(sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0,Q,m")))
(clobber (reg:CC CC_REGNUM))]
- "(TARGET_V850E || TARGET_V850E2_ALL)"
+ "(TARGET_V850E_UP)"
"@
sxb %0
sld.b %1,%0
(match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "nonmemory_operand" "r")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E2_ALL"
+ "TARGET_V850E2_UP"
"shl %2,%1,%0"
[(set_attr "length" "4")
(set_attr "cc" "set_znv")])
(match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "nonmemory_operand" "r")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E2_ALL"
+ "TARGET_V850E2_UP"
"shr %2,%1,%0"
[(set_attr "length" "4")
(set_attr "cc" "set_zn")])
(match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "nonmemory_operand" "r")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E2_ALL"
+ "TARGET_V850E2_UP"
"sar %2,%1,%0"
[(set_attr "length" "4")
(set_attr "cc" "set_zn")])
[(set (match_operand:SI 0 "register_operand" "=r")
(ffs:SI (match_operand:SI 1 "register_operand" "r")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E2_ALL"
+ "TARGET_V850E2_UP"
"sch1r %1,%0"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
(set (mem:SI (plus:SI (reg:SI 3)
(match_operand:SI 2 "immediate_operand" "i")))
(match_operand:SI 3 "register_is_ok_for_epilogue" "r"))])]
- "TARGET_PROLOG_FUNCTION && (TARGET_V850E || TARGET_V850E2_ALL)"
+ "TARGET_PROLOG_FUNCTION && (TARGET_V850E_UP)"
{
return construct_prepare_instruction (operands[0]);
}
(set (match_operand:SI 2 "register_is_ok_for_epilogue" "=r")
(mem:SI (plus:SI (reg:SI 3)
(match_operand:SI 3 "immediate_operand" "i"))))])]
- "TARGET_PROLOG_FUNCTION && (TARGET_V850E || TARGET_V850E2_ALL)"
+ "TARGET_PROLOG_FUNCTION && (TARGET_V850E_UP)"
{
return construct_dispose_instruction (operands[0]);
}
;; Initialize an interrupt function. Do not depend on TARGET_PROLOG_FUNCTION.
(define_insn "callt_save_interrupt"
[(unspec_volatile [(const_int 0)] 2)]
- "(TARGET_V850E || TARGET_V850E2_ALL) && !TARGET_DISABLE_CALLT"
+ "(TARGET_V850E_UP) && !TARGET_DISABLE_CALLT"
;; The CALLT instruction stores the next address of CALLT to CTPC register
;; without saving its previous value. So if the interrupt handler
;; or its caller could possibly execute the CALLT insn, save_interrupt
(define_insn "callt_return_interrupt"
[(unspec_volatile [(const_int 0)] 3)]
- "(TARGET_V850E || TARGET_V850E2_ALL) && !TARGET_DISABLE_CALLT"
+ "(TARGET_V850E_UP) && !TARGET_DISABLE_CALLT"
"callt ctoff(__callt_return_interrupt)"
[(set_attr "length" "2")
(set_attr "cc" "clobber")])
(define_insn "callt_save_all_interrupt"
[(unspec_volatile [(const_int 0)] 0)]
- "(TARGET_V850E || TARGET_V850E2_ALL) && !TARGET_DISABLE_CALLT"
+ "(TARGET_V850E_UP) && !TARGET_DISABLE_CALLT"
"callt ctoff(__callt_save_all_interrupt)"
[(set_attr "length" "2")
(set_attr "cc" "none")])
(define_insn "callt_restore_all_interrupt"
[(unspec_volatile [(const_int 0)] 1)]
- "(TARGET_V850E || TARGET_V850E2_ALL) && !TARGET_DISABLE_CALLT"
+ "(TARGET_V850E_UP) && !TARGET_DISABLE_CALLT"
"callt ctoff(__callt_restore_all_interrupt)"
[(set_attr "length" "2")
(set_attr "cc" "none")])