📄 dsp16xx.md
字号:
operands[5] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0xffff); operands[6] = gen_highpart(QImode, operands[0]); operands[7] = gen_highpart(QImode, operands[0]); operands[8] = gen_rtx (CONST_INT, VOIDmode, (((INTVAL (operands[2]) & 0xffff0000) >> 16) & 0xffff));}")(define_insn "addhi3" [(set (match_operand:HI 0 "register_operand" "=A,A,A,A,A") (plus:HI (match_operand:HI 1 "register_operand" "%A,A,A,A,A") (match_operand:HI 2 "nonmemory_operand" "Z,d,L,M,?i")))] "" "@ %0=%1+%2 %0=%1+%2 %0=%w1+%H2 %0=%b1+%U2 %0=%w1+%H2\;%0=%b0+%U2" [(set_attr "type" "malu,malu,f3_alu_i,f3_alu_i,f3_alu_i")])(define_insn "" [(set (match_operand:QI 0 "register_operand" "=k,u,!k,!u") (plus:QI (plus:QI (match_operand:QI 1 "register_operand" "uk,uk,uk,uk") (match_operand:QI 2 "register_operand" "wz,wz,uk,uk")) (match_operand:QI 3 "immediate_operand" "i,i,i,i"))) (clobber (match_scratch:QI 4 "=j,q,j,q"))] "" "@ %m0=%m1+%m2\;%m0=%0+%H3 %m0=%m1+%m2\;%m0=%0+%H3 %m0=%m1+%m2\;%m0=%0+%H3 %m0=%m1+%m2\;%m0=%0+%H3")(define_expand "addqi3" [(parallel [(set (match_operand:QI 0 "register_operand" "") (plus:QI (match_operand:QI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" ""))) (clobber (match_scratch:QI 3 ""))])] "" "{ if (reload_in_progress) { if (REG_P (operands[1]) && (REGNO(operands[1]) == STACK_POINTER_REGNUM || REGNO(operands[1]) == FRAME_POINTER_REGNUM) && GET_CODE (operands[2]) == CONST_INT) { if (REG_P (operands[0]) && IS_ACCUM_REG(REGNO(operands[0]))) emit_move_insn (operands[0], operands[1]); operands[1] = operands[0]; } }}") (define_insn "match_addqi3" [(set (match_operand:QI 0 "register_operand" "=a,a,k,u,k,u,!k,!u,j,j,q,q") (plus:QI (match_operand:QI 1 "register_operand" "0,0,uk,uk,uk,uk,uk,uk,0,q,0,j") (match_operand:QI 2 "nonmemory_operand" "W,N,i,i,wz,wz,uk,uk,i,i,i,i"))) (clobber (match_scratch:QI 3 "=X,X,j,q,j,q,j,q,X,k,X,u"))] "" "*{ switch (which_alternative) { case 0: return \"*%0++%2\"; case 1: switch (INTVAL (operands[2])) { case -1: return \"*%0--\"; case 1: return \"*%0++\"; case -2: return \"*%0--\;*%0--\"; case 2: return \"*%0++\;*%0++\"; default: abort(); } case 2: case 3: return \"%m0=%1+%H2\"; case 4: case 5: return \"%m0=%m1+%m2\"; case 6: case 7: return \"%m0=%m1+%m2\"; case 8: case 9: case 10: case 11: return \"%0=%b1+%H2\"; default: abort(); }}"[(set_attr "type" "data_move_memory,data_move_multiple,f3_alu_i,f3_alu_i,f3_alu,f3_alu,f3_alu,f3_alu,f3_alu_i,f3_alu_i,f3_alu_i,f3_alu_i")])(define_expand "addhf3" [(set (match_operand:HF 0 "register_operand" "") (plus:HF (match_operand:HF 1 "register_operand" "") (match_operand:HF 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_addhf3_libcall) dsp16xx_addhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, ADDHF3_LIBCALL); emit_library_call (dsp16xx_addhf3_libcall, 1, HFmode, 2, operands[1], HFmode, operands[2], HFmode); emit_move_insn (operands[0], hard_libcall_value(HFmode)); DONE;}") ;;;; ....................;;;; Subtract instructions;;;; ....................(define_split [(set (match_operand:HI 0 "register_operand" "") (minus:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "const_int_operand" "")))] "reload_completed && !ADD_LOW_16(INTVAL(operands[2])) && !ADD_HIGH_16(INTVAL(operands[2]))" [(parallel [(set (match_dup 3) (minus:QI (match_dup 4) (match_dup 5))) (clobber (match_dup 6))]) (parallel [(set (match_dup 6) (minus:QI (match_dup 7) (match_dup 8))) (clobber (match_scratch:QI 9 ""))])] "{ operands[3] = gen_lowpart(QImode, operands[0]); operands[4] = gen_lowpart(QImode, operands[1]); operands[5] = gen_rtx (CONST_INT, VOIDmode, INTVAL (operands[2]) & 0xffff); operands[6] = gen_highpart(QImode, operands[0]); operands[7] = gen_highpart(QImode, operands[0]); operands[8] = gen_rtx (CONST_INT, VOIDmode, (((INTVAL (operands[2]) & 0xffff0000) >> 16) & 0xffff));}")(define_insn "subhi3" [(set (match_operand:HI 0 "register_operand" "=A,A,A,A,A") (minus:HI (match_operand:HI 1 "register_operand" "A,A,A,A,A") (match_operand:HI 2 "nonmemory_operand" "Z,d,L,M,?i")))] "" "@ %0=%1-%2 %0=%1-%2 %0=%w1-%H2 %0=%b1-%U2 %0=%w1-%H2\;%0=%b0-%U2" [(set_attr "type" "malu,malu,f3_alu_i,f3_alu_i,f3_alu_i")])(define_insn "subqi3" [(set (match_operand:QI 0 "register_operand" "=a,k,u,k,u,!k,!u,j,j,q,q") (minus:QI (match_operand:QI 1 "register_operand" "0,uk,uk,uk,uk,uk,uk,0,q,0,j") (match_operand:QI 2 "nonmemory_operand" "N,i,i,wz,wz,uk,uk,i,i,i,i"))) (clobber (match_scratch:QI 3 "=X,j,q,j,q,j,q,X,k,X,u"))] "" "*{ switch (which_alternative) { case 0: switch (INTVAL (operands[2])) { case 1: return \"*%0--\"; case -1: return \"*%0++\"; default: operands[2] = GEN_INT (-INTVAL (operands[2])); if (SHORT_IMMEDIATE(operands[2])) return \"set %3=%H2\;*%0++%3\"; else return \"%3=%H2\;*%0++%3\"; } case 1: case 2: return \"%m0=%1-%H2\"; case 3: case 4: return \"%m0=%m1-%m2\"; case 5: case 6: return \"%m0=%m1-%m2\"; case 7: case 8: case 9: case 10: return \"%0=%b1-%H2\"; default: abort(); }}"[(set_attr "type" "data_move_multiple,f3_alu_i,f3_alu_i,f3_alu,f3_alu,f3_alu,f3_alu,f3_alu_i,f3_alu_i,f3_alu_i,f3_alu_i")])(define_expand "subhf3" [(set (match_operand:HF 0 "register_operand" "") (minus:HF (match_operand:HF 1 "register_operand" "") (match_operand:HF 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_subhf3_libcall) dsp16xx_subhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, SUBHF3_LIBCALL); emit_library_call (dsp16xx_subhf3_libcall, 1, HFmode, 2, operands[1], HFmode, operands[2], HFmode); emit_move_insn (operands[0], hard_libcall_value(HFmode)); DONE;}")(define_insn "neghi2" [(set (match_operand:HI 0 "register_operand" "=A") (neg:HI (match_operand:HI 1 "register_operand" "A")))] "" "%0=-%1" [(set_attr "type" "special")])(define_expand "neghf2" [(set (match_operand:HF 0 "register_operand" "") (neg:HF (match_operand:HF 1 "register_operand" "")))] "" "{ rtx result; rtx target; { target = gen_lowpart(HImode, operands[0]); result = expand_binop (HImode, xor_optab, gen_lowpart(HImode, operands[1]), GEN_INT(0x80000000), target, 0, OPTAB_WIDEN); if (result == 0) abort (); if (result != target) emit_move_insn (result, target); /* Make a place for REG_EQUAL. */ emit_move_insn (operands[0], operands[0]); DONE; }}");;;; ....................;;;; Multiply instructions;;(define_expand "mulhi3" [(set (match_operand:HI 0 "register_operand" "") (mult:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_mulhi3_libcall) dsp16xx_mulhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHI3_LIBCALL); emit_library_call (dsp16xx_mulhi3_libcall, 1, HImode, 2, operands[1], HImode, operands[2], HImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE;}")(define_insn "mulqi3" [(set (match_operand:QI 0 "register_operand" "=w") (mult:QI (match_operand:QI 1 "register_operand" "%x") (match_operand:QI 2 "register_operand" "y"))) (clobber (match_scratch:QI 3 "=v"))] "" "%m0=%1*%2" [(set_attr "type" "malu_mul")])(define_insn "mulqihi3" [(set (match_operand:HI 0 "register_operand" "=t") (mult:HI (sign_extend:HI (match_operand:QI 1 "register_operand" "%x")) (sign_extend:HI (match_operand:QI 2 "register_operand" "y"))))] "" "%0=%1*%2" [(set_attr "type" "malu_mul")])(define_expand "mulhf3" [(set (match_operand:HF 0 "register_operand" "") (mult:HF (match_operand:HF 1 "register_operand" "") (match_operand:HF 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_mulhf3_libcall) dsp16xx_mulhf3_libcall = gen_rtx_SYMBOL_REF (Pmode, MULHF3_LIBCALL); emit_library_call (dsp16xx_mulhf3_libcall, 1, HFmode, 2, operands[1], HFmode, operands[2], HFmode); emit_move_insn (operands[0], hard_libcall_value(HFmode)); DONE;}");;;; *******************;;;; Divide Instructions;;(define_expand "divhi3" [(set (match_operand:HI 0 "register_operand" "") (div:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_divhi3_libcall) dsp16xx_divhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVHI3_LIBCALL); emit_library_call (dsp16xx_divhi3_libcall, 1, HImode, 2, operands[1], HImode, operands[2], HImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE;}")(define_expand "udivhi3" [(set (match_operand:HI 0 "register_operand" "") (udiv:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_udivhi3_libcall) dsp16xx_udivhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVHI3_LIBCALL); emit_library_call (dsp16xx_udivhi3_libcall, 1, HImode, 2, operands[1], HImode, operands[2], HImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE;}")(define_expand "divqi3" [(set (match_operand:QI 0 "register_operand" "") (div:QI (match_operand:QI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_divqi3_libcall) dsp16xx_divqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, DIVQI3_LIBCALL); emit_library_call (dsp16xx_divqi3_libcall, 1, QImode, 2, operands[1], QImode, operands[2], QImode); emit_move_insn (operands[0], hard_libcall_value(QImode)); DONE;}")(define_expand "udivqi3" [(set (match_operand:QI 0 "register_operand" "") (udiv:QI (match_operand:QI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_udivqi3_libcall) dsp16xx_udivqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UDIVQI3_LIBCALL); emit_library_call (dsp16xx_udivqi3_libcall, 1, QImode, 2, operands[1], QImode, operands[2], QImode); emit_move_insn (operands[0], hard_libcall_value(QImode)); DONE;}");;;; ....................;;;; Modulo instructions;;;; ....................(define_expand "modhi3" [(set (match_operand:HI 0 "register_operand" "") (mod:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_modhi3_libcall) dsp16xx_modhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODHI3_LIBCALL); emit_library_call (dsp16xx_modhi3_libcall, 1, HImode, 2, operands[1], HImode, operands[2], HImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE;}")(define_expand "umodhi3" [(set (match_operand:HI 0 "register_operand" "") (umod:HI (match_operand:HI 1 "register_operand" "") (match_operand:HI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_umodhi3_libcall) dsp16xx_umodhi3_libcall = gen_rtx_SYMBOL_REF (Pmode, UMODHI3_LIBCALL); emit_library_call (dsp16xx_umodhi3_libcall, 1, HImode, 2, operands[1], HImode, operands[2], HImode); emit_move_insn (operands[0], hard_libcall_value(HImode)); DONE;}")(define_expand "modqi3" [(set (match_operand:QI 0 "register_operand" "") (mod:QI (match_operand:QI 1 "register_operand" "") (match_operand:QI 2 "nonmemory_operand" "")))] "" "{ if (!dsp16xx_modqi3_libcall) dsp16xx_modqi3_libcall = gen_rtx_SYMBOL_REF (Pmode, MODQI3_LIBCALL); emit_library_call (dsp16xx_modqi3_libcall, 1, QImode, 2, operands[1], QImode, operands[2], QImode); emit_move_insn (operands[0], hard_libcall_value(QImode)); DONE;}")(define_expand "umodqi3" [(set (match_operand:QI 0 "register_operand" "")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -