📄 arm.md
字号:
(define_insn "*addsi3_compare_op2" [(set (reg:CC_C 24) (compare:CC_C (plus:SI (match_operand:SI 1 "s_register_operand" "r,r") (match_operand:SI 2 "arm_add_operand" "rI,L")) (match_dup 2))) (set (match_operand:SI 0 "s_register_operand" "=r,r") (plus:SI (match_dup 1) (match_dup 2)))] "" "@ add%?s\\t%0, %1, %2 sub%?s\\t%0, %1, #%n2"[(set_attr "conds" "set")])(define_insn "*compare_addsi2_op0" [(set (reg:CC_C 24) (compare:CC_C (plus:SI (match_operand:SI 0 "s_register_operand" "r,r") (match_operand:SI 1 "arm_add_operand" "rI,L")) (match_dup 0)))] "" "@ cmn%?\\t%0, %1 cmp%?\\t%0, #%n1"[(set_attr "conds" "set")])(define_insn "*compare_addsi2_op1" [(set (reg:CC_C 24) (compare:CC_C (plus:SI (match_operand:SI 0 "s_register_operand" "r,r") (match_operand:SI 1 "arm_add_operand" "rI,L")) (match_dup 1)))] "" "@ cmn%?\\t%0, %1 cmp%?\\t%0, #%n1"[(set_attr "conds" "set")])(define_insn "*addsi3_carryin" [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (ltu:SI (reg:CC_C 24) (const_int 0)) (plus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "arm_rhs_operand" "rI"))))] "" "adc%?\\t%0, %1, %2"[(set_attr "conds" "use")])(define_insn "*addsi3_carryin_alt1" [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (plus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "arm_rhs_operand" "rI")) (ltu:SI (reg:CC_C 24) (const_int 0))))] "" "adc%?\\t%0, %1, %2"[(set_attr "conds" "use")])(define_insn "*addsi3_carryin_alt2" [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (plus:SI (ltu:SI (reg:CC_C 24) (const_int 0)) (match_operand:SI 1 "s_register_operand" "r")) (match_operand:SI 2 "arm_rhs_operand" "rI")))] "" "adc%?\\t%0, %1, %2"[(set_attr "conds" "use")])(define_insn "*addsi3_carryin_alt3" [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (plus:SI (ltu:SI (reg:CC_C 24) (const_int 0)) (match_operand:SI 2 "arm_rhs_operand" "rI")) (match_operand:SI 1 "s_register_operand" "r")))] "" "adc%?\\t%0, %1, %2"[(set_attr "conds" "use")])(define_insn "incscc" [(set (match_operand:SI 0 "s_register_operand" "=r,r") (plus:SI (match_operator:SI 2 "comparison_operator" [(match_operand 3 "cc_register" "") (const_int 0)]) (match_operand:SI 1 "s_register_operand" "0,?r")))] "" "@ add%d2\\t%0, %1, #1 mov%D2\\t%0, %1\;add%d2\\t%0, %1, #1"[(set_attr "conds" "use") (set_attr "length" "4,8")]); If a constant is too big to fit in a single instruction then the constant; will be pre-loaded into a register taking at least two insns, we might be; able to merge it with an add, but it depends on the exact value.(define_split [(set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_operand:SI 1 "s_register_operand" "r") (match_operand:SI 2 "const_int_operand" "n")))] "!(const_ok_for_arm (INTVAL (operands[2])) || const_ok_for_arm (-INTVAL (operands[2])))" [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))] "{ unsigned int val = (unsigned) INTVAL (operands[2]); int i; unsigned int temp; /* this code is similar to the approach followed in movsi, but it must generate exactly two insns */ for (i = 30; i >= 0; i -= 2) { if (val & (3 << i)) { i -= 6; if (i < 0) i = 0; if (const_ok_for_arm (temp = (val & ~(255 << i)))) { val &= 255 << i; break; } /* we might be able to do this as (larger number - small number) */ temp = ((val >> i) & 255) + 1; if (temp > 255 && i < 24) { i += 2; temp = ((val >> i) & 255) + 1; } if (const_ok_for_arm ((temp << i) - val)) { i = temp << i; temp = (unsigned) - (int) (i - val); val = i; break; } FAIL; } } /* if we got here, we have found a way of doing it in two instructions. the two constants are in val and temp */ operands[2] = GEN_INT ((int)val); operands[3] = GEN_INT ((int)temp);}")(define_insn "addsf3" [(set (match_operand:SF 0 "s_register_operand" "=f,f") (plus:SF (match_operand:SF 1 "s_register_operand" "f,f") (match_operand:SF 2 "fpu_add_operand" "fG,H")))] "TARGET_HARD_FLOAT" "@ adf%?s\\t%0, %1, %2 suf%?s\\t%0, %1, #%N2"[(set_attr "type" "farith")])(define_insn "adddf3" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (match_operand:DF 1 "s_register_operand" "f,f") (match_operand:DF 2 "fpu_add_operand" "fG,H")))] "TARGET_HARD_FLOAT" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2"[(set_attr "type" "farith")])(define_insn "*adddf_df_esfdf" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (plus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f,f")) (match_operand:DF 2 "fpu_add_operand" "fG,H")))] "TARGET_HARD_FLOAT" "@ adf%?d\\t%0, %1, %2 suf%?d\\t%0, %1, #%N2"[(set_attr "type" "farith")])(define_insn "*adddf_df_esfdf" [(set (match_operand:DF 0 "s_register_operand" "=f") (plus:DF (match_operand:DF 1 "s_register_operand" "f") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] "TARGET_HARD_FLOAT" "adf%?d\\t%0, %1, %2"[(set_attr "type" "farith")])(define_insn "*adddf_esfdf_esfdf" [(set (match_operand:DF 0 "s_register_operand" "=f") (plus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] "TARGET_HARD_FLOAT" "adf%?d\\t%0, %1, %2"[(set_attr "type" "farith")])(define_insn "addxf3" [(set (match_operand:XF 0 "s_register_operand" "=f,f") (plus:XF (match_operand:XF 1 "s_register_operand" "f,f") (match_operand:XF 2 "fpu_add_operand" "fG,H")))] "ENABLE_XF_PATTERNS && TARGET_HARD_FLOAT" "@ adf%?e\\t%0, %1, %2 suf%?e\\t%0, %1, #%N2"[(set_attr "type" "farith")])(define_insn "subdi3" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r,&r") (minus:DI (match_operand:DI 1 "s_register_operand" "0,r,0") (match_operand:DI 2 "s_register_operand" "r,0,0"))) (clobber (reg:CC 24))] "" "subs\\t%Q0, %Q1, %Q2\;sbc\\t%R0, %R1, %R2"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_insn "*subdi_di_zesidi" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") (minus:DI (match_operand:DI 1 "s_register_operand" "?r,0") (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")))) (clobber (reg:CC 24))] "" "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, #0"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_insn "*subdi_di_sesidi" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") (minus:DI (match_operand:DI 1 "s_register_operand" "r,0") (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")))) (clobber (reg:CC 24))] "" "subs\\t%Q0, %Q1, %2\;sbc\\t%R0, %R1, %2, asr #31"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_insn "*subdi_zesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") (minus:DI (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "?r,0"))) (clobber (reg:CC 24))] "" "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, #0"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_insn "*subdi_sesidi_di" [(set (match_operand:DI 0 "s_register_operand" "=&r,&r") (minus:DI (sign_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")) (match_operand:DI 1 "s_register_operand" "?r,0"))) (clobber (reg:CC 24))] "" "rsbs\\t%Q0, %Q1, %2\;rsc\\t%R0, %R1, %2, asr #31"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_insn "*subdi_zesidi_zesidi" [(set (match_operand:DI 0 "s_register_operand" "=r") (minus:DI (zero_extend:DI (match_operand:SI 1 "s_register_operand" "r")) (zero_extend:DI (match_operand:SI 2 "s_register_operand" "r")))) (clobber (reg:CC 24))] "" "subs\\t%Q0, %1, %2\;rsc\\t%R0, %1, %1"[(set_attr "conds" "clob") (set_attr "length" "8")])(define_expand "subsi3" [(set (match_operand:SI 0 "s_register_operand" "") (minus:SI (match_operand:SI 1 "reg_or_int_operand" "") (match_operand:SI 2 "s_register_operand" "")))] "" " if (GET_CODE (operands[1]) == CONST_INT) { arm_split_constant (MINUS, SImode, INTVAL (operands[1]), operands[0], operands[2], (reload_in_progress || reload_completed ? 0 : preserve_subexpressions_p ())); DONE; }")(define_insn "*subsi3_insn" [(set (match_operand:SI 0 "s_register_operand" "=r,r") (minus:SI (match_operand:SI 1 "reg_or_int_operand" "rI,?n") (match_operand:SI 2 "s_register_operand" "r,r")))] "" "@ rsb%?\\t%0, %2, %1 #"[(set_attr "length" "4,16")])(define_split [(set (match_operand:SI 0 "s_register_operand" "") (minus:SI (match_operand:SI 1 "const_int_operand" "") (match_operand:SI 2 "s_register_operand" "")))] "! const_ok_for_arm (INTVAL (operands[1]))" [(clobber (const_int 0))] " arm_split_constant (MINUS, SImode, INTVAL (operands[1]), operands[0], operands[2], 0); DONE;")(define_insn "*subsi3_compare0" [(set (reg:CC_NOOV 24) (compare:CC_NOOV (minus:SI (match_operand:SI 1 "arm_rhs_operand" "r,I") (match_operand:SI 2 "arm_rhs_operand" "rI,r")) (const_int 0))) (set (match_operand:SI 0 "s_register_operand" "=r,r") (minus:SI (match_dup 1) (match_dup 2)))] "" "@ sub%?s\\t%0, %1, %2 rsb%?s\\t%0, %2, %1"[(set_attr "conds" "set")])(define_insn "decscc" [(set (match_operand:SI 0 "s_register_operand" "=r,r") (minus:SI (match_operand:SI 1 "s_register_operand" "0,?r") (match_operator:SI 2 "comparison_operator" [(match_operand 3 "cc_register" "") (const_int 0)])))] "" "@ sub%d2\\t%0, %1, #1 mov%D2\\t%0, %1\;sub%d2\\t%0, %1, #1"[(set_attr "conds" "use") (set_attr "length" "*,8")])(define_insn "subsf3" [(set (match_operand:SF 0 "s_register_operand" "=f,f") (minus:SF (match_operand:SF 1 "fpu_rhs_operand" "f,G") (match_operand:SF 2 "fpu_rhs_operand" "fG,f")))] "TARGET_HARD_FLOAT" "@ suf%?s\\t%0, %1, %2 rsf%?s\\t%0, %2, %1"[(set_attr "type" "farith")])(define_insn "subdf3" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (minus:DF (match_operand:DF 1 "fpu_rhs_operand" "f,G") (match_operand:DF 2 "fpu_rhs_operand" "fG,f")))] "TARGET_HARD_FLOAT" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1"[(set_attr "type" "farith")])(define_insn "*subdf_esfdf_df" [(set (match_operand:DF 0 "s_register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (match_operand:DF 2 "fpu_rhs_operand" "fG")))] "TARGET_HARD_FLOAT" "suf%?d\\t%0, %1, %2"[(set_attr "type" "farith")])(define_insn "*subdf_df_esfdf" [(set (match_operand:DF 0 "s_register_operand" "=f,f") (minus:DF (match_operand:DF 1 "fpu_rhs_operand" "f,G") (float_extend:DF (match_operand:SF 2 "s_register_operand" "f,f"))))] "TARGET_HARD_FLOAT" "@ suf%?d\\t%0, %1, %2 rsf%?d\\t%0, %2, %1"[(set_attr "type" "farith")])(define_insn "*subdf_esfdf_esfdf" [(set (match_operand:DF 0 "s_register_operand" "=f") (minus:DF (float_extend:DF (match_operand:SF 1 "s_register_operand" "f")) (float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))] "TARGET_HARD_FLOAT" "suf%?d\\t%0, %1, %2"[(set_attr "type" "farith")])(define_insn "subxf3" [(set (match_operand:XF 0 "s_register_operand" "=f,f") (minus:XF (match_operand:XF 1 "fpu_rhs_operand" "f,G") (match_operand:XF 2 "fpu_rhs_operand" "fG,f")))] "ENABLE_XF_PATTERNS && TARGET_HARD_FLOAT" "@ suf%?e\\t%0, %1, %2 rsf%?e\\t%0, %2, %1"[(set_attr "type" "farith")]);; Multiplication insns;; Use `&' and then `0' to prevent the operands 0 and 1 being the same(define_insn "mulsi3" [(set (match_operand:SI 0 "s_register_operand" "=&r,&r") (mult:SI (match_operand:SI 2 "s_register_operand" "r,r") (match_operand:SI 1 "s_register_operand" "%?r,0")))] "" "mul%?\\t%0, %2, %1"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -