(define_insn "*movsi_high"
[(set (match_operand:SI 0 "register_operand" "=r")
- (high:SI (match_operand 1 "" "")))]
+ (high:SI (match_operand 1 "immediate_operand" "i")))]
""
"movhi hi(%1),%.,%0"
[(set_attr "length" "4")
(mod:SI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E"
- "div %2,%0,%3"
+ "TARGET_V850E || TARGET_V850E2_ALL"
+ {
+ if (TARGET_V850E2_ALL)
+ return "divq %2,%0,%3";
+ else
+ return "div %2,%0,%3";
+ }
[(set_attr "length" "4")
(set_attr "cc" "clobber")
(set_attr "type" "div")])
(umod:SI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E"
- "divu %2,%0,%3"
+ "TARGET_V850E || TARGET_V850E2_ALL"
+ {
+ if (TARGET_V850E2_ALL)
+ return "divqu %2,%0,%3";
+ else
+ return "divu %2,%0,%3";
+ }
[(set_attr "length" "4")
(set_attr "cc" "clobber")
(set_attr "type" "div")])
(mod:HI (match_dup 1)
(match_dup 2)))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_V850E"
+ "TARGET_V850E || TARGET_V850E2_ALL"
"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_V850E || TARGET_V850E2_ALL"
"zxh %0 ; divhu %2,%0,%3"
[(set_attr "length" "4")
(set_attr "cc" "clobber")
;; EXTEND INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn ""
+(define_insn "*zero_extendhisi2_v850e"
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
(zero_extend:SI
(match_operand:HI 1 "nonimmediate_operand" "0,r,T,m")))
[(set_attr "length" "2,4,2,4")
(set_attr "cc" "none_0hit,set_zn,none_0hit,none_0hit")])
-(define_insn "zero_extendhisi2"
+(define_insn "*zero_extendhisi2_v850"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI
(match_operand:HI 1 "register_operand" "r")))
- (clobber (reg:CC CC_REGNUM))]
+ (clobber (reg:CC CC_REGNUM))] ;; A lie, but we have to match the expander
""
"andi 65535,%1,%0"
[(set_attr "length" "4")
(set_attr "cc" "set_zn")])
-(define_insn ""
+(define_expand "zero_extendhisi2"
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (zero_extend:SI
+ (match_operand:HI 1 "nonimmediate_operand")))
+ (clobber (reg:CC CC_REGNUM))])]
+ ""
+ {
+ if (! (TARGET_V850E || TARGET_V850E2_ALL))
+ operands[1] = force_reg (HImode, operands[1]);
+ }
+)
+
+(define_insn "*zero_extendqisi2_v850e"
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r")
(zero_extend:SI
(match_operand:QI 1 "nonimmediate_operand" "0,r,T,m")))
[(set_attr "length" "2,4,2,4")
(set_attr "cc" "none_0hit,set_zn,none_0hit,none_0hit")])
-(define_insn "zero_extendqisi2"
+(define_insn "*zero_extendqisi2_v850"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI
- (match_operand:QI 1 "register_operand" "r")))
- (clobber (reg:CC CC_REGNUM))]
+ (match_operand:QI 1 "register_operand" "r")))
+ (clobber (reg:CC CC_REGNUM))] ;; A lie, but we have to match the expander
""
"andi 255,%1,%0"
[(set_attr "length" "4")
(set_attr "cc" "set_zn")])
+(define_expand "zero_extendqisi2"
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (zero_extend:SI
+ (match_operand:QI 1 "nonimmediate_operand")))
+ (clobber (reg:CC CC_REGNUM))])]
+ ""
+ {
+ if (! (TARGET_V850E || TARGET_V850E2_ALL))
+ operands[1] = force_reg (QImode, operands[1]);
+ }
+)
+
;;- sign extension instructions
;; ??? The extendhisi2 pattern should not emit shifts for v850e?