📄 ip2k.md
字号:
# # # # #" "(ip2k_reorg_split_qimode && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) != 1))" [(set (reg:QI 10) (match_dup 1)) (set (match_dup 0) (plus:HI (zero_extend:HI (reg:QI 10)) (match_dup 2)))])(define_insn "*addhi3_immediate" ; 0 1 2 3 4 5 6 7 8 9 a b c d e f [(set (match_operand:HI 0 "nonimmediate_operand" "=a,do,a,do,a,a,a,do,&uo,&uS,bf,bf,bf,&uS,&uo, u") (plus:HI (match_operand:HI 1 "general_operand" "%0, 0,0, 0,0,0,0, 0, rS, ro,uo,uo,uo, ro, rS,uo") (match_operand 2 "immediate_operand" "N, N,M, M,P,I,i, i, N, N, M, P, I, i, i, i")))] "" "@ inc\\t%L0 incsnz\\t%L0\;inc\\t%H0 dec\\t%L0 mov\\tw,#-1\;add\\t%L0,w\;addc\\t%H0,w mov\\tw,%2\;add\\t%L0,w mov\\tw,#%n2\;sub\\t%L0,w mov\\tw,%L2\;add\\t%L0,w\;mov\\tw,%H2\;add\\t%H0,w mov\\tw,%L2\;add\\t%L0,w\;mov\\tw,%H2\;addc\\t%H0,w mov\\tw,%H1\;mov\\t%H0,w\;incsnz\\tw,%L1\;inc\\t%H0\;mov\\t%L0,w mov\\tw,%H1\;mov\\t%H0,w\;incsnz\\tw,%L1\;inc\\t%H0\;mov\\t%L0,w mov\\tw,%H1\;push\\t%L1%<\;pop\\t%L0%>\;mov\\t%H0,w\;dec\\t%L0 mov\\tw,%H1\;push\\t%L1%<\;pop\\t%L0%>\;mov\\t%H0,w\;mov\\tw,%2\;add\\t%L0,w mov\\tw,%H1\;push\\t%L1%<\;pop\\t%L0%>\;mov\\t%H0,w\;mov\\tw,#%n2\;sub\\t%L0,w mov\\tw,%L2\;add\\tw,%L1\;mov\\t%L0,w\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w mov\\tw,%L2\;add\\tw,%L1\;mov\\t%L0,w\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w mov\\tw,%L2\;add\\tw,%L1\;push\\twreg%<\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w\;pop\\t%L0%>" [(set_attr "skip" "yes,no,yes,no,no,no,no,no,no,no,no,no,no,no,no,no") (set_attr "clobberw" "no,no,no,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes,yes")])(define_insn "*addhi3_nonimmediate" ; 0 1 2 3 4 5 6 7 [(set (match_operand:HI 0 "nonimmediate_operand" "=&bf,bf,&dS,&do,d,&rS,&rS, o") (plus:HI (match_operand:HI 1 "general_operand" "%0, 0, 0, 0,0, ro, rS,rS") (match_operand:HI 2 "nonimmediate_operand" "ro,uo, ro, rS,r, rS, ro,rS")))] "" "@ mov\\tw,%L2\;add\\t%L0,w\;mov\\tw,%H2\;add\\t%H0,w mov\\tw,%L2\;push\\t%H2%<\;add\\t%L0,w\;pop\\twreg%>\;add\\t%H0,w mov\\tw,%L2\;add\\t%L0,w\;mov\\tw,%H2\;addc\\t%H0,w mov\\tw,%L2\;add\\t%L0,w\;mov\\tw,%H2\;addc\\t%H0,w mov\\tw,%L2\;push\\t%H2%<\;add\\t%L0,w\;pop\\twreg%>\;addc\\t%H0,w mov\\tw,%L2\;add\\tw,%L1\;mov\\t%L0,w\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w mov\\tw,%L2\;add\\tw,%L1\;mov\\t%L0,w\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w mov\\tw,%L2\;add\\tw,%L1\;mov\\t%L0,w\;mov\\tw,%H2\;addc\\tw,%H1\;mov\\t%H0,w")(define_insn "*addhi3_nonimm_zero_extend_w" [(set (match_operand:HI 0 "nonimmediate_operand" "=a,ro,&ro,&rS,&rS, u") (plus:HI (zero_extend:HI (reg:QI 10)) (match_operand:HI 1 "nonimmediate_operand" "0, 0, rS, rS, ro,uo")))] "" "@ add\\t%L0,w add\\t%L0,w\;clr\\twreg\;addc\\t%H0,w add\\tw,%L1\;mov\\t%L0,w\;clr\\twreg\;addc\\tw,%H1\;mov\\t%H0,w add\\tw,%L1\;mov\\t%L0,w\;clr\\twreg\;addc\\tw,%H1\;mov\\t%H0,w add\\tw,%L1\;mov\\t%L0,w\;clr\\twreg\;addc\\tw,%H1\;mov\\t%H0,w add\\tw,%L1\;push\\twreg%<\;clr\\twreg\;addc\\tw,%H1\;mov\\t%H0,w\;pop\\t%L0%>" [(set_attr "skip" "yes,no,no,no,no,no") (set_attr "clobberw" "no,yes,yes,yes,yes,yes")])(define_insn_and_split "*addhi3_nonimm_zero_extend" [(set (match_operand:HI 0 "nonimmediate_operand" "=a, ro,&ro,&rS,&rS, u") (plus:HI (zero_extend:HI (match_operand:QI 1 "general_operand" "roR,roR, rS,roR, rS,rS")) (match_operand:HI 2 "nonimmediate_operand" "0, 0, rS, rS, ro,uo")))] "" "#" "(ip2k_reorg_split_qimode)" [(set (reg:QI 10) (match_dup 1)) (set (match_dup 0) (plus:HI (zero_extend:HI (reg:QI 10)) (match_dup 2)))]) ;;;; Add 32-bit integers.;;(define_expand "addsi3" [(set (match_operand:SI 0 "nonimmediate_operand" "") (plus:SI (match_operand:SI 1 "general_operand" "") (match_operand:SI 2 "general_operand" "")))] "" "")(define_insn "*push_addsi3" [(set (match_operand:SI 0 "push_operand" "=<,<, <") (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%g,g, g") (match_operand:SI 2 "general_operand" "N,M,rSi")))] "" "*{ switch (which_alternative) { case 0: OUT_AS1 (push, %D1%<); OUT_AS1 (push, %C1%<); OUT_AS1 (push, %B1%<); OUT_AS1 (push, %A1%>%>%>); OUT_AS1 (incsnz, 4(SP)); OUT_AS1 (incsz, 3(SP)); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, 2(SP)); OUT_AS1 (inc, 1(SP)); OUT_AS1 (1:,); return \"\"; case 1: OUT_AS1 (push, %D1%<); OUT_AS1 (push, %C1%<); OUT_AS1 (push, %B1%<); OUT_AS1 (push, %A1%>%>%>); OUT_AS2 (mov, w, #-1); OUT_AS2 (add, 4(SP), w); OUT_AS2 (addc, 3(SP), w); OUT_AS2 (addc, 2(SP), w); OUT_AS2 (addc, 1(SP), w); return \"\"; case 2: OUT_AS2 (mov, w, %D2); OUT_AS2 (add, w, %D1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %C2); OUT_AS2 (addc, w, %C1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %B2); OUT_AS2 (addc, w, %B1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %A2); OUT_AS2 (addc, w, %A1); OUT_AS1 (push, wreg%>%>%>); return \"\"; default: abort(); } }" [(set_attr "clobberw" "no,yes,yes")])(define_insn "*addsi3" ; 0 1 2 3 4 5 6 [(set (match_operand:SI 0 "nonimmediate_operand" "=ro,ro, ro, rS,&ro,&rS,&rS") (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0, 0, 0, 0, rS, ro, rS") (match_operand:SI 2 "general_operand" "N, M,rSi,roi,rSi,rSi,roi")))] "" "@ incsnz\\t%D0\;incsz\\t%C0\;page\\t1f\;jmp\\t1f\;incsnz\\t%B0\;inc\\t%A0\;1: mov\\tw,#-1\;add\\t%D0,w\;addc\\t%C0,w\;addc\\t%B0,w\;addc\\t%A0,w mov\\tw,%D2\;add\\t%D0,w\;mov\\tw,%C2\;addc\\t%C0,w\;mov\\tw,%B2\;addc\\t%B0,w\;mov\\tw,%A2\;addc\\t%A0,w mov\\tw,%D2\;add\\t%D0,w\;mov\\tw,%C2\;addc\\t%C0,w\;mov\\tw,%B2\;addc\\t%B0,w\;mov\\tw,%A2\;addc\\t%A0,w mov\\tw,%D2\;add\\tw,%D1\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%C1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,%B1\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,%A1\;mov\\t%A0,w mov\\tw,%D2\;add\\tw,%D1\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%C1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,%B1\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,%A1\;mov\\t%A0,w mov\\tw,%D2\;add\\tw,%D1\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%C1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,%B1\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,%A1\;mov\\t%A0,w" [(set_attr "clobberw" "no,yes,yes,yes,yes,yes,yes")])(define_insn "*push_addsi3_zero_extendqi" ; 0 1 [(set (match_operand:SI 0 "push_operand" "=<, <") (plus:SI (zero_extend:SI (match_operand:QI 1 "general_operand" "%roRi,rSi")) (match_operand:SI 2 "general_operand" "rSi,roi")))] "" "@ mov\\tw,%D2\;add\\tw,%1\;push\\twreg%<\;mov\\tw,%C2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%B2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%A2\;addc\\tw,$ff\;push\\twreg%>%>%> mov\\tw,%D2\;add\\tw,%1\;push\\twreg%<\;mov\\tw,%C2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%B2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%A2\;addc\\tw,$ff\;push\\twreg%>%>%>")(define_insn "*addsi3_zero_extendqi" ; [(set (match_operand:SI 0 "nonimmediate_operand" "=ro, rS,&ro,&rS,&rS") (plus:SI (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "rS,roR, rS,roR, rS")) (match_operand:SI 2 "general_operand" "0, 0,rSi,rSi,roi")))] "" "@ mov\\tw,%1\;add\\t%D0,w\;clr\\twreg\;addc\\t%C0,w\;addc\\t%B0,w\;addc\\t%A0,w mov\\tw,%1\;add\\t%D0,w\;clr\\twreg\;addc\\t%C0,w\;addc\\t%B0,w\;addc\\t%A0,w mov\\tw,%1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,$ff\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w mov\\tw,%1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,$ff\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w mov\\tw,%1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,$ff\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w")(define_insn "*push_addsi3_zero_extendhi" ; 0 1 [(set (match_operand:SI 0 "push_operand" "=<, <") (plus:SI (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "%roR,rSR")) (match_operand:SI 2 "general_operand" "rSi,roi")))] "" "@ mov\\tw,%D2\;add\\tw,%L1\;push\\twreg%<\;mov\\tw,%C2\;addc\\tw,%H1\;push\\twreg%<\;mov\\tw,%B2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%A2\;addc\\tw,$ff\;push\\twreg%>%>%> mov\\tw,%D2\;add\\tw,%L1\;push\\twreg%<\;mov\\tw,%C2\;addc\\tw,%H1\;push\\twreg%<\;mov\\tw,%B2\;addc\\tw,$ff\;push\\twreg%<\;mov\\tw,%A2\;addc\\tw,$ff\;push\\twreg%>%>%>")(define_insn "*addsi3_zero_extendhi" ; [(set (match_operand:SI 0 "nonimmediate_operand" "=ro,rS,&ro,&rS,&rS") (plus:SI (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "rS,ro, rS, ro, rS")) (match_operand:SI 2 "general_operand" "0, 0,rSi,rSi,roi")))] "" "@ mov\\tw,%L1\;add\\t%D0,w\;mov\\tw,%H1\;addc\\t%C0,w\;clr\\twreg\;addc\\t%B0,w\;addc\\t%A0,w mov\\tw,%L1\;add\\t%D0,w\;mov\\tw,%H1\;addc\\t%C0,w\;clr\\twreg\;addc\\t%B0,w\;addc\\t%A0,w mov\\tw,%L1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%H1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w mov\\tw,%L1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%H1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w mov\\tw,%L1\;add\\tw,%D2\;mov\\t%D0,w\;mov\\tw,%C2\;addc\\tw,%H1\;mov\\t%C0,w\;mov\\tw,%B2\;addc\\tw,$ff\;mov\\t%B0,w\;mov\\tw,%A2\;addc\\tw,$ff\;mov\\t%A0,w");;;; Add 64-bit integers.;;(define_expand "adddi3" [(set (match_operand:DI 0 "nonimmediate_operand" "") (plus:DI (match_operand:DI 1 "general_operand" "") (match_operand:DI 2 "general_operand" "")))] "" "")(define_insn "*push_adddi3" [(set (match_operand:DI 0 "push_operand" "=<,<, <") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%g,g, g") (match_operand:DI 2 "general_operand" "N,M,rSi")))] "" "*{ switch (which_alternative) { case 0: OUT_AS1 (push, %Z1%<); OUT_AS1 (push, %Y1%<); OUT_AS1 (push, %X1%<); OUT_AS1 (push, %W1%<); OUT_AS1 (push, %V1%<); OUT_AS1 (push, %U1%<); OUT_AS1 (push, %T1%<); OUT_AS1 (push, %S1%>%>%>%>%>%>%>); OUT_AS1 (incsnz, 8(SP)); OUT_AS1 (incsz, 7(SP)); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, 6(SP)); OUT_AS1 (incsz, 5(SP)); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, 4(SP)); OUT_AS1 (incsz, 3(SP)); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, 2(SP)); OUT_AS1 (inc, 1(SP)); OUT_AS1 (1:,); return \"\"; case 1: OUT_AS1 (push, %Z1%<); OUT_AS1 (push, %Y1%<); OUT_AS1 (push, %X1%<); OUT_AS1 (push, %W1%<); OUT_AS1 (push, %V1%<); OUT_AS1 (push, %U1%<); OUT_AS1 (push, %T1%<); OUT_AS1 (push, %S1%>%>%>%>%>%>%>); OUT_AS2 (mov, w, #-1); OUT_AS2 (add, 8(SP), w); OUT_AS2 (addc, 7(SP), w); OUT_AS2 (addc, 6(SP), w); OUT_AS2 (addc, 5(SP), w); OUT_AS2 (addc, 4(SP), w); OUT_AS2 (addc, 3(SP), w); OUT_AS2 (addc, 2(SP), w); OUT_AS2 (addc, 1(SP), w); return \"\"; case 2: OUT_AS2 (mov, w, %Z2); OUT_AS2 (add, w, %Z1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %Y2); OUT_AS2 (addc, w, %Y1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %X2); OUT_AS2 (addc, w, %X1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %W2); OUT_AS2 (addc, w, %W1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %V2); OUT_AS2 (addc, w, %V1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %U2); OUT_AS2 (addc, w, %U1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %T2); OUT_AS2 (addc, w, %T1); OUT_AS1 (push, wreg%<); OUT_AS2 (mov, w, %S2); OUT_AS2 (addc, w, %S1); OUT_AS1 (push, wreg%>%>%>%>%>%>%>); return \"\"; default: abort(); } }" [(set_attr "clobberw" "no,yes,yes")])(define_insn "*adddi3" ; 0 1 2 3 4 5 6 [(set (match_operand:DI 0 "nonimmediate_operand" "=ro,ro, ro, rS,&ro,&rS,&rS") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0, 0, 0, 0, rS, ro, rS") (match_operand:DI 2 "general_operand" "N, M,rSi,roi,rSi,rSi,roi")))] "" "*{ switch (which_alternative) { case 0: OUT_AS1 (incsnz, %Z0); OUT_AS1 (incsz, %Y0); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, %X0); OUT_AS1 (incsz, %W0); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, %V0); OUT_AS1 (incsz, %U0); OUT_AS1 (page, 1f); OUT_AS1 (jmp, 1f); OUT_AS1 (incsnz, %T0); OUT_AS1 (inc, %S0); OUT_AS1 (1:, ); return \"\"; case 1: OUT_AS2 (mov, w, #-1); OUT_AS2 (add, %Z0, w); OUT_AS2 (addc, %Y0, w); OUT_AS2 (addc, %X0, w); OUT_AS2 (addc, %W0, w); OUT_AS2 (addc, %V0, w); OUT_AS2 (addc, %U0, w); OUT_AS2 (addc, %T0, w); OUT_AS2 (addc, %S0, w); return \"\"; case 2: case 3: OUT_AS2 (mov, w, %Z2); OUT_AS2 (add, %Z0, w); OUT_AS2 (mov, w, %Y2); OUT_AS2 (addc, %Y0, w); OUT_AS2 (mov, w, %X2); OUT_AS2 (addc, %X0, w); OUT_AS2 (mov, w, %W2); OUT_AS2 (addc, %W0, w); OUT_AS2 (mov, w, %V2); OUT_AS2 (addc, %V0, w); OUT_AS2 (mov, w, %U2); OUT_AS2 (addc, %U0, w); OUT_AS2 (mov, w, %T2); OUT_AS2 (addc, %T0, w); OUT_AS2 (mov, w, %S2); OUT_AS2 (addc, %S0, w); return \"\"; case 4: case 5: case 6: OUT_AS2 (mov, w, %Z2); OUT_AS2 (add, w, %Z1); OUT_AS2 (mov, %Z0, w); OUT_AS2 (mov, w, %Y2); OUT_AS2 (addc, w, %Y1); OUT_AS2 (mov, %Y0, w); OUT_AS2 (mov, w, %X2); OUT_AS2 (addc, w, %X1); OUT_AS2 (mov, %X0, w); OUT_AS2 (mov, w, %W2); OUT_AS2 (addc, w, %W1); OUT_AS2 (mov, %W0, w); OUT_AS2 (mov, w, %V2); OUT_AS2 (addc, w, %V1); OUT_AS2 (mov, %V0, w); OUT_AS2 (mov, w, %U2); OUT_AS2 (addc, w, %U1); OUT_AS2 (mov, %U0, w); OUT_AS2 (mov, w, %T2); OUT_AS2 (addc, w, %T1); OUT_AS2 (mov, %T0, w); OUT_AS2 (mov, w, %S2); OUT_AS2 (addc, w, %S1); OUT_AS2 (mov, %S0, w); return \"\"; default: abort();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -