📄 alpha.md
字号:
[(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (minus:SI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") (match_operand:SI 2 "const48_operand" "I")) (match_operand:SI 3 "reg_or_8bit_operand" "rI"))))] "" "s%2subl %r1,%3,%0" [(set_attr "type" "iaddlog")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (mult:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "const48_operand" "I")) (match_operand:DI 3 "reg_or_8bit_operand" "rI")))] "" "s%2subq %r1,%3,%0" [(set_attr "type" "iaddlog")])(define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "=r") (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") (match_operand:SI 2 "reg_or_0_operand" "rJ")))] "" "mull %r1,%r2,%0" [(set_attr "type" "imull")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (sign_extend:DI (mult:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") (match_operand:SI 2 "reg_or_0_operand" "rJ"))))] "" "mull %r1,%r2,%0" [(set_attr "type" "imull")])(define_insn "muldi3" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ") (match_operand:DI 2 "reg_or_0_operand" "rJ")))] "" "mulq %r1,%r2,%0" [(set_attr "type" "imulq")])(define_insn "umuldi3_highpart" [(set (match_operand:DI 0 "register_operand" "=r") (truncate:DI (lshiftrt:TI (mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand" "r")) (zero_extend:TI (match_operand:DI 2 "register_operand" "r"))) (const_int 64))))] "" "umulh %1,%2,%0" [(set_attr "type" "imulq")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (truncate:DI (lshiftrt:TI (mult:TI (zero_extend:TI (match_operand:DI 1 "register_operand" "r")) (match_operand:TI 2 "cint8_operand" "I")) (const_int 64))))] "" "umulh %1,%2,%0" [(set_attr "type" "imulq")]);; The divide and remainder operations always take their inputs from;; r24 and r25, put their output in r27, and clobber r23 and r28.(define_expand "divsi3" [(set (reg:SI 24) (match_operand:SI 1 "input_operand" "")) (set (reg:SI 25) (match_operand:SI 2 "input_operand" "")) (parallel [(set (reg:SI 27) (div:SI (reg:SI 24) (reg:SI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:SI 0 "general_operand" "") (reg:SI 27))] "" "")(define_expand "udivsi3" [(set (reg:SI 24) (match_operand:SI 1 "input_operand" "")) (set (reg:SI 25) (match_operand:SI 2 "input_operand" "")) (parallel [(set (reg:SI 27) (udiv:SI (reg:SI 24) (reg:SI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:SI 0 "general_operand" "") (reg:SI 27))] "" "")(define_expand "modsi3" [(set (reg:SI 24) (match_operand:SI 1 "input_operand" "")) (set (reg:SI 25) (match_operand:SI 2 "input_operand" "")) (parallel [(set (reg:SI 27) (mod:SI (reg:SI 24) (reg:SI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:SI 0 "general_operand" "") (reg:SI 27))] "" "")(define_expand "umodsi3" [(set (reg:SI 24) (match_operand:SI 1 "input_operand" "")) (set (reg:SI 25) (match_operand:SI 2 "input_operand" "")) (parallel [(set (reg:SI 27) (umod:SI (reg:SI 24) (reg:SI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:SI 0 "general_operand" "") (reg:SI 27))] "" "")(define_expand "divdi3" [(set (reg:DI 24) (match_operand:DI 1 "input_operand" "")) (set (reg:DI 25) (match_operand:DI 2 "input_operand" "")) (parallel [(set (reg:DI 27) (div:DI (reg:DI 24) (reg:DI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:DI 0 "general_operand" "") (reg:DI 27))] "" "")(define_expand "udivdi3" [(set (reg:DI 24) (match_operand:DI 1 "input_operand" "")) (set (reg:DI 25) (match_operand:DI 2 "input_operand" "")) (parallel [(set (reg:DI 27) (udiv:DI (reg:DI 24) (reg:DI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:DI 0 "general_operand" "") (reg:DI 27))] "" "")(define_expand "moddi3" [(set (reg:DI 24) (match_operand:DI 1 "input_operand" "")) (set (reg:DI 25) (match_operand:DI 2 "input_operand" "")) (parallel [(set (reg:DI 27) (mod:DI (reg:DI 24) (reg:DI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:DI 0 "general_operand" "") (reg:DI 27))] "" "")(define_expand "umoddi3" [(set (reg:DI 24) (match_operand:DI 1 "input_operand" "")) (set (reg:DI 25) (match_operand:DI 2 "input_operand" "")) (parallel [(set (reg:DI 27) (umod:DI (reg:DI 24) (reg:DI 25))) (clobber (reg:DI 23)) (clobber (reg:DI 28))]) (set (match_operand:DI 0 "general_operand" "") (reg:DI 27))] "" "")(define_insn "" [(set (reg:SI 27) (match_operator:SI 1 "divmod_operator" [(reg:SI 24) (reg:SI 25)])) (clobber (reg:DI 23)) (clobber (reg:DI 28))] "" "%E1 $24,$25,$27" [(set_attr "type" "isubr")])(define_insn "" [(set (reg:DI 27) (match_operator:DI 1 "divmod_operator" [(reg:DI 24) (reg:DI 25)])) (clobber (reg:DI 23)) (clobber (reg:DI 28))] "" "%E1 $24,$25,$27" [(set_attr "type" "isubr")]);; Next are the basic logical operations. These only exist in DImode.(define_insn "anddi3" [(set (match_operand:DI 0 "register_operand" "=r,r,r") (and:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ,rJ") (match_operand:DI 2 "and_operand" "rI,N,MH")))] "" "@ and %r1,%2,%0 bic %r1,%N2,%0 zapnot %r1,%m2,%0" [(set_attr "type" "iaddlog,iaddlog,shiftcm")]);; There are times when we can split and AND into two AND insns. This occurs;; when we can first clear any bytes and then clear anything else. For;; example "I & 0xffff07" is "(I & 0xffffff) & 0xffffffffffffff07".;; Only to this when running on 64-bit host since the computations are;; too messy otherwise.(define_split [(set (match_operand:DI 0 "register_operand" "") (and:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "const_int_operand" "")))] "HOST_BITS_PER_WIDE_INT == 64 && ! and_operand (operands[2], DImode)" [(set (match_dup 0) (and:DI (match_dup 1) (match_dup 3))) (set (match_dup 0) (and:DI (match_dup 0) (match_dup 4)))] "{ unsigned HOST_WIDE_INT mask1 = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask2 = mask1; int i; /* For each byte that isn't all zeros, make it all ones. */ for (i = 0; i < 64; i += 8) if ((mask1 & ((HOST_WIDE_INT) 0xff << i)) != 0) mask1 |= (HOST_WIDE_INT) 0xff << i; /* Now turn on any bits we've just turned off. */ mask2 |= ~ mask1; operands[3] = GEN_INT (mask1); operands[4] = GEN_INT (mask2);}")(define_insn "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "=r") (zero_extend:HI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendqisi2" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendqidi2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))] "" "zapnot %1,1,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "=r") (zero_extend:SI (match_operand:HI 1 "register_operand" "r")))] "" "zapnot %1,3,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendhidi2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))] "" "zapnot %1,3,%0" [(set_attr "type" "iaddlog")])(define_insn "zero_extendsidi2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))] "" "zapnot %1,15,%0" [(set_attr "type" "iaddlog")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_operand:DI 2 "reg_or_0_operand" "rJ")))] "" "bic %r2,%1,%0" [(set_attr "type" "iaddlog")])(define_insn "iordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:DI 2 "or_operand" "rI,N")))] "" "@ bis %r1,%2,%0 ornot %r1,%N2,%0" [(set_attr "type" "iaddlog")])(define_insn "one_cmpldi2" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))] "" "ornot $31,%1,%0" [(set_attr "type" "iaddlog")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (ior:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_operand:DI 2 "reg_or_0_operand" "rJ")))] "" "ornot %r2,%1,%0" [(set_attr "type" "iaddlog")])(define_insn "xordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") (match_operand:DI 2 "or_operand" "rI,N")))] "" "@ xor %r1,%2,%0 eqv %r1,%N2,%0" [(set_attr "type" "iaddlog")])(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_operand:DI 1 "register_operand" "%rJ") (match_operand:DI 2 "register_operand" "rI"))))] "" "eqv %r1,%2,%0" [(set_attr "type" "iaddlog")]);; Next come the shifts and the various extract and insert operations.(define_insn "ashldi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ,rJ") (match_operand:DI 2 "reg_or_6bit_operand" "P,rI")))] "" "*{ switch (which_alternative) { case 0: if (operands[2] == const1_rtx) return \"addq %r1,%r1,%0\"; else return \"s%P2addq %r1,0,%0\"; case 1: return \"sll %r1,%2,%0\"; }}" [(set_attr "type" "iaddlog,shiftcm")]);; ??? The following pattern is made by combine, but earlier phases;; (specifically flow) can't handle it. This occurs in jump.c. Deal;; with this in a better way at some point.;;(define_insn "";; [(set (match_operand:DI 0 "register_operand" "=r");; (sign_extend:DI;; (subreg:SI (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ");; (match_operand:DI 2 "const_int_operand" "P"));; 0)))];; "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 3";; "*;;{;; if (operands[2] == const1_rtx);; return \"addl %r1,%r1,%0\";;; else;; return \"s%P2addl %r1,0,%0\";;; }";; [(set_attr "type" "iaddlog")]) (define_insn "lshrdi3" [(set (match_operand:DI 0 "register_operand" "=r") (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_6bit_operand" "rI")))] "" "srl %r1,%2,%0")(define_insn "ashrdi3" [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ") (match_operand:DI 2 "reg_or_6bit_operand" "rI")))] "" "sra %r1,%2,%0")(define_expand "extendqihi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:HI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendqisi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendqidi2" [(set (match_dup 2) (ashift:DI (match_operand:QI 1 "register_operand" "") (const_int 56))) (set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 56)))] "" "{ operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")(define_expand "extendhisi2" [(set (match_dup 2) (ashift:DI (match_operand:HI 1 "register_operand" "") (const_int 48))) (set (match_operand:SI 0 "register_operand" "") (ashiftrt:DI (match_dup 2) (const_int 48)))] "" "{ operands[0] = gen_lowpart (DImode, operands[0]); operands[1] = gen_lowpart (DImode, operands[1]); operands[2] = gen_reg_rtx (DImode);}")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -