📄 ns32k.md
字号:
else return \"movw %1,%0\";}")(define_insn "movstricthi" [(set (strict_low_part (match_operand:HI 0 "general_operand" "+r")) (match_operand:HI 1 "general_operand" "g"))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT && INTVAL(operands[1]) <= 7 && INTVAL(operands[1]) >= -8) return \"movqw %1,%0\"; return \"movw %1,%0\";}")(define_insn "movqi" [(set (match_operand:QI 0 "general_operand" "=g<,*f,g") (match_operand:QI 1 "general_operand" "g,g,*f"))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT) { char char_val = (char)INTVAL (operands[1]); if (char_val <= 7 && char_val >= -8) { if (INTVAL (operands[1]) > 7) operands[1] = GEN_INT (char_val); return \"movqb %1,%0\"; } return \"movb %1,%0\"; } else if (FP_REG_P (operands[0])) { if (GET_CODE (operands[1]) == REG && REGNO (operands[1]) < F0_REGNUM) return \"movbf %1,tos\;movf tos,%0\"; else return \"movbf %1,%0\"; } else if (FP_REG_P (operands[1])) { if (REG_P (operands[0])) return \"movf %1,tos\;movd tos,%0\"; return \"movf %1,%0\"; } else return \"movb %1,%0\";}")(define_insn "movstrictqi" [(set (strict_low_part (match_operand:QI 0 "general_operand" "+r")) (match_operand:QI 1 "general_operand" "g"))] "" "*{ if (GET_CODE (operands[1]) == CONST_INT && INTVAL(operands[1]) < 8 && INTVAL(operands[1]) > -9) return \"movqb %1,%0\"; return \"movb %1,%0\";}");; Block moves;; Argument 0 is the destination;; Argument 1 is the source;; Argument 2 is the length;; Argument 3 is the alignment;;;; Strategy: Use define_expand to;; either emit insns directly if it can be done simply or;; emit rtl to match movstrsi1 which has extra scratch registers;; which can be used to generate more complex code.(define_expand "movstrsi" [(parallel [(set (match_operand:BLK 0 "general_operand" "") (match_operand:BLK 1 "general_operand" "")) (use (match_operand:SI 2 "general_operand" "")) (use (match_operand:SI 3 "const_int_operand" ""))])] "" "{ if (operands[0]) /* avoid unused code messages */ { expand_block_move (operands); DONE; }}");; Special Registers:;; r0 count;; r1 from ;; r2 to ;; r3 match(define_insn "movstrsi1" [(set (mem:BLK (reg:SI 2)) (mem:BLK (reg:SI 1))) (use (reg:SI 0)) (set (reg:SI 2) (plus:SI (reg:SI 2) (mult:SI (reg:SI 0) (match_operand:SI 0 "const_int_operand" "")))) (set (reg:SI 1) (plus:SI (reg:SI 1) (mult:SI (reg:SI 0) (match_dup 0)))) (set (reg:SI 0) (const_int 0))] "" "* { int align = INTVAL(operands[0]); if (align == 4) return \"movsd\"; else return \"movsb\"; }")(define_insn "movstrsi2" [(set (mem:BLK (match_operand:SI 0 "address_operand" "g")) (mem:BLK (match_operand:SI 1 "address_operand" "g"))) (use (match_operand 2 "immediate_operand" "i"))] "" "movmd %a1,%a0,%2");; Extension and truncation insns.;; Those for integer source operand;; are ordered widest source type first.(define_insn "truncsiqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (truncate:QI (match_operand:SI 1 "nonimmediate_operand" "g")))] "" "movb %1,%0")(define_insn "truncsihi2" [(set (match_operand:HI 0 "general_operand" "=g<") (truncate:HI (match_operand:SI 1 "nonimmediate_operand" "g")))] "" "movw %1,%0")(define_insn "trunchiqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (truncate:QI (match_operand:HI 1 "nonimmediate_operand" "g")))] "" "movb %1,%0")(define_insn "extendhisi2" [(set (match_operand:SI 0 "general_operand" "=g<") (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))] "" "movxwd %1,%0")(define_insn "extendqihi2" [(set (match_operand:HI 0 "general_operand" "=g<") (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))] "" "movxbw %1,%0")(define_insn "extendqisi2" [(set (match_operand:SI 0 "general_operand" "=g<") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))] "" "movxbd %1,%0")(define_insn "extendsfdf2" [(set (match_operand:DF 0 "general_operand" "=lm<") (float_extend:DF (match_operand:SF 1 "general_operand" "fmF")))] "TARGET_32081" "movfl %1,%0")(define_insn "truncdfsf2" [(set (match_operand:SF 0 "general_operand" "=fm<") (float_truncate:SF (match_operand:DF 1 "general_operand" "lmF")))] "TARGET_32081" "movlf %1,%0")(define_insn "zero_extendhisi2" [(set (match_operand:SI 0 "general_operand" "=g<") (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g")))] "" "movzwd %1,%0")(define_insn "zero_extendqihi2" [(set (match_operand:HI 0 "general_operand" "=g<") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "g")))] "" "movzbw %1,%0")(define_insn "zero_extendqisi2" [(set (match_operand:SI 0 "general_operand" "=g<") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g")))] "" "movzbd %1,%0");; Fix-to-float conversion insns.;; Note that the ones that start with SImode come first.;; That is so that an operand that is a CONST_INT;; (and therefore lacks a specific machine mode).;; will be recognized as SImode (which is always valid);; rather than as QImode or HImode.;; Rumor has it that the National part does not correctly convert;; constant ints to floats. This conversion is therefore disabled.;; A register must be used to perform the conversion.(define_insn "floatsisf2" [(set (match_operand:SF 0 "general_operand" "=fm<") (float:SF (match_operand:SI 1 "general_operand" "rm")))] "TARGET_32081" "movdf %1,%0")(define_insn "floatsidf2" [(set (match_operand:DF 0 "general_operand" "=lm<") (float:DF (match_operand:SI 1 "general_operand" "rm")))] "TARGET_32081" "movdl %1,%0")(define_insn "floathisf2" [(set (match_operand:SF 0 "general_operand" "=fm<") (float:SF (match_operand:HI 1 "general_operand" "rm")))] "TARGET_32081" "movwf %1,%0")(define_insn "floathidf2" [(set (match_operand:DF 0 "general_operand" "=lm<") (float:DF (match_operand:HI 1 "general_operand" "rm")))] "TARGET_32081" "movwl %1,%0")(define_insn "floatqisf2" [(set (match_operand:SF 0 "general_operand" "=fm<") (float:SF (match_operand:QI 1 "general_operand" "rm")))] "TARGET_32081" "movbf %1,%0"); Some assemblers warn that this insn doesn't work.; Maybe they know something we don't.;(define_insn "floatqidf2"; [(set (match_operand:DF 0 "general_operand" "=lm<"); (float:DF (match_operand:QI 1 "general_operand" "rm")))]; "TARGET_32081"; "movbl %1,%0");; Float-to-fix conversion insns.;; The sequent compiler always generates "trunc" insns.(define_insn "fixsfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (fix:QI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfb %1,%0")(define_insn "fixsfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (fix:HI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfw %1,%0")(define_insn "fixsfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (fix:SI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfd %1,%0")(define_insn "fixdfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (fix:QI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "trunclb %1,%0")(define_insn "fixdfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (fix:HI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "trunclw %1,%0")(define_insn "fixdfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (fix:SI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "truncld %1,%0");; Unsigned(define_insn "fixunssfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (unsigned_fix:QI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfb %1,%0")(define_insn "fixunssfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (unsigned_fix:HI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfw %1,%0")(define_insn "fixunssfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (unsigned_fix:SI (fix:SF (match_operand:SF 1 "general_operand" "fm"))))] "TARGET_32081" "truncfd %1,%0")(define_insn "fixunsdfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (unsigned_fix:QI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "trunclb %1,%0")(define_insn "fixunsdfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (unsigned_fix:HI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "trunclw %1,%0")(define_insn "fixunsdfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (unsigned_fix:SI (fix:DF (match_operand:DF 1 "general_operand" "lm"))))] "TARGET_32081" "truncld %1,%0");;; These are not yet used by GCC(define_insn "fix_truncsfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (fix:QI (match_operand:SF 1 "general_operand" "fm")))] "TARGET_32081" "truncfb %1,%0")(define_insn "fix_truncsfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (fix:HI (match_operand:SF 1 "general_operand" "fm")))] "TARGET_32081" "truncfw %1,%0")(define_insn "fix_truncsfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (fix:SI (match_operand:SF 1 "general_operand" "fm")))] "TARGET_32081" "truncfd %1,%0")(define_insn "fix_truncdfqi2" [(set (match_operand:QI 0 "general_operand" "=g<") (fix:QI (match_operand:DF 1 "general_operand" "lm")))] "TARGET_32081" "trunclb %1,%0")(define_insn "fix_truncdfhi2" [(set (match_operand:HI 0 "general_operand" "=g<") (fix:HI (match_operand:DF 1 "general_operand" "lm")))] "TARGET_32081" "trunclw %1,%0")(define_insn "fix_truncdfsi2" [(set (match_operand:SI 0 "general_operand" "=g<") (fix:SI (match_operand:DF 1 "general_operand" "lm")))] "TARGET_32081" "truncld %1,%0");; Multiply-add instructions(define_insn "" [(set (match_operand:DF 0 "general_operand" "=v,v") (plus:DF (mult:DF (match_operand:DF 1 "general_operand" "%lmF,0") (match_operand:DF 2 "general_operand" "lmF,lmF")) (match_operand:DF 3 "general_operand" "0,lmF")))] "TARGET_MULT_ADD" "@ dotl %1,%2 polyl %2,%3")(define_insn "" [(set (match_operand:SF 0 "general_operand" "=u,u") (plus:SF (mult:SF (match_operand:SF 1 "general_operand" "%fmF,0") (match_operand:SF 2 "general_operand" "fmF,fmF")) (match_operand:SF 3 "general_operand" "0,fmF")))] "TARGET_MULT_ADD" "@ dotf %1,%2 polyf %2,%3");; Multiply-sub instructions(define_insn "" [(set (match_operand:DF 0 "general_operand" "=v") (minus:DF (mult:DF (match_operand:DF 1 "general_operand" "%lmF") (match_operand:DF 2 "general_operand" "lmF")) (match_operand:DF 3 "general_operand" "0")))] "TARGET_MULT_ADD" "@ negl %0,%0\;dotl %1,%2")(define_insn "" [(set (match_operand:SF 0 "general_operand" "=u") (minus:SF (mult:SF (match_operand:SF 1 "general_operand" "%fmF") (match_operand:SF 2 "general_operand" "fmF")) (match_operand:SF 3 "general_operand" "0")))] "TARGET_MULT_ADD" "@ negf %0,%0\;dotf %1,%2");;- All kinds of add instructions.(define_insn "adddf3" [(set (match_operand:DF 0 "general_operand" "=lm") (plus:DF (match_operand:DF 1 "general_operand" "%0") (match_operand:DF 2 "general_operand" "lmF")))] "TARGET_32081" "addl %2,%0")(define_insn "addsf3" [(set (match_operand:SF 0 "general_operand" "=fm") (plus:SF (match_operand:SF 1 "general_operand" "%0") (match_operand:SF 2 "general_operand" "fmF")))] "TARGET_32081" "addf %2,%0")(define_insn "" [(set (reg:SI 25) (plus:SI (reg:SI 25) (match_operand:SI 0 "immediate_operand" "i")))] "GET_CODE (operands[0]) == CONST_INT" "*{#ifndef SEQUENT_ADJUST_STACK if (TARGET_32532) if (INTVAL (operands[0]) == 8) return \"cmpd tos,tos\"; if (TARGET_32532 || TARGET_32332) if (INTVAL (operands[0]) == 4) return \"cmpqd %$0,tos\";#endif if (! TARGET_32532) { if (INTVAL (operands[0]) < 64 && INTVAL (operands[0]) > -64) return \"adjspb %n0\"; else if (INTVAL (operands[0]) < 8192 && INTVAL (operands[0]) >= -8192) return \"adjspw %n0\"; } return \"adjspd %n0\";}")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=g<") (plus:SI (reg:SI 24) (match_operand:SI 1 "immediate_operand" "i")))] "GET_CODE (operands[1]) == CONST_INT" "addr %c1(fp),%0")(define_insn "" [(set (match_operand:SI 0 "general_operand" "=g<") (plus:SI (reg:SI 25) (match_operand:SI 1 "immediate_operand" "i")))] "GET_CODE (operands[1]) == CONST_INT" "addr %c1(sp),%0")(define_insn "adddi3" [(set (match_operand:DI 0 "general_operand" "=ro") (plus:DI (match_operand:DI 1 "general_operand" "%0") (match_operand:DI 2 "general_operand" "ron")))] "" "*{ rtx low[3], high[3], xops[4];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -