📄 alpha.md
字号:
;; generate one.;; Floating-point operations. All the double-precision insns can extend;; from single, so indicate that. The exception are the ones that simply;; play with the sign bits; it's not clear what to do there.(define_insn "abssf2" [(set (match_operand:SF 0 "register_operand" "=f") (abs:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cpys $f31,%R1,%0" [(set_attr "type" "fpop")])(define_insn "absdf2" [(set (match_operand:DF 0 "register_operand" "=f") (abs:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cpys $f31,%R1,%0" [(set_attr "type" "fpop")])(define_insn "negsf2" [(set (match_operand:SF 0 "register_operand" "=f") (neg:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cpysn %1,%R1,%0" [(set_attr "type" "fpop")])(define_insn "negdf2" [(set (match_operand:DF 0 "register_operand" "=f") (neg:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cpysn %1,%R1,%0" [(set_attr "type" "fpop")])(define_insn "addsf3" [(set (match_operand:SF 0 "register_operand" "=f") (plus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG") (match_operand:SF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "adds %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "adddf3" [(set (match_operand:DF 0 "register_operand" "=f") (plus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG") (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "addt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (plus:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")) (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "addt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (plus:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")) (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "addt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "fix_truncdfdi2" [(set (match_operand:DI 0 "register_operand" "=f") (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cvttq %R1,%0" [(set_attr "type" "fpop")])(define_insn "fix_truncsfdi2" [(set (match_operand:DI 0 "register_operand" "=f") (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "cvttq %R1,%0" [(set_attr "type" "fpop")])(define_insn "floatdisf2" [(set (match_operand:SF 0 "register_operand" "=f") (float:SF (match_operand:DI 1 "register_operand" "f")))] "TARGET_FP" "cvtqs %1,%0" [(set_attr "type" "fpop")])(define_insn "floatdidf2" [(set (match_operand:DF 0 "register_operand" "=f") (float:DF (match_operand:DI 1 "register_operand" "f")))] "TARGET_FP" "cvtqt %1,%0" [(set_attr "type" "fpop")])(define_insn "extendsfdf2" [(set (match_operand:DF 0 "register_operand" "=f,f") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m")))] "TARGET_FP" "@ addt $f31,%1,%0 lds %0,%1" [(set_attr "type" "fpop,ld")])(define_insn "truncdfsf2" [(set (match_operand:SF 0 "register_operand" "=f") (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cvtts %R1,%0" [(set_attr "type" "fpop")])(define_insn "divsf3" [(set (match_operand:SF 0 "register_operand" "=f") (div:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG") (match_operand:SF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "divs %R1,%R2,%0" [(set_attr "type" "fdivs")])(define_insn "divdf3" [(set (match_operand:DF 0 "register_operand" "=f") (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG") (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "divt %R1,%R2,%0" [(set_attr "type" "fdivt")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG")) (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "divt %R1,%R2,%0" [(set_attr "type" "fdivt")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (div:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG") (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "divt %R1,%R2,%0" [(set_attr "type" "fdivt")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (div:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG")) (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "divt %R1,%R2,%0" [(set_attr "type" "fdivt")])(define_insn "mulsf3" [(set (match_operand:SF 0 "register_operand" "=f") (mult:SF (match_operand:SF 1 "reg_or_fp0_operand" "fG") (match_operand:SF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "muls %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "muldf3" [(set (match_operand:DF 0 "register_operand" "=f") (mult:DF (match_operand:DF 1 "reg_or_fp0_operand" "fG") (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "mult %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (mult:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG")) (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "mult %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (mult:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG")) (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "mult %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "subsf3" [(set (match_operand:SF 0 "register_operand" "=f") (minus:SF (match_operand:SF 1 "reg_or_fp0_operand" "%fG") (match_operand:SF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "subs %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "subdf3" [(set (match_operand:DF 0 "register_operand" "=f") (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG") (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "subt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")) (match_operand:DF 2 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "subt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (minus:DF (match_operand:DF 1 "reg_or_fp0_operand" "%fG") (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "subt %R1,%R2,%0" [(set_attr "type" "fpop")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "%fG")) (float_extend:DF (match_operand:SF 2 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "subt %R1,%R2,%0" [(set_attr "type" "fpop")]);; Next are all the integer comparisons, and conditional moves and branches;; and some of the related define_expand's and define_split's.(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (match_operator:DI 1 "alpha_comparison_operator" [(match_operand:DI 2 "reg_or_0_operand" "rJ") (match_operand:DI 3 "reg_or_8bit_operand" "rI")]))] "" "cmp%C1 %r2,%3,%0" [(set_attr "type" "icmp")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (match_operator 2 "signed_comparison_operator" [(match_operand:DI 3 "reg_or_0_operand" "rJ,rJ") (const_int 0)]) (match_operand:DI 1 "reg_or_8bit_operand" "rI,0") (match_operand:DI 4 "reg_or_8bit_operand" "0,rI")))] "" "@ cmov%C2 %r3,%1,%0 cmov%D2 %r3,%4,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (eq (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ") (const_int 1) (const_int 0)) (const_int 0)) (match_operand:DI 1 "reg_or_8bit_operand" "rI,0") (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))] "" "@ cmovlbc %r2,%1,%0 cmovlbs %r2,%3,%0")(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (ne (zero_extract:DI (match_operand:DI 2 "reg_or_0_operand" "rJ,rJ") (const_int 1) (const_int 0)) (const_int 0)) (match_operand:DI 1 "reg_or_8bit_operand" "rI,0") (match_operand:DI 3 "reg_or_8bit_operand" "0,rI")))] "" "@ cmovlbs %r2,%1,%0 cmovlbc %r2,%3,%0");; This form is added since combine thinks that an IF_THEN_ELSE with both;; arms constant is a single insn, so it won't try to form it if combine;; knows they are really two insns. This occurs in divides by powers;; of two.(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (if_then_else:DI (match_operator 2 "signed_comparison_operator" [(match_operand:DI 3 "reg_or_0_operand" "rJ") (const_int 0)]) (plus:DI (match_dup 0) (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_dup 0))) (clobber (match_scratch:DI 4 "=&r"))] "" "addq %0,%1,%4\;cmov%C2 %r3,%4,%0")(define_split [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operator 2 "signed_comparison_operator" [(match_operand:DI 3 "reg_or_0_operand" "") (const_int 0)]) (plus:DI (match_dup 0) (match_operand:DI 1 "reg_or_8bit_operand" "")) (match_dup 0))) (clobber (match_operand:DI 4 "register_operand" ""))] "" [(set (match_dup 4) (plus:DI (match_dup 0) (match_dup 1))) (set (match_dup 0) (if_then_else:DI (match_op_dup 2 [(match_dup 3) (const_int 0)]) (match_dup 4) (match_dup 0)))] "")(define_split [(parallel [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operator 1 "comparison_operator" [(zero_extract:DI (match_operand:DI 2 "register_operand" "") (const_int 1) (match_operand:DI 3 "const_int_operand" "")) (const_int 0)]) (match_operand:DI 4 "reg_or_8bit_operand" "") (match_operand:DI 5 "reg_or_8bit_operand" ""))) (clobber (match_operand:DI 6 "register_operand" ""))])] "INTVAL (operands[3]) != 0" [(set (match_dup 6) (lshiftrt:DI (match_dup 2) (match_dup 3))) (set (match_dup 0) (if_then_else:DI (match_op_dup 1 [(zero_extract:DI (match_dup 6) (const_int 1) (const_int 0)) (const_int 0)]) (match_dup 4) (match_dup 5)))] "");; For ABS, we have two choices, depending on whether the input and output;; registers are the same or not.(define_expand "absdi2" [(set (match_operand:DI 0 "register_operand" "") (abs:DI (match_operand:DI 1 "register_operand" "")))] "" "{ if (rtx_equal_p (operands[0], operands[1])) emit_insn (gen_absdi2_same (operands[0], gen_reg_rtx (DImode))); else emit_insn (gen_absdi2_diff (operands[0], operands[1])); DONE;}")(define_expand "absdi2_same" [(set (match_operand:DI 1 "register_operand" "") (neg:DI (match_operand:DI 0 "register_operand" ""))) (set (match_dup 0) (if_then_else:DI (ge (match_dup 0) (const_int 0)) (match_dup 0) (match_dup 1)))] "" "")(define_expand "absdi2_diff" [(set (match_operand:DI 0 "register_operand" "") (neg:DI (match_operand:DI 1 "register_operand" ""))) (set (match_dup 0) (if_then_else:DI (lt (match_dup 1) (const_int 0)) (match_dup 0) (match_dup 1)))] "" "")(define_split [(set (match_operand:DI 0 "register_operand" "") (abs:DI (match_dup 0))) (clobber (match_operand:DI 2 "register_operand" ""))] "" [(set (match_dup 1) (neg:DI (match_dup 0))) (set (match_dup 0) (if_then_else:DI (ge (match_dup 0) (const_int 0)) (match_dup 0) (match_dup 1)))] "")(define_split [(set (match_operand:DI 0 "register_operand" "") (abs:DI (match_operand:DI 1 "register_operand" "")))] "! rtx_equal_p (operands[0], operands[1])" [(set (match_dup 0) (neg:DI (match_dup 1))) (set (match_dup 0) (if_then_else:DI (lt (match_dup 1) (const_int 0)) (match_dup 0) (match_dup 1)))] "")(define_split [(set (match_operand:DI 0 "register_operand" "") (neg:DI (abs:DI (match_dup 0)))) (clobber (match_operand:DI 2 "register_operand" ""))] "" [(set (match_dup 1) (neg:DI (match_dup 0))) (set (match_dup 0) (if_then_else:DI (le (match_dup 0) (const_int 0)) (match_dup 0) (match_dup 1)))] "")(define_split [(set (match_operand:DI 0 "register_operand" "") (neg:DI (abs:DI (match_operand:DI 1 "register_operand" ""))))] "! rtx_equal_p (operands[0], operands[1])" [(set (match_dup 0) (neg:DI (match_dup 1))) (set (match_dup 0) (if_then_else:DI (gt (match_dup 1) (const_int 0)) (match_dup 0) (match_dup 1)))] "")(define_expand "smaxdi3" [(set (match_dup 3) (le:DI (match_operand:DI 1 "reg_or_0_operand" "") (match_operand:DI 2 "reg_or_8bit_operand" ""))) (set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (eq (match_dup 3) (const_int 0)) (match_dup 1) (match_dup 2)))] "" "{ operands[3] = gen_reg_rtx (DImode);}")(define_split [(set (match_operand:DI 0 "register_operand" "") (smax:DI (match_operand:DI 1 "reg_or_0_operand" "") (match_operand:DI 2 "reg_or_8bit_operand" "")))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -