📄 rs6000.md
字号:
(define_expand "udivmodsi4" [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "") (udiv:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "reg_or_cint_operand" ""))) (set (match_operand:SI 3 "gpc_reg_operand" "") (umod:SI (match_dup 1) (match_dup 2)))])] "" "{ rtx label = 0; if (! TARGET_POWER) { if (! TARGET_POWERPC) { emit_move_insn (gen_rtx_REG (SImode, 3), operands[1]); emit_move_insn (gen_rtx_REG (SImode, 4), operands[2]); emit_insn (gen_divus_call ()); emit_move_insn (operands[0], gen_rtx_REG (SImode, 3)); emit_move_insn (operands[3], gen_rtx_REG (SImode, 4)); DONE; } else FAIL; } if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 0) { operands[2] = force_reg (SImode, operands[2]); label = gen_label_rtx (); emit (gen_udivmodsi4_tests (operands[0], operands[1], operands[2], operands[3], label)); } else operands[2] = force_reg (SImode, operands[2]); emit (gen_udivmodsi4_normal (operands[0], operands[1], operands[2], operands[3])); if (label) emit_label (label); DONE;}");; AIX architecture-independent common-mode multiply (DImode),;; divide/modulus, and quotient subroutine calls. Input operands in R3 and;; R4; results in R3 and sometimes R4; link register always clobbered by bla;; instruction; R0 sometimes clobbered; also, MQ sometimes clobbered but;; assumed unused if generating common-mode, so ignore.(define_insn "mulh_call" [(set (reg:SI 3) (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (reg:SI 3)) (sign_extend:DI (reg:SI 4))) (const_int 32)))) (clobber (match_scratch:SI 0 "=l"))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __mulh" [(set_attr "type" "imul")])(define_insn "mull_call" [(set (reg:DI 3) (mult:DI (sign_extend:DI (reg:SI 3)) (sign_extend:DI (reg:SI 4)))) (clobber (match_scratch:SI 0 "=l")) (clobber (reg:SI 0))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __mull" [(set_attr "type" "imul")])(define_insn "divss_call" [(set (reg:SI 3) (div:SI (reg:SI 3) (reg:SI 4))) (set (reg:SI 4) (mod:SI (reg:SI 3) (reg:SI 4))) (clobber (match_scratch:SI 0 "=l")) (clobber (reg:SI 0))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __divss" [(set_attr "type" "idiv")])(define_insn "divus_call" [(set (reg:SI 3) (udiv:SI (reg:SI 3) (reg:SI 4))) (set (reg:SI 4) (umod:SI (reg:SI 3) (reg:SI 4))) (clobber (match_scratch:SI 0 "=l")) (clobber (reg:SI 0)) (clobber (match_scratch:CC 1 "=x")) (clobber (reg:CC 69))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __divus" [(set_attr "type" "idiv")])(define_insn "quoss_call" [(set (reg:SI 3) (div:SI (reg:SI 3) (reg:SI 4))) (clobber (match_scratch:SI 0 "=l"))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __quoss" [(set_attr "type" "idiv")])(define_insn "quous_call" [(set (reg:SI 3) (udiv:SI (reg:SI 3) (reg:SI 4))) (clobber (match_scratch:SI 0 "=l")) (clobber (reg:SI 0)) (clobber (match_scratch:CC 1 "=x")) (clobber (reg:CC 69))] "! TARGET_POWER && ! TARGET_POWERPC" "bla __quous" [(set_attr "type" "idiv")]);; Logical instructions(define_insn "andsi3" [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") (match_operand:SI 2 "and_operand" "?r,T,K,J"))) (clobber (match_scratch:CC 3 "=X,X,x,x"))] "" "@ and %0,%1,%2 {rlinm|rlwinm} %0,%1,0,%m2,%M2 {andil.|andi.} %0,%1,%b2 {andiu.|andis.} %0,%1,%u2" [(set_attr "length" "4")]);; Note to set cr's other than cr0 we do the and immediate and then;; the test again -- this avoids a mcrf which on the higher end;; machines causes an execution serialization(define_insn "*andsi3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y") (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r") (match_operand:SI 2 "and_operand" "r,K,J,T,r,K,J,T")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r")) (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))] "! TARGET_POWERPC64" "@ and. %3,%1,%2 {andil.|andi.} %3,%1,%b2 {andiu.|andis.} %3,%1,%u2 {rlinm.|rlwinm.} %3,%1,0,%m2,%M2 # # # #" [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare") (set_attr "length" "4,4,4,4,8,8,8,8")])(define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "and_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 "")) (clobber (match_scratch:CC 4 ""))] "! TARGET_POWERPC64 && reload_completed" [(parallel [(set (match_dup 3) (and:SI (match_dup 1) (match_dup 2))) (clobber (match_dup 4))]) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] "")(define_insn "*andsi3_internal3" [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,x,x,?y,??y,??y,?y") (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r,r,r,r,r") (match_operand:SI 2 "and_operand" "r,K,J,T,r,K,J,T")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r,r,r,r,r") (and:SI (match_dup 1) (match_dup 2))) (clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))] "! TARGET_POWERPC64" "@ and. %0,%1,%2 {andil.|andi.} %0,%1,%b2 {andiu.|andis.} %0,%1,%u2 {rlinm.|rlwinm.} %0,%1,0,%m2,%M2 # # # #" [(set_attr "type" "compare,compare,compare,delayed_compare,compare,compare,compare,compare") (set_attr "length" "4,4,4,4,8,8,8,8")])(define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC (and:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "and_operand" "")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (and:SI (match_dup 1) (match_dup 2))) (clobber (match_scratch:CC 4 ""))] "! TARGET_POWERPC64 && reload_completed" [(parallel [(set (match_dup 0) (and:SI (match_dup 1) (match_dup 2))) (clobber (match_dup 4))]) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "")(define_expand "iorsi3" [(set (match_operand:SI 0 "gpc_reg_operand" "") (ior:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "reg_or_cint_operand" "")))] "" "{ if (GET_CODE (operands[2]) == CONST_INT && ! logical_operand (operands[2], SImode)) { HOST_WIDE_INT value = INTVAL (operands[2]); rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) ? operands[0] : gen_reg_rtx (SImode)); emit_insn (gen_iorsi3 (tmp, operands[1], GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff)))); emit_insn (gen_iorsi3 (operands[0], tmp, GEN_INT (value & 0xffff))); DONE; }}")(define_insn "*iorsi3_internal1" [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r") (ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r") (match_operand:SI 2 "logical_operand" "r,K,J")))] "" "@ or %0,%1,%2 {oril|ori} %0,%1,%b2 {oriu|oris} %0,%1,%u2" [(set_attr "length" "4,4,4")])(define_insn "*iorsi3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r") (match_operand:SI 2 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] "! TARGET_POWERPC64" "@ or. %3,%1,%2 #" [(set_attr "type" "compare") (set_attr "length" "4,8")])(define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") (compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] "! TARGET_POWERPC64 && reload_completed" [(set (match_dup 3) (ior:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] "")(define_insn "*iorsi3_internal3" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") (compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r") (match_operand:SI 2 "gpc_reg_operand" "r,r")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (ior:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWERPC64" "@ or. %0,%1,%2 #" [(set_attr "type" "compare") (set_attr "length" "4,8")])(define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC (ior:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "gpc_reg_operand" "")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (ior:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWERPC64 && reload_completed" [(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "");; Split an IOR that we can't do in one insn into two insns, each of which;; does one 16-bit part. This is used by combine.(define_split [(set (match_operand:SI 0 "gpc_reg_operand" "") (ior:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "non_logical_cint_operand" "")))] "" [(set (match_dup 0) (ior:SI (match_dup 1) (match_dup 3))) (set (match_dup 0) (ior:SI (match_dup 0) (match_dup 4)))]"{ operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff)); operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);}")(define_expand "xorsi3" [(set (match_operand:SI 0 "gpc_reg_operand" "") (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "reg_or_cint_operand" "")))] "" "{ if (GET_CODE (operands[2]) == CONST_INT && ! logical_operand (operands[2], SImode)) { HOST_WIDE_INT value = INTVAL (operands[2]); rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) ? operands[0] : gen_reg_rtx (SImode)); emit_insn (gen_xorsi3 (tmp, operands[1], GEN_INT (value & (~ (HOST_WIDE_INT) 0xffff)))); emit_insn (gen_xorsi3 (operands[0], tmp, GEN_INT (value & 0xffff))); DONE; }}")(define_insn "*xorsi3_internal1" [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r") (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r") (match_operand:SI 2 "logical_operand" "r,K,J")))] "" "@ xor %0,%1,%2 {xoril|xori} %0,%1,%b2 {xoriu|xoris} %0,%1,%u2" [(set_attr "length" "4,4,4")])(define_insn "*xorsi3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r") (match_operand:SI 2 "gpc_reg_operand" "r,r")) (const_int 0))) (clobber (match_scratch:SI 3 "=r,r"))] "! TARGET_POWERPC64" "@ xor. %3,%1,%2 #" [(set_attr "type" "compare") (set_attr "length" "4,8")])(define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") (compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "gpc_reg_operand" "")) (const_int 0))) (clobber (match_scratch:SI 3 ""))] "! TARGET_POWERPC64 && reload_completed" [(set (match_dup 3) (xor:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] "")(define_insn "*xorsi3_internal3" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") (compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r") (match_operand:SI 2 "gpc_reg_operand" "r,r")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") (xor:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWERPC64" "@ xor. %0,%1,%2 #" [(set_attr "type" "compare") (set_attr "length" "4,8")])(define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") (compare:CC (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "gpc_reg_operand" "")) (const_int 0))) (set (match_operand:SI 0 "gpc_reg_operand" "") (xor:SI (match_dup 1) (match_dup 2)))] "! TARGET_POWERPC64 && reload_completed" [(set (match_dup 0) (xor:SI (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "");; Split an XOR that we can't do in one insn into two insns, each of which;; does one 16-bit part. This is used by combine.(define_split [(set (match_operand:SI 0 "gpc_reg_operand" "") (xor:SI (match_operand:SI 1 "gpc_reg_operand" "") (match_operand:SI 2 "non_logical_cint_operand" "")))] "" [(set (match_dup 0) (xor:SI (match_dup 1) (match_dup 3))) (set (match_dup 0) (xor:SI (match_dup 0) (match_dup 4)))]"{ operands[3] = GEN_INT (INTVAL (operands[2]) & (~ (HOST_WIDE_INT) 0xffff)); operands[4] = GEN_INT (INTVAL (operands[2]) & 0xffff);}")(define_insn "*eqvsi3_internal1" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (not:SI (xor:SI (match_operand:SI 1 "gpc_reg_operand" "%r") (match_operand:SI 2 "gpc_reg_operand" "r"))))] "" "eqv %0,%1,%2")(define_insn "*eqvsi3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") (comp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -