📄 vax.md
字号:
return \"addl2 %0,%0\"; if (GET_CODE (operands[1]) == REG && GET_CODE (operands[2]) == CONST_INT) { int i = INTVAL (operands[2]); if (i == 1) return \"addl3 %1,%1,%0\"; if (i == 2) return \"moval 0[%1],%0\"; if (i == 3) return \"movad 0[%1],%0\"; } return \"ashl %2,%1,%0\";}");; Arithmetic right shift on the vax works by negating the shift count.(define_expand "ashrdi3" [(set (match_operand:DI 0 "general_operand" "=g") (ashift:DI (match_operand:DI 1 "general_operand" "g") (match_operand:QI 2 "general_operand" "g")))] "" "{ operands[2] = negate_rtx (QImode, operands[2]);}")(define_insn "ashldi3" [(set (match_operand:DI 0 "general_operand" "=g") (ashift:DI (match_operand:DI 1 "general_operand" "g") (match_operand:QI 2 "general_operand" "g")))] "" "ashq %2,%1,%0");; Rotate right on the vax works by negating the shift count.(define_expand "rotrsi3" [(set (match_operand:SI 0 "general_operand" "=g") (rotate:SI (match_operand:SI 1 "general_operand" "g") (match_operand:QI 2 "general_operand" "g")))] "" "{ operands[2] = negate_rtx (QImode, operands[2]);}")(define_insn "rotlsi3" [(set (match_operand:SI 0 "general_operand" "=g") (rotate:SI (match_operand:SI 1 "general_operand" "g") (match_operand:QI 2 "general_operand" "g")))] "" "rotl %2,%1,%0");This insn is probably slower than a multiply and an add.;(define_insn ""; [(set (match_operand:SI 0 "general_operand" "=g"); (mult:SI (plus:SI (match_operand:SI 1 "general_operand" "g"); (match_operand:SI 2 "general_operand" "g")); (match_operand:SI 3 "general_operand" "g")))]; ""; "index %1,$0x80000000,$0x7fffffff,%3,%2,%0");; Special cases of bit-field insns which we should;; recognize in preference to the general case.;; These handle aligned 8-bit and 16-bit fields,;; which can usually be done with move instructions.(define_insn "" [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "+ro") (match_operand:SI 1 "immediate_operand" "i") (match_operand:SI 2 "immediate_operand" "i")) (match_operand:SI 3 "general_operand" "g"))] "GET_CODE (operands[1]) == CONST_INT && (INTVAL (operands[1]) == 8 || INTVAL (operands[1]) == 16) && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) % INTVAL (operands[1]) == 0 && (GET_CODE (operands[0]) == REG || ! mode_dependent_address_p (XEXP (operands[0], 0)))" "*{ if (REG_P (operands[0])) { if (INTVAL (operands[2]) != 0) return \"insv %3,%2,%1,%0\"; } else operands[0] = adj_offsettable_operand (operands[0], INTVAL (operands[2]) / 8); if (INTVAL (operands[1]) == 8) return \"movb %3,%0\"; return \"movw %3,%0\";}")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=&g") (zero_extract:SI (match_operand:SI 1 "general_operand" "ro") (match_operand:SI 2 "immediate_operand" "i") (match_operand:SI 3 "immediate_operand" "i")))] "GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) && GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 && (GET_CODE (operands[1]) == REG || ! mode_dependent_address_p (XEXP (operands[1], 0)))" "*{ if (REG_P (operands[1])) { if (INTVAL (operands[3]) != 0) return \"extzv %3,%2,%1,%0\"; } else operands[1] = adj_offsettable_operand (operands[1], INTVAL (operands[3]) / 8); if (INTVAL (operands[2]) == 8) return \"movzbl %1,%0\"; return \"movzwl %1,%0\";}")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=g") (sign_extract:SI (match_operand:SI 1 "general_operand" "ro") (match_operand:SI 2 "immediate_operand" "i") (match_operand:SI 3 "immediate_operand" "i")))] "GET_CODE (operands[2]) == CONST_INT && (INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16) && GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) % INTVAL (operands[2]) == 0 && (GET_CODE (operands[1]) == REG || ! mode_dependent_address_p (XEXP (operands[1], 0)))" "*{ if (REG_P (operands[1])) { if (INTVAL (operands[3]) != 0) return \"extv %3,%2,%1,%0\"; } else operands[1] = adj_offsettable_operand (operands[1], INTVAL (operands[3]) / 8); if (INTVAL (operands[2]) == 8) return \"cvtbl %1,%0\"; return \"cvtwl %1,%0\";}");; Register-only SImode cases of bit-field insns.(define_insn "" [(set (cc0) (compare (sign_extract:SI (match_operand:SI 0 "general_operand" "r") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g")))] "" "cmpv %2,%1,%0,%3")(define_insn "" [(set (cc0) (compare (zero_extract:SI (match_operand:SI 0 "general_operand" "r") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g")))] "" "cmpzv %2,%1,%0,%3")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=g") (sign_extract:SI (match_operand:SI 1 "general_operand" "r") (match_operand:SI 2 "general_operand" "g") (match_operand:SI 3 "general_operand" "g")))] "" "extv %3,%2,%1,%0")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=g") (zero_extract:SI (match_operand:SI 1 "general_operand" "r") (match_operand:SI 2 "general_operand" "g") (match_operand:SI 3 "general_operand" "g")))] "" "extzv %3,%2,%1,%0");; Non-register cases.;; nonimmediate_operand is used to make sure that mode-ambiguous cases;; don't match these (and therefore match the cases above instead).(define_insn "" [(set (cc0) (compare (sign_extract:SI (match_operand:QI 0 "nonimmediate_operand" "rm") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g")))] "" "cmpv %2,%1,%0,%3")(define_insn "" [(set (cc0) (compare (zero_extract:SI (match_operand:QI 0 "nonimmediate_operand" "rm") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g")))] "" "cmpzv %2,%1,%0,%3")(define_insn "extv" [(set (match_operand:SI 0 "general_operand" "=g") (sign_extract:SI (match_operand:QI 1 "nonimmediate_operand" "rm") (match_operand:SI 2 "general_operand" "g") (match_operand:SI 3 "general_operand" "g")))] "" "extv %3,%2,%1,%0")(define_insn "extzv" [(set (match_operand:SI 0 "general_operand" "=g") (zero_extract:SI (match_operand:QI 1 "nonimmediate_operand" "rm") (match_operand:SI 2 "general_operand" "g") (match_operand:SI 3 "general_operand" "g")))] "" "extzv %3,%2,%1,%0")(define_insn "insv" [(set (zero_extract:SI (match_operand:QI 0 "general_operand" "+g") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g"))] "" "insv %3,%2,%1,%0")(define_insn "" [(set (zero_extract:SI (match_operand:SI 0 "register_operand" "+r") (match_operand:SI 1 "general_operand" "g") (match_operand:SI 2 "general_operand" "g")) (match_operand:SI 3 "general_operand" "g"))] "" "insv %3,%2,%1,%0")(define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" "jbr %l0")(define_insn "beq" [(set (pc) (if_then_else (eq (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jeql %l0")(define_insn "bne" [(set (pc) (if_then_else (ne (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jneq %l0")(define_insn "bgt" [(set (pc) (if_then_else (gt (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jgtr %l0")(define_insn "bgtu" [(set (pc) (if_then_else (gtu (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jgtru %l0")(define_insn "blt" [(set (pc) (if_then_else (lt (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jlss %l0")(define_insn "bltu" [(set (pc) (if_then_else (ltu (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jlssu %l0")(define_insn "bge" [(set (pc) (if_then_else (ge (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jgeq %l0")(define_insn "bgeu" [(set (pc) (if_then_else (geu (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jgequ %l0")(define_insn "ble" [(set (pc) (if_then_else (le (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jleq %l0")(define_insn "bleu" [(set (pc) (if_then_else (leu (cc0) (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" "jlequ %l0")(define_insn "" [(set (pc) (if_then_else (eq (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jneq %l0")(define_insn "" [(set (pc) (if_then_else (ne (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jeql %l0")(define_insn "" [(set (pc) (if_then_else (gt (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jleq %l0")(define_insn "" [(set (pc) (if_then_else (gtu (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jlequ %l0")(define_insn "" [(set (pc) (if_then_else (lt (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jgeq %l0")(define_insn "" [(set (pc) (if_then_else (ltu (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jgequ %l0")(define_insn "" [(set (pc) (if_then_else (ge (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jlss %l0")(define_insn "" [(set (pc) (if_then_else (geu (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jlssu %l0")(define_insn "" [(set (pc) (if_then_else (le (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jgtr %l0")(define_insn "" [(set (pc) (if_then_else (leu (cc0) (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" "jgtru %l0");; Recognize jlbs and jlbc insns.;; These come before the jbc and jbs recognizers so these will be preferred.(define_insn "" [(set (pc) (if_then_else (ne (and:SI (match_operand:SI 0 "general_operand" "g") (const_int 1)) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbs %0,%l1")(define_insn "" [(set (pc) (if_then_else (eq (and:SI (match_operand:SI 0 "general_operand" "g") (const_int 1)) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbc %0,%l1")(define_insn "" [(set (pc) (if_then_else (ne (and:SI (match_operand:SI 0 "general_operand" "g") (const_int 1)) (const_int 0)) (pc) (label_ref (match_operand 1 "" ""))))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbc %0,%l1")(define_insn "" [(set (pc) (if_then_else (eq (and:SI (match_operand:SI 0 "general_operand" "g") (const_int 1)) (const_int 0)) (pc) (label_ref (match_operand 1 "" ""))))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbs %0,%l1");; These four entries allow a jlbc or jlbs to be made;; by combination with a bic.(define_insn "" [(set (pc) (if_then_else (ne (and:SI (match_operand:SI 0 "general_operand" "g") (not:SI (const_int -2))) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbs %0,%l1")(define_insn "" [(set (pc) (if_then_else (eq (and:SI (match_operand:SI 0 "general_operand" "g") (not:SI (const_int -2))) (const_int 0)) (label_ref (match_operand 1 "" "")) (pc)))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbc %0,%l1")(define_insn "" [(set (pc) (if_then_else (ne (and:SI (match_operand:SI 0 "general_operand" "g") (not:SI (const_int -2))) (const_int 0)) (pc) (label_ref (match_operand 1 "" ""))))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbc %0,%l1")(define_insn "" [(set (pc) (if_then_else (eq (and:SI (match_operand:SI 0 "general_operand" "g") (not:SI (const_int -2))) (const_int 0)) (pc) (label_ref (match_operand 1 "" ""))))] "GET_CODE (operands[0]) != MEM || ! mode_dependent_address_p (XEXP (operands[0], 0))" "jlbs %0,%l1");; Recognize jbs and jbc instructions.(define_insn "" [(set (pc) (if_then_else (ne (sign_extract:SI (match_operand:QI 0 "general_operand" "g") (const_int 1) (match_operand:SI 1 "general_operand" "g")) (const_int 0)) (label_ref (match_operand 2 "" "")) (pc)))] "" "jbs %1,%0,%l2")(define_insn ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -