📄 i960.md
字号:
emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, DImode, from), gen_rtx (REG, DImode, regno))); count -= 2; regno += 2; from = memory_address (DImode, plus_constant (from, 8)); } while (count > 0) { emit_insn (gen_rtx (SET, VOIDmode, gen_rtx (MEM, SImode, from), gen_rtx (REG, SImode, regno))); count -= 1; regno += 1; from = memory_address (SImode, plus_constant (from, 4)); } DONE;}");; Floating point move insns(define_expand "movdf" [(set (match_operand:DF 0 "general_operand" "") (match_operand:DF 1 "fpmove_src_operand" ""))] "" "{ if (emit_move_sequence (operands, DFmode)) DONE;}")(define_insn "" [(set (match_operand:DF 0 "general_operand" "=r,*f,d,d,m,o") (match_operand:DF 1 "fpmove_src_operand" "r,GH,F,m,d,G"))] "current_function_args_size == 0 && (register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode) || operands[1] == CONST0_RTX (DFmode))" "*{ switch (which_alternative) { case 0: if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])) return \"movrl %1,%0\"; else return \"movl %1,%0\"; case 1: return \"movrl %1,%0\"; case 2: return i960_output_ldconst (operands[0], operands[1]); case 3: return \"ldl %1,%0\"; case 4: return \"stl %1,%0\"; case 5: operands[1] = adj_offsettable_operand (operands[0], 4); return \"st g14,%0\;st g14,%1\"; }}" [(set_attr "type" "move,move,load,fpload,fpstore,fpstore")])(define_insn "" [(set (match_operand:DF 0 "general_operand" "=r,*f,d,d,m") (match_operand:DF 1 "fpmove_src_operand" "r,GH,F,m,d"))] "current_function_args_size != 0 && (register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode))" "*{ switch (which_alternative) { case 0: if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])) return \"movrl %1,%0\"; else return \"movl %1,%0\"; case 1: return \"movrl %1,%0\"; case 2: return i960_output_ldconst (operands[0], operands[1]); case 3: return \"ldl %1,%0\"; case 4: return \"stl %1,%0\"; }}" [(set_attr "type" "move,move,load,fpload,fpstore")])(define_expand "movsf" [(set (match_operand:SF 0 "general_operand" "") (match_operand:SF 1 "fpmove_src_operand" ""))] "" "{ if (emit_move_sequence (operands, SFmode)) DONE;}")(define_insn "" [(set (match_operand:SF 0 "general_operand" "=r,*f,d,d,m") (match_operand:SF 1 "fpmove_src_operand" "r,GH,F,m,dG"))] "current_function_args_size == 0 && (register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode) || operands[1] == CONST0_RTX (SFmode))" "*{ switch (which_alternative) { case 0: if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])) return \"movr %1,%0\"; else return \"mov %1,%0\"; case 1: return \"movr %1,%0\"; case 2: return i960_output_ldconst (operands[0], operands[1]); case 3: return \"ld %1,%0\"; case 4: if (operands[1] == CONST0_RTX (SFmode)) return \"st g14,%0\"; return \"st %1,%0\"; }}" [(set_attr "type" "move,move,load,fpload,fpstore")])(define_insn "" [(set (match_operand:SF 0 "general_operand" "=r,*f,d,d,m") (match_operand:SF 1 "fpmove_src_operand" "r,GH,F,m,d"))] "current_function_args_size != 0 && (register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode))" "*{ switch (which_alternative) { case 0: if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])) return \"movr %1,%0\"; else return \"mov %1,%0\"; case 1: return \"movr %1,%0\"; case 2: return i960_output_ldconst (operands[0], operands[1]); case 3: return \"ld %1,%0\"; case 4: return \"st %1,%0\"; }}" [(set_attr "type" "move,move,load,fpload,fpstore")]);; Mixed-mode moves with sign and zero-extension.;; Note that the one starting from HImode comes before those for QImode;; so that a constant operand will match HImode, not QImode.(define_expand "extendhisi2" [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_16 = gen_rtx (CONST_INT, VOIDmode, 16); int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_16)); emit_insn (gen_ashrsi3 (operand0, temp, shift_16)); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))] "" "ldis %1,%0" [(set_attr "type" "load")])(define_expand "extendqisi2" [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24); int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word), emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] "" "ldib %1,%0" [(set_attr "type" "load")])(define_expand "extendqihi2" [(set (match_operand:HI 0 "register_operand" "") (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24); int op0_subreg_word = 0; int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word); if (GET_CODE (operand0) == SUBREG) { op0_subreg_word = SUBREG_WORD (operand0); operand0 = SUBREG_REG (operand0); } if (GET_MODE (operand0) != SImode) operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_ashrsi3 (operand0, temp, shift_24)); DONE; }}")(define_insn "" [(set (match_operand:HI 0 "register_operand" "=d") (sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))] "" "ldib %1,%0" [(set_attr "type" "load")])(define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_16 = gen_rtx (CONST_INT, VOIDmode, 16); int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_16)); emit_insn (gen_lshrsi3 (operand0, temp, shift_16)); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] "" "ldos %1,%0" [(set_attr "type" "load")]);; Using shifts here generates much better code than doing an `and 255'.;; This is mainly because the `and' requires loading the constant separately,;; the constant is likely to get optimized, and then the compiler can't;; optimize the `and' because it doesn't know that one operand is a constant.(define_expand "zero_extendqisi2" [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24); int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_lshrsi3 (operand0, temp, shift_24)); DONE; }}")(define_insn "" [(set (match_operand:SI 0 "register_operand" "=d") (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] "" "ldob %1,%0" [(set_attr "type" "load")])(define_expand "zero_extendqihi2" [(set (match_operand:HI 0 "register_operand" "") (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))] "" "{ if (GET_CODE (operand1) == REG || (GET_CODE (operand1) == SUBREG && GET_CODE (XEXP (operand1, 0)) == REG)) { rtx temp = gen_reg_rtx (SImode); rtx shift_24 = gen_rtx (CONST_INT, VOIDmode, 24); int op0_subreg_word = 0; int op1_subreg_word = 0; if (GET_CODE (operand1) == SUBREG) { op1_subreg_word = SUBREG_WORD (operand1); operand1 = SUBREG_REG (operand1); } operand1 = gen_rtx (SUBREG, SImode, operand1, op1_subreg_word); if (GET_CODE (operand0) == SUBREG) { op0_subreg_word = SUBREG_WORD (operand0); operand0 = SUBREG_REG (operand0); } if (GET_MODE (operand0) != SImode) operand0 = gen_rtx (SUBREG, SImode, operand0, op0_subreg_word); emit_insn (gen_ashlsi3 (temp, operand1, shift_24)); emit_insn (gen_lshrsi3 (operand0, temp, shift_24)); DONE; }}")(define_insn "" [(set (match_operand:HI 0 "register_operand" "=d") (zero_extend:HI (match_operand:QI 1 "memory_operand" "m")))] "" "ldob %1,%0" [(set_attr "type" "load")]);; Conversions between float and double.(define_insn "extendsfdf2" [(set (match_operand:DF 0 "register_operand" "=*f,d") (float_extend:DF (match_operand:SF 1 "fp_arith_operand" "dGH,fGH")))] "TARGET_NUMERICS" "@ movr %1,%0 movrl %1,%0" [(set_attr "type" "fpmove")])(define_insn "truncdfsf2" [(set (match_operand:SF 0 "register_operand" "=d") (float_truncate:SF (match_operand:DF 1 "fp_arith_operand" "fGH")))] "TARGET_NUMERICS" "movr %1,%0" [(set_attr "type" "fpmove")]);; Conversion between fixed point and floating point.(define_insn "floatsidf2" [(set (match_operand:DF 0 "register_operand" "=f") (float:DF (match_operand:SI 1 "register_operand" "d")))] "TARGET_NUMERICS" "cvtir %1,%0" [(set_attr "type" "fpcvt")])(define_insn "floatsisf2" [(set (match_operand:SF 0 "register_operand" "=d*f") (float:SF (match_operand:SI 1 "register_operand" "d")))] "TARGET_NUMERICS" "cvtir %1,%0" [(set_attr "type" "fpcvt")]);; Convert a float to an actual integer.;; Truncation is performed as part of the conversion.;; The i960 requires conversion from DFmode to DImode to make;; unsigned conversions work properly.(define_insn "fixuns_truncdfdi2" [(set (match_operand:DI 0 "register_operand" "=d") (unsigned_fix:DI (fix:DF (match_operand:DF 1 "fp_arith_operand" "fGH"))))] "TARGET_NUMERICS" "cvtzril %1,%0" [(set_attr "type" "fpcvt")])(define_insn "fixuns_truncsfdi2" [(set (match_operand:DI 0 "register_operand" "=d") (unsigned_fix:DI (fix:SF (match_operand:SF 1 "fp_arith_operand" "fGH"))))] "TARGET_NUMERICS" "cvtzril %1,%0" [(set_attr "type" "fpcvt")])(define_insn "fix_truncdfsi2" [(set (match_operand:SI 0 "register_operand" "=d") (fix:SI (fix:DF (match_operand:DF 1 "fp_arith_operand" "fGH"))))] "TARGET_NUMERICS" "cvtzri %1,%0" [(set_attr "type" "fpcvt")])(define_expand "fixuns_truncdfsi2" [(set (match_operand:SI 0 "register_operand" "") (unsigned_fix:SI (fix:DF (match_operand:DF 1 "fp_arith_operand" ""))))] "TARGET_NUMERICS" "{ rtx temp = gen_reg_rtx (DImode); emit_insn (gen_rtx (SET, VOIDmode, temp, gen_rtx (UNSIGNED_FIX, DImode, gen_rtx (FIX, DFmode, operands[1]))));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -