📄 alpha.md
字号:
"insbl %1,%2,%0" [(set_attr "type" "shift")])(define_insn "inswl" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:HI 1 "register_operand" "r")) (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "inswl %1,%2,%0" [(set_attr "type" "shift")])(define_insn "insll" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "insll %1,%2,%0" [(set_attr "type" "shift")])(define_insn "insql" [(set (match_operand:DI 0 "register_operand" "=r") (ashift:DI (match_operand:DI 1 "register_operand" "r") (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI") (const_int 3))))] "" "insql %1,%2,%0" [(set_attr "type" "shift")]);; Combine has this sometimes habit of moving the and outside of the;; shift, making life more interesting.(define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (ashift:DI (match_operand:DI 1 "register_operand" "r") (match_operand:DI 2 "mul8_operand" "I")) (match_operand:DI 3 "immediate_operand" "i")))] "HOST_BITS_PER_WIDE_INT == 64 && GET_CODE (operands[3]) == CONST_INT && (((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) || ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) || ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])))" "*{#if HOST_BITS_PER_WIDE_INT == 64 if ((unsigned HOST_WIDE_INT) 0xff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) return \"insbl %1,%s2,%0\"; if ((unsigned HOST_WIDE_INT) 0xffff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) return \"inswl %1,%s2,%0\"; if ((unsigned HOST_WIDE_INT) 0xffffffff << INTVAL (operands[2]) == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) return \"insll %1,%s2,%0\";#endif abort();}" [(set_attr "type" "shift")]);; We do not include the insXh insns because they are complex to express;; and it does not appear that we would ever want to generate them.;;;; Since we need them for block moves, though, cop out and use unspec.(define_insn "insxh" [(set (match_operand:DI 0 "register_operand" "=r") (unspec [(match_operand:DI 1 "register_operand" "r") (match_operand:DI 2 "mode_width_operand" "n") (match_operand:DI 3 "reg_or_8bit_operand" "rI")] 2))] "" "ins%M2h %1,%3,%0" [(set_attr "type" "shift")])(define_insn "mskxl" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (not:DI (ashift:DI (match_operand:DI 2 "mode_mask_operand" "n") (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI") (const_int 3)))) (match_operand:DI 1 "reg_or_0_operand" "rJ")))] "" "msk%U2l %r1,%3,%0" [(set_attr "type" "shift")]);; We do not include the mskXh insns because it does not appear we would;; ever generate one.;;;; Again, we do for block moves and we use unspec again.(define_insn "mskxh" [(set (match_operand:DI 0 "register_operand" "=r") (unspec [(match_operand:DI 1 "register_operand" "r") (match_operand:DI 2 "mode_width_operand" "n") (match_operand:DI 3 "reg_or_8bit_operand" "rI")] 3))] "" "msk%M2h %1,%3,%0" [(set_attr "type" "shift")]);; 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" "fcpys")])(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" "fcpys")])(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 %R1,%R1,%0" [(set_attr "type" "fadd")])(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 %R1,%R1,%0" [(set_attr "type" "fadd")])(define_insn "" [(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 && alpha_tp == ALPHA_TP_INSN" "add%,%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(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" "add%,%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(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 && alpha_tp == ALPHA_TP_INSN" "add%-%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(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" "add%-%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(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 && alpha_tp != ALPHA_TP_INSN" "add%-%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(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 && alpha_tp != ALPHA_TP_INSN" "add%-%)%& %R1,%R2,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")]);; Define conversion operators between DFmode and SImode, using the cvtql;; instruction. To allow combine et al to do useful things, we keep the;; operation as a unit until after reload, at which point we split the;; instructions.;;;; Note that we (attempt to) only consider this optimization when the;; ultimate destination is memory. If we will be doing further integer;; processing, it is cheaper to do the truncation in the int regs.(define_insn "*cvtql" [(set (match_operand:SI 0 "register_operand" "=f") (unspec:SI [(match_operand:DI 1 "reg_or_fp0_operand" "fG")] 5))] "TARGET_FP" "cvtql%` %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_split [(set (match_operand:SI 0 "memory_operand" "") (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "")) 0)) (clobber (match_scratch:DI 2 "")) (clobber (match_scratch:SI 3 ""))] "TARGET_FP && reload_completed" [(set (match_dup 2) (fix:DI (match_dup 1))) (set (match_dup 3) (unspec:SI [(match_dup 2)] 5)) (set (match_dup 0) (match_dup 3))] "")(define_split [(set (match_operand:SI 0 "memory_operand" "") (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "")) 0)) (clobber (match_scratch:DI 2 ""))] "TARGET_FP && reload_completed" [(set (match_dup 2) (fix:DI (match_dup 1))) (set (match_dup 3) (unspec:SI [(match_dup 2)] 5)) (set (match_dup 0) (match_dup 3))] ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG. "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));")(define_insn "" [(set (match_operand:SI 0 "memory_operand" "=m") (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0)) (clobber (match_scratch:DI 2 "=&f")) (clobber (match_scratch:SI 3 "=&f"))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "#" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:SI 0 "memory_operand" "=m") (subreg:SI (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")) 0)) (clobber (match_scratch:DI 2 "=f"))] "TARGET_FP && alpha_tp != ALPHA_TP_INSN" "#" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:DI 0 "reg_no_subreg_operand" "=&f") (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvt%-q%(c %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "fix_truncdfdi2" [(set (match_operand:DI 0 "reg_no_subreg_operand" "=f") (fix:DI (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP" "cvt%-q%(c %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")]);; Likewise between SFmode and SImode.(define_split [(set (match_operand:SI 0 "memory_operand" "") (subreg:SI (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))) 0)) (clobber (match_scratch:DI 2 "")) (clobber (match_scratch:SI 3 ""))] "TARGET_FP && reload_completed" [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1)))) (set (match_dup 3) (unspec:SI [(match_dup 2)] 5)) (set (match_dup 0) (match_dup 3))] "")(define_split [(set (match_operand:SI 0 "memory_operand" "") (subreg:SI (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" ""))) 0)) (clobber (match_scratch:DI 2 ""))] "TARGET_FP && reload_completed" [(set (match_dup 2) (fix:DI (float_extend:DF (match_dup 1)))) (set (match_dup 3) (unspec:SI [(match_dup 2)] 5)) (set (match_dup 0) (match_dup 3))] ;; Due to REG_CANNOT_CHANGE_SIZE issues, we cannot simply use SUBREG. "operands[3] = gen_rtx_REG (SImode, REGNO (operands[2]));")(define_insn "" [(set (match_operand:SI 0 "memory_operand" "=m") (subreg:SI (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0)) (clobber (match_scratch:DI 2 "=&f")) (clobber (match_scratch:SI 3 "=&f"))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "#" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:SI 0 "memory_operand" "=m") (subreg:SI (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))) 0)) (clobber (match_scratch:DI 2 "=f"))] "TARGET_FP && alpha_tp != ALPHA_TP_INSN" "#" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:DI 0 "reg_no_subreg_operand" "=&f") (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvt%-q%(c %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "fix_truncsfdi2" [(set (match_operand:DI 0 "reg_no_subreg_operand" "=f") (fix:DI (float_extend:DF (match_operand:SF 1 "reg_or_fp0_operand" "fG"))))] "TARGET_FP" "cvt%-q%(c %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:SF 0 "register_operand" "=&f") (float:SF (match_operand:DI 1 "reg_no_subreg_operand" "f")))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvtq%,%+%& %1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "floatdisf2" [(set (match_operand:SF 0 "register_operand" "=f") (float:SF (match_operand:DI 1 "reg_no_subreg_operand" "f")))] "TARGET_FP" "cvtq%,%+%& %1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:DF 0 "register_operand" "=&f") (float:DF (match_operand:DI 1 "reg_no_subreg_operand" "f")))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvtq%-%+%& %1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "floatdidf2" [(set (match_operand:DF 0 "register_operand" "=f") (float:DF (match_operand:DI 1 "reg_no_subreg_operand" "f")))] "TARGET_FP" "cvtq%-%+%& %1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_expand "extendsfdf2" [(use (match_operand:DF 0 "register_operand" "")) (use (match_operand:SF 1 "nonimmediate_operand" ""))] "TARGET_FP""{ if (alpha_tp == ALPHA_TP_INSN) emit_insn (gen_extendsfdf2_tp (operands[0], force_reg (SFmode, operands[1]))); else emit_insn (gen_extendsfdf2_no_tp (operands[0], operands[1])); DONE;}");; FIXME(define_insn "extendsfdf2_tp" [(set (match_operand:DF 0 "register_operand" "=&f") (float_extend:DF (match_operand:SF 1 "register_operand" "f")))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvtsts %1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "extendsfdf2_no_tp" [(set (match_operand:DF 0 "register_operand" "=f,f,m") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,m,f")))] "TARGET_FP && alpha_tp != ALPHA_TP_INSN" "@ fmov %1,%0 ld%, %0,%1 st%- %1,%0" [(set_attr "type" "fcpys,fld,fst") (set_attr "trap" "yes")])(define_insn "" [(set (match_operand:SF 0 "register_operand" "=&f") (float_truncate:SF (match_operand:DF 1 "reg_or_fp0_operand" "fG")))] "TARGET_FP && alpha_tp == ALPHA_TP_INSN" "cvt%-%,%)%& %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(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" "cvt%-%,%)%& %R1,%0" [(set_attr "type" "fadd") (set_attr "trap" "yes")])(define_insn "" [(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 && alpha_tp == ALPHA_TP_INSN" "div%,%)%& %R1,%R2,%0" [(set_attr "type" "fdiv") (set_attr "opsize" "si") (set_attr "trap" "yes")])(define_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -