📄 v850.md
字号:
;; ??? The scheduling info is probably wrong.;; ??? This instruction can also generate the 32 bit highpart, but using it;; may increase code size counter to the desired result.;; ??? This instructions can also give a DImode result.;; ??? There is unsigned version, but it matters only for the DImode/highpart;; results.(define_insn "mulsi3" [(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" "mul %2,%1,%." [(set_attr "length" "4") (set_attr "cc" "none_0hit") (set_attr "type" "mult")]);; ----------------------------------------------------------------------;; DIVIDE INSTRUCTIONS;; ----------------------------------------------------------------------;; ??? These insns do set the Z/N condition codes, except that they are based;; on only one of the two results, so it doesn't seem to make sense to use;; them.;; ??? The scheduling info is probably wrong.(define_insn "divmodsi4" [(set (match_operand:SI 0 "register_operand" "=r") (div:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "register_operand" "r"))) (set (match_operand:SI 3 "register_operand" "=r") (mod:SI (match_dup 1) (match_dup 2)))] "TARGET_V850E" "div %2,%0,%3" [(set_attr "length" "4") (set_attr "cc" "clobber") (set_attr "type" "other")]) (define_insn "udivmodsi4" [(set (match_operand:SI 0 "register_operand" "=r") (udiv:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "register_operand" "r"))) (set (match_operand:SI 3 "register_operand" "=r") (umod:SI (match_dup 1) (match_dup 2)))] "TARGET_V850E" "divu %2,%0,%3" [(set_attr "length" "4") (set_attr "cc" "clobber") (set_attr "type" "other")]) ;; ??? There is a 2 byte instruction for generating only the quotient.;; However, it isn't clear how to compute the length field correctly.(define_insn "divmodhi4" [(set (match_operand:HI 0 "register_operand" "=r") (div:HI (match_operand:HI 1 "register_operand" "0") (match_operand:HI 2 "register_operand" "r"))) (set (match_operand:HI 3 "register_operand" "=r") (mod:HI (match_dup 1) (match_dup 2)))] "TARGET_V850E" "divh %2,%0,%3" [(set_attr "length" "4") (set_attr "cc" "clobber") (set_attr "type" "other")]);; Half-words are sign-extended by default, so we must zero extend to a word;; here before doing the divide.(define_insn "udivmodhi4" [(set (match_operand:HI 0 "register_operand" "=r") (udiv:HI (match_operand:HI 1 "register_operand" "0") (match_operand:HI 2 "register_operand" "r"))) (set (match_operand:HI 3 "register_operand" "=r") (umod:HI (match_dup 1) (match_dup 2)))] "TARGET_V850E" "zxh %0 ; divhu %2,%0,%3" [(set_attr "length" "4") (set_attr "cc" "clobber") (set_attr "type" "other")]);; ----------------------------------------------------------------------;; AND INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "*v850_clr1_1" [(set (match_operand:QI 0 "memory_operand" "=m") (subreg:QI (and:SI (subreg:SI (match_dup 0) 0) (match_operand:QI 1 "not_power_of_two_operand" "")) 0))] "" "*{ rtx xoperands[2]; xoperands[0] = operands[0]; xoperands[1] = GEN_INT (~INTVAL (operands[1]) & 0xff); output_asm_insn (\"clr1 %M1,%0\", xoperands); return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_clr1_2" [(set (match_operand:HI 0 "indirect_operand" "=m") (subreg:HI (and:SI (subreg:SI (match_dup 0) 0) (match_operand:HI 1 "not_power_of_two_operand" "")) 0))] "" "*{ int log2 = exact_log2 (~INTVAL (operands[1]) & 0xffff); rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"clr1 %1,%0\", xoperands); return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_clr1_3" [(set (match_operand:SI 0 "indirect_operand" "=m") (and:SI (match_dup 0) (match_operand:SI 1 "not_power_of_two_operand" "")))] "" "*{ int log2 = exact_log2 (~INTVAL (operands[1]) & 0xffffffff); rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"clr1 %1,%0\", xoperands); return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "andsi3" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (and:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "nonmemory_operand" "r,I,M")))] "" "@ and %2,%0 and %.,%0 andi %2,%1,%0" [(set_attr "length" "2,2,4") (set_attr "cc" "set_znv")]);; ----------------------------------------------------------------------;; OR INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "*v850_set1_1" [(set (match_operand:QI 0 "memory_operand" "=m") (subreg:QI (ior:SI (subreg:SI (match_dup 0) 0) (match_operand 1 "power_of_two_operand" "")) 0))] "" "set1 %M1,%0" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_set1_2" [(set (match_operand:HI 0 "indirect_operand" "=m") (subreg:HI (ior:SI (subreg:SI (match_dup 0) 0) (match_operand 1 "power_of_two_operand" "")) 0))] "" "*{ int log2 = exact_log2 (INTVAL (operands[1])); if (log2 < 8) return \"set1 %M1,%0\"; else { rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"set1 %1,%0\", xoperands); } return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_set1_3" [(set (match_operand:SI 0 "indirect_operand" "=m") (ior:SI (match_dup 0) (match_operand 1 "power_of_two_operand" "")))] "" "*{ int log2 = exact_log2 (INTVAL (operands[1])); if (log2 < 8) return \"set1 %M1,%0\"; else { rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"set1 %1,%0\", xoperands); } return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "iorsi3" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (ior:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "nonmemory_operand" "r,I,M")))] "" "@ or %2,%0 or %.,%0 ori %2,%1,%0" [(set_attr "length" "2,2,4") (set_attr "cc" "set_znv")]);; ----------------------------------------------------------------------;; XOR INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "*v850_not1_1" [(set (match_operand:QI 0 "memory_operand" "=m") (subreg:QI (xor:SI (subreg:SI (match_dup 0) 0) (match_operand 1 "power_of_two_operand" "")) 0))] "" "not1 %M1,%0" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_not1_2" [(set (match_operand:HI 0 "indirect_operand" "=m") (subreg:HI (xor:SI (subreg:SI (match_dup 0) 0) (match_operand 1 "power_of_two_operand" "")) 0))] "" "*{ int log2 = exact_log2 (INTVAL (operands[1])); if (log2 < 8) return \"not1 %M1,%0\"; else { rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"not1 %1,%0\", xoperands); } return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "*v850_not1_3" [(set (match_operand:SI 0 "indirect_operand" "=m") (xor:SI (match_dup 0) (match_operand 1 "power_of_two_operand" "")))] "" "*{ int log2 = exact_log2 (INTVAL (operands[1])); if (log2 < 8) return \"not1 %M1,%0\"; else { rtx xoperands[2]; xoperands[0] = gen_rtx_MEM (QImode, plus_constant (XEXP (operands[0], 0), log2 / 8)); xoperands[1] = GEN_INT (log2 % 8); output_asm_insn (\"not1 %1,%0\", xoperands); } return \"\";}" [(set_attr "length" "4") (set_attr "cc" "clobber")])(define_insn "xorsi3" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (xor:SI (match_operand:SI 1 "register_operand" "%0,0,r") (match_operand:SI 2 "nonmemory_operand" "r,I,M")))] "" "@ xor %2,%0 xor %.,%0 xori %2,%1,%0" [(set_attr "length" "2,2,4") (set_attr "cc" "set_znv")]);; ----------------------------------------------------------------------;; NOT INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "one_cmplsi2" [(set (match_operand:SI 0 "register_operand" "=r") (not:SI (match_operand:SI 1 "register_operand" "r")))] "" "not %1,%0" [(set_attr "length" "2") (set_attr "cc" "set_znv")]);; -----------------------------------------------------------------;; BIT FIELDS;; -----------------------------------------------------------------;; ??? Is it worth defining insv and extv for the V850 series?!?;; An insv pattern would be useful, but does not get used because;; store_bit_field never calls insv when storing a constant value into a;; single-bit bitfield.;; extv/extzv patterns would be useful, but do not get used because;; optimize_bitfield_compare in fold-const usually converts single;; bit extracts into an AND with a mask.;; -----------------------------------------------------------------;; Scc INSTRUCTIONS;; -----------------------------------------------------------------(define_insn "sle" [(set (match_operand:SI 0 "register_operand" "=r") (le:SI (cc0) (const_int 0)))] "" "*{ if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0) return 0; return \"setf le,%0\";}" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "sleu" [(set (match_operand:SI 0 "register_operand" "=r") (leu:SI (cc0) (const_int 0)))] "" "setf nh,%0" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "sge" [(set (match_operand:SI 0 "register_operand" "=r") (ge:SI (cc0) (const_int 0)))] "" "*{ if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0) return 0; return \"setf ge,%0\";}" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "sgeu" [(set (match_operand:SI 0 "register_operand" "=r") (geu:SI (cc0) (const_int 0)))] "" "setf nl,%0" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "slt" [(set (match_operand:SI 0 "register_operand" "=r") (lt:SI (cc0) (const_int 0)))] "" "*{ if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0) return 0; return \"setf lt,%0\";}" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "sltu" [(set (match_operand:SI 0 "register_operand" "=r") (ltu:SI (cc0) (const_int 0)))] "" "setf l,%0" [(set_attr "length" "4") (set_attr "cc" "none_0hit")])(define_insn "sgt"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -