📄 h8300.md
字号:
} return \"mov.l %S1,%S0\";}" [(set_attr "length" "2,2,10,10,10,4,4,2,6,4") (set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])(define_insn "movsf_h8300h" [(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,m,<,r") (match_operand:SF 1 "general_operand_src" "I,r,im,r,r,>"))] "(TARGET_H8300H || TARGET_H8300S) && (register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode))" "@ sub.l %S0,%S0 mov.l %S1,%S0 mov.l %S1,%S0 mov.l %S1,%S0 mov.l %S1,%S0 mov.l %S1,%S0" [(set_attr "length" "2,2,10,10,4,4") (set_attr "cc" "set_zn,set_znv,set_znv,set_znv,set_znv,set_znv")]);; ----------------------------------------------------------------------;; TEST INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "" [(set (cc0) (zero_extract:QI (match_operand:QI 0 "bit_memory_operand" "rU") (const_int 1) (match_operand:QI 1 "const_int_operand" "n")))] "" "btst %Z1,%R0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_insn "" [(set (cc0) (zero_extract:HI (match_operand:QI 0 "bit_memory_operand" "rU") (const_int 1) (match_operand:QI 1 "const_int_operand" "n")))] "" "btst %Z1,%Y0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_insn "" [(set (cc0) (zero_extract:SI (match_operand:QI 0 "bit_memory_operand" "rU") (const_int 1) (match_operand:QI 1 "const_int_operand" "n")))] "" "btst %Z1,%Y0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_insn "" [(set (cc0) (zero_extract:QI (match_operand:HI 0 "register_operand" "r") (const_int 1) (match_operand:HI 1 "const_int_operand" "n")))] "" "btst %Z1,%R0" [(set_attr "length" "2") (set_attr "cc" "set_zn")]) (define_insn "" [(set (cc0) (zero_extract:HI (match_operand:HI 0 "register_operand" "r") (const_int 1) (match_operand:HI 1 "const_int_operand" "n")))] "" "btst %Z1,%Y0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_insn "" [(set (cc0) (zero_extract:SI (match_operand:HI 0 "register_operand" "r") (const_int 1) (match_operand:HI 1 "const_int_operand" "n")))] "" "btst %Z1,%Y0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_insn "tstqi" [(set (cc0) (match_operand:QI 0 "register_operand" "r"))] "" "mov.b %X0,%X0" [(set_attr "length" "2") (set_attr "cc" "set_znv")])(define_insn "tsthi" [(set (cc0) (match_operand:HI 0 "register_operand" "r"))] "" "mov.w %T0,%T0" [(set_attr "length" "2") (set_attr "cc" "set_znv")])(define_insn "tstsi" [(set (cc0) (match_operand:SI 0 "register_operand" "r"))] "TARGET_H8300H || TARGET_H8300S" "mov.l %S0,%S0" [(set_attr "length" "2") (set_attr "cc" "set_znv")])(define_insn "cmpqi" [(set (cc0) (compare:QI (match_operand:QI 0 "register_operand" "r") (match_operand:QI 1 "nonmemory_operand" "rn")))] "" "cmp.b %X1,%X0" [(set_attr "length" "2") (set_attr "cc" "compare")])(define_expand "cmphi" [(set (cc0) (compare:HI (match_operand:HI 0 "register_operand" "") (match_operand:HI 1 "nonmemory_operand" "")))] "" "{ /* Force operand1 into a register if we're compiling for the h8/300. */ if (GET_CODE (operands[1]) != REG && TARGET_H8300) operands[1] = force_reg (HImode, operands[1]);}")(define_insn "" [(set (cc0) (compare:HI (match_operand:HI 0 "register_operand" "r") (match_operand:HI 1 "register_operand" "r")))] "TARGET_H8300" "cmp.w %T1,%T0" [(set_attr "length" "2") (set_attr "cc" "compare")])(define_insn "" [(set (cc0) (compare:HI (match_operand:HI 0 "register_operand" "r,r") (match_operand:HI 1 "nonmemory_operand" "r,n")))] "TARGET_H8300H || TARGET_H8300S" "cmp.w %T1,%T0" [(set_attr "length" "2,4") (set_attr "cc" "compare,compare")])(define_insn "cmpsi" [(set (cc0) (compare:SI (match_operand:SI 0 "register_operand" "r,r") (match_operand:SI 1 "nonmemory_operand" "r,i")))] "TARGET_H8300H || TARGET_H8300S" "cmp.l %S1,%S0" [(set_attr "length" "2,6") (set_attr "cc" "compare,compare")]);; ----------------------------------------------------------------------;; ADD INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "addqi3" [(set (match_operand:QI 0 "register_operand" "=r") (plus:QI (match_operand:QI 1 "register_operand" "%0") (match_operand:QI 2 "nonmemory_operand" "rn")))] "" "add.b %X2,%X0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_expand "addhi3" [(set (match_operand:HI 0 "register_operand" "") (plus:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "");; Specialized version using adds/subs. This must come before;; the more general patterns below.(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") (plus:HI (match_operand:HI 1 "register_operand" "%0") (match_operand:HI 2 "adds_subs_operand" "n")))] "" "* return output_adds_subs (operands);" [(set_attr "cc" "none_0hit") (set (attr "length") (if_then_else (ne (match_operand:HI 2 "one_insn_adds_subs_operand" "") (const_int 0)) (const_int 2) (const_int 4)))])(define_insn "" [(set (match_operand:HI 0 "register_operand" "=&r,r,&r") (plus:HI (match_operand:HI 1 "register_operand" "%0,0,g") (match_operand:HI 2 "nonmemory_operand" "n,r,r")))] "TARGET_H8300" "@ add.b %s2,%s0\;addx %t2,%t0 add.w %T2,%T0 mov.w %T1,%T0\;add.w %T2,%T0" [(set_attr "length" "4,2,6") (set_attr "cc" "clobber,set_zn,set_zn")])(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r,r") (plus:HI (match_operand:HI 1 "register_operand" "%0,0") (match_operand:HI 2 "nonmemory_operand" "n,r")))] "TARGET_H8300H || TARGET_H8300S" "@ add.w %T2,%T0 add.w %T2,%T0" [(set_attr "length" "4,2") (set_attr "cc" "set_zn,set_zn")])(define_expand "addsi3" [(set (match_operand:SI 0 "register_operand" "") (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "nonmemory_operand" "")))] "" "");; Specialized version using adds/subs. This must come before;; the more general patterns below.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (plus:SI (match_operand:SI 1 "register_operand" "%0") (match_operand:SI 2 "adds_subs_operand" "n")))] "TARGET_H8300H || TARGET_H8300S" "* return output_adds_subs (operands);" [(set_attr "cc" "none_0hit") (set (attr "length") (if_then_else (ne (match_operand:HI 2 "one_insn_adds_subs_operand" "") (const_int 0)) (const_int 2) (const_int 4)))])(define_insn "addsi_h8300" [(set (match_operand:SI 0 "register_operand" "=r,r,&r") (plus:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "nonmemory_operand" "n,r,r")))] "TARGET_H8300" "@ add %w2,%w0\;addx %x2,%x0\;addx %y2,%y0\;addx %z2,%z0 add.w %f2,%f0\;addx %y2,%y0\;addx %z2,%z0 mov.w %f1,%f0\;mov.w %e1,%e0\;add.w %f2,%f0\;addx %y2,%y0\;addx %z2,%z0" [(set_attr "length" "8,6,10") (set_attr "cc" "clobber")])(define_insn "addsi_h8300h" [(set (match_operand:SI 0 "register_operand" "=r,r") (plus:SI (match_operand:SI 1 "register_operand" "%0,0") (match_operand:SI 2 "nonmemory_operand" "i,r")))] "TARGET_H8300H || TARGET_H8300S" "@ add.l %S2,%S0 add.l %S2,%S0" [(set_attr "length" "6,2") (set_attr "cc" "set_zn,set_zn")]);; ----------------------------------------------------------------------;; SUBTRACT INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "subqi3" [(set (match_operand:QI 0 "register_operand" "=r,r") (minus:QI (match_operand:QI 1 "register_operand" "0,0") (match_operand:QI 2 "nonmemory_operand" "r,n")))] "" "@ sub.b %X2,%X0 add.b %G2,%X0" [(set_attr "length" "2") (set_attr "cc" "set_zn")])(define_expand "subhi3" [(set (match_operand:HI 0 "register_operand" "") (minus:HI (match_operand:HI 1 "general_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "");; Specialized version using adds/subs. This must come before;; the more general patterns below. This may not be needed;; due to instruction canonicalization.(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r") (minus:HI (match_operand:HI 1 "register_operand" "r") (match_operand:HI 2 "adds_subs_operand" "n")))] "" "*{ operands[2] = GEN_INT (-INTVAL (operands[2])); return output_adds_subs (operands);}" [(set_attr "cc" "none_0hit") (set (attr "length") (if_then_else (ne (match_operand:HI 2 "one_insn_adds_subs_operand" "") (const_int 0)) (const_int 2) (const_int 4)))])(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r,&r") (minus:HI (match_operand:HI 1 "general_operand" "0,0") (match_operand:HI 2 "nonmemory_operand" "r,n")))] "TARGET_H8300" "@ sub.w %T2,%T0 add.b %E2,%s0\;addx %F2,%t0" [(set_attr "length" "2,4") (set_attr "cc" "set_zn,clobber")])(define_insn "" [(set (match_operand:HI 0 "register_operand" "=r,&r") (minus:HI (match_operand:HI 1 "general_operand" "0,0") (match_operand:HI 2 "nonmemory_operand" "r,n")))] "TARGET_H8300H || TARGET_H8300S" "@ sub.w %T2,%T0 sub.w %T2,%T0" [(set_attr "length" "2,4") (set_attr "cc" "set_zn,set_zn")])(define_expand "subsi3" [(set (match_operand:SI 0 "register_operand" "") (minus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "nonmemory_operand" "")))] "" "")(define_insn "subsi3_h8300" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "register_operand" "r")))] "TARGET_H8300" "sub.w %f2,%f0\;subx %y2,%y0\;subx %z2,%z0" [(set_attr "length" "6") (set_attr "cc" "clobber")]);; Specialized version using adds/subs. This must come before;; the more general patterns below. This may not be needed;; due to instruction canonicalization.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (minus:SI (match_operand:SI 1 "general_operand" "0") (match_operand:SI 2 "adds_subs_operand" "n")))] "TARGET_H8300H || TARGET_H8300S" "*{ operands[2] = GEN_INT (-INTVAL (operands[2])); return output_adds_subs (operands);}" [(set_attr "cc" "none_0hit") (set (attr "length") (if_then_else (ne (match_operand:HI 2 "one_insn_adds_subs_operand" "") (const_int 0)) (const_int 2) (const_int 4)))])(define_insn "subsi3_h8300h" [(set (match_operand:SI 0 "register_operand" "=r,r") (minus:SI (match_operand:SI 1 "general_operand" "0,0") (match_operand:SI 2 "nonmemory_operand" "r,i")))] "TARGET_H8300H || TARGET_H8300S" "@ sub.l %S2,%S0 sub.l %S2,%S0" [(set_attr "length" "2,6") (set_attr "cc" "set_zn,set_zn")]);; ----------------------------------------------------------------------;; MULTIPLY INSTRUCTIONS;; ----------------------------------------------------------------------;; Note that the h8/300 can only handle umulqihi3.(define_insn "mulqihi3" [(set (match_operand:HI 0 "register_operand" "=r") (mult:HI (sign_extend:HI (match_operand:QI 1 "general_operand" "%0")) (sign_extend:HI (match_operand:QI 2 "register_operand" "r"))))] "TARGET_H8300H || TARGET_H8300S" "mulxs.b %X2,%T0" [(set_attr "length" "4") (set_attr "cc" "set_zn")])(define_insn "mulhisi3" [(set (match_operand:SI 0 "register_operand" "=r") (mult:SI (sign_extend:SI (match_operand:HI 1 "general_operand" "%0")) (sign_extend:SI (match_operand:HI 2 "register_operand" "r"))))] "TARGET_H8300H || TARGET_H8300S" "mulxs.w %T2,%S0" [(set_attr "length" "4") (set_attr "cc" "set_zn")])(define_insn "umulqihi3" [(set (match_operand:HI 0 "register_operand" "=r") (mult:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "%0")) (zero_extend:HI (match_operand:QI 2 "register_operand" "r"))))] "" "mulxu %X2,%T0" [(set_attr "length" "2") (set_attr "cc" "none_0hit")])(define_insn "umulhisi3" [(set (match_operand:SI 0 "register_operand" "=r") (mult:SI (zero_extend:SI (match_operand:HI 1 "general_operand" "%0")) (zero_extend:SI (match_operand:HI 2 "register_operand" "r"))))] "TARGET_H8300H || TARGET_H8300S" "mulxu.w %T2,%S0" [(set_attr "length" "2") (set_attr "cc" "none_0hit")]);; This is a "bridge" instruction. Combine can't cram enough insns;; together to crate a MAC instruction directly, but it can create;; this instruction, which then allows combine to create the real;; MAC insn.;;;; Unfortunately, if combine doesn't create a MAC instruction, this;; insn must generate reasonably correct code. Egad.(define_insn "" [(set (match_operand:SI 0 "register_operand" "=a") (mult:SI (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 1 "register_operand" "r")))) (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 2 "register_operand" "r"))))))] "TARGET_H8300S" "clrmac\;mac @%2+,@%1+" [(set_attr "length" "6") (set_attr "cc" "none_0hit")])(define_insn "" [(set (match_operand:SI 0 "register_operand" "=a") (plus (mult:SI (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 1 "register_operand" "r")))) (sign_extend:SI (mem:HI (post_inc:SI (match_operand:SI 2 "register_operand" "r"))))) (match_operand:SI 3 "register_operand" "0")))] "TARGET_H8300S" "mac @%2+,@%1+" [(set_attr "length" "4") (set_attr "cc" "none_0hit")]);; ----------------------------------------------------------------------;; DIVIDE INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "udivqi3"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -