📄 s390.md
字号:
ld\t%0,%1 ldy\t%0,%1 std\t%1,%0 stdy\t%1,%0 lm\t%0,%N0,%S1 lmy\t%0,%N0,%S1 stm\t%1,%N1,%S0 stmy\t%1,%N1,%S0 # # #" [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RSY,RS,RSY,*,*,SS") (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,fstoredf,fstoredf,\ lm,lm,stm,stm,*,*,*")])(define_split [(set (match_operand:DF 0 "nonimmediate_operand" "") (match_operand:DF 1 "general_operand" ""))] "!TARGET_64BIT && reload_completed && s390_split_ok_p (operands[0], operands[1], DFmode, 0)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))]{ operands[2] = operand_subword (operands[0], 0, 0, DFmode); operands[3] = operand_subword (operands[0], 1, 0, DFmode); operands[4] = operand_subword (operands[1], 0, 0, DFmode); operands[5] = operand_subword (operands[1], 1, 0, DFmode);})(define_split [(set (match_operand:DF 0 "nonimmediate_operand" "") (match_operand:DF 1 "general_operand" ""))] "!TARGET_64BIT && reload_completed && s390_split_ok_p (operands[0], operands[1], DFmode, 1)" [(set (match_dup 2) (match_dup 4)) (set (match_dup 3) (match_dup 5))]{ operands[2] = operand_subword (operands[0], 1, 0, DFmode); operands[3] = operand_subword (operands[0], 0, 0, DFmode); operands[4] = operand_subword (operands[1], 1, 0, DFmode); operands[5] = operand_subword (operands[1], 0, 0, DFmode);})(define_split [(set (match_operand:DF 0 "register_operand" "") (match_operand:DF 1 "memory_operand" ""))] "!TARGET_64BIT && reload_completed && !FP_REG_P (operands[0]) && !s_operand (operands[1], VOIDmode)" [(set (match_dup 0) (match_dup 1))]{ rtx addr = operand_subword (operands[0], 1, 0, DFmode); s390_load_address (addr, XEXP (operands[1], 0)); operands[1] = replace_equiv_address (operands[1], addr);})(define_expand "reload_outdf" [(parallel [(match_operand:DF 0 "" "") (match_operand:DF 1 "register_operand" "d") (match_operand:SI 2 "register_operand" "=&a")])] "!TARGET_64BIT"{ gcc_assert (MEM_P (operands[0])); s390_load_address (operands[2], find_replacement (&XEXP (operands[0], 0))); operands[0] = replace_equiv_address (operands[0], operands[2]); emit_move_insn (operands[0], operands[1]); DONE;});; movsf instruction pattern(s).;(define_insn "movsf" [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,d,R,T,?Q") (match_operand:SF 1 "general_operand" "G,f,R,T,f,f,d,R,T,d,d,?Q"))] "" "@ lzer\t%0 ler\t%0,%1 le\t%0,%1 ley\t%0,%1 ste\t%1,%0 stey\t%1,%0 lr\t%0,%1 l\t%0,%1 ly\t%0,%1 st\t%1,%0 sty\t%1,%0 #" [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") (set_attr "type" "fsimpsf,floadsf,floadsf,floadsf,fstoresf,fstoresf, lr,load,load,store,store,*")]);; movcc instruction pattern;(define_insn "movcc" [(set (match_operand:CC 0 "nonimmediate_operand" "=d,c,d,d,d,R,T") (match_operand:CC 1 "nonimmediate_operand" "d,d,c,R,T,d,d"))] "" "@ lr\t%0,%1 tmh\t%1,12288 ipm\t%0 st\t%0,%1 sty\t%0,%1 l\t%1,%0 ly\t%1,%0" [(set_attr "op_type" "RR,RI,RRE,RX,RXY,RX,RXY") (set_attr "type" "lr,*,*,store,store,load,load")]);; Block move (MVC) patterns.;(define_insn "*mvc" [(set (match_operand:BLK 0 "memory_operand" "=Q") (match_operand:BLK 1 "memory_operand" "Q")) (use (match_operand 2 "const_int_operand" "n"))] "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" "mvc\t%O0(%2,%R0),%S1" [(set_attr "op_type" "SS")])(define_split [(set (match_operand 0 "memory_operand" "") (match_operand 1 "memory_operand" ""))] "reload_completed && GET_MODE (operands[0]) == GET_MODE (operands[1]) && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" [(parallel [(set (match_dup 0) (match_dup 1)) (use (match_dup 2))])]{ operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); operands[0] = adjust_address (operands[0], BLKmode, 0); operands[1] = adjust_address (operands[1], BLKmode, 0);})(define_peephole2 [(parallel [(set (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" "")) (use (match_operand 2 "const_int_operand" ""))]) (parallel [(set (match_operand:BLK 3 "memory_operand" "") (match_operand:BLK 4 "memory_operand" "")) (use (match_operand 5 "const_int_operand" ""))])] "s390_offset_p (operands[0], operands[3], operands[2]) && s390_offset_p (operands[1], operands[4], operands[2]) && !s390_overlap_p (operands[0], operands[1], INTVAL (operands[2]) + INTVAL (operands[5])) && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" [(parallel [(set (match_dup 6) (match_dup 7)) (use (match_dup 8))])] "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));");; load_multiple pattern(s).;; ??? Due to reload problems with replacing registers inside match_parallel; we currently support load_multiple/store_multiple only after reload.;(define_expand "load_multiple" [(match_par_dup 3 [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" ""))])] "reload_completed"{ enum machine_mode mode; int regno; int count; rtx from; int i, off; /* Support only loading a constant number of fixed-point registers from memory and only bother with this if more than two */ if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 2 || INTVAL (operands[2]) > 16 || GET_CODE (operands[1]) != MEM || GET_CODE (operands[0]) != REG || REGNO (operands[0]) >= 16) FAIL; count = INTVAL (operands[2]); regno = REGNO (operands[0]); mode = GET_MODE (operands[0]); if (mode != SImode && mode != word_mode) FAIL; operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); if (no_new_pseudos) { if (GET_CODE (XEXP (operands[1], 0)) == REG) { from = XEXP (operands[1], 0); off = 0; } else if (GET_CODE (XEXP (operands[1], 0)) == PLUS && GET_CODE (XEXP (XEXP (operands[1], 0), 0)) == REG && GET_CODE (XEXP (XEXP (operands[1], 0), 1)) == CONST_INT) { from = XEXP (XEXP (operands[1], 0), 0); off = INTVAL (XEXP (XEXP (operands[1], 0), 1)); } else FAIL; } else { from = force_reg (Pmode, XEXP (operands[1], 0)); off = 0; } for (i = 0; i < count; i++) XVECEXP (operands[3], 0, i) = gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, regno + i), change_address (operands[1], mode, plus_constant (from, off + i * GET_MODE_SIZE (mode))));})(define_insn "*load_multiple_di" [(match_parallel 0 "load_multiple_operation" [(set (match_operand:DI 1 "register_operand" "=r") (match_operand:DI 2 "s_operand" "QS"))])] "reload_completed && word_mode == DImode"{ int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[1]) + words - 1); return "lmg\t%1,%0,%S2";} [(set_attr "op_type" "RSY") (set_attr "type" "lm")])(define_insn "*load_multiple_si" [(match_parallel 0 "load_multiple_operation" [(set (match_operand:SI 1 "register_operand" "=r,r") (match_operand:SI 2 "s_operand" "Q,S"))])] "reload_completed"{ int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (SImode, REGNO (operands[1]) + words - 1); return which_alternative == 0 ? "lm\t%1,%0,%S2" : "lmy\t%1,%0,%S2";} [(set_attr "op_type" "RS,RSY") (set_attr "type" "lm")]);; store multiple pattern(s).;(define_expand "store_multiple" [(match_par_dup 3 [(set (match_operand 0 "" "") (match_operand 1 "" "")) (use (match_operand 2 "" ""))])] "reload_completed"{ enum machine_mode mode; int regno; int count; rtx to; int i, off; /* Support only storing a constant number of fixed-point registers to memory and only bother with this if more than two. */ if (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) < 2 || INTVAL (operands[2]) > 16 || GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != REG || REGNO (operands[1]) >= 16) FAIL; count = INTVAL (operands[2]); regno = REGNO (operands[1]); mode = GET_MODE (operands[1]); if (mode != SImode && mode != word_mode) FAIL; operands[3] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count)); if (no_new_pseudos) { if (GET_CODE (XEXP (operands[0], 0)) == REG) { to = XEXP (operands[0], 0); off = 0; } else if (GET_CODE (XEXP (operands[0], 0)) == PLUS && GET_CODE (XEXP (XEXP (operands[0], 0), 0)) == REG && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == CONST_INT) { to = XEXP (XEXP (operands[0], 0), 0); off = INTVAL (XEXP (XEXP (operands[0], 0), 1)); } else FAIL; } else { to = force_reg (Pmode, XEXP (operands[0], 0)); off = 0; } for (i = 0; i < count; i++) XVECEXP (operands[3], 0, i) = gen_rtx_SET (VOIDmode, change_address (operands[0], mode, plus_constant (to, off + i * GET_MODE_SIZE (mode))), gen_rtx_REG (mode, regno + i));})(define_insn "*store_multiple_di" [(match_parallel 0 "store_multiple_operation" [(set (match_operand:DI 1 "s_operand" "=QS") (match_operand:DI 2 "register_operand" "r"))])] "reload_completed && word_mode == DImode"{ int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (DImode, REGNO (operands[2]) + words - 1); return "stmg\t%2,%0,%S1";} [(set_attr "op_type" "RSY") (set_attr "type" "stm")])(define_insn "*store_multiple_si" [(match_parallel 0 "store_multiple_operation" [(set (match_operand:SI 1 "s_operand" "=Q,S") (match_operand:SI 2 "register_operand" "r,r"))])] "reload_completed"{ int words = XVECLEN (operands[0], 0); operands[0] = gen_rtx_REG (SImode, REGNO (operands[2]) + words - 1); return which_alternative == 0 ? "stm\t%2,%0,%S1" : "stmy\t%2,%0,%S1";} [(set_attr "op_type" "RS,RSY") (set_attr "type" "stm")]);;;; String instructions.;;(define_insn "*execute" [(match_parallel 0 "" [(unspec [(match_operand 1 "register_operand" "a") (match_operand:BLK 2 "memory_operand" "R") (match_operand 3 "" "")] UNSPEC_EXECUTE)])] "GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_INT && GET_MODE_SIZE (GET_MODE (operands[1])) <= UNITS_PER_WORD" "ex\t%1,%2" [(set_attr "op_type" "RX") (set_attr "type" "cs")]);; strlenM instruction pattern(s).;(define_expand "strlen<mode>" [(set (reg:SI 0) (match_operand:SI 2 "immediate_operand" "")) (parallel [(set (match_dup 4) (unspec:P [(const_int 0) (match_operand:BLK 1 "memory_operand" "") (reg:SI 0) (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) (clobber (scratch:P)) (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_operand:P 0 "register_operand" "") (minus:P (match_dup 4) (match_dup 5))) (clobber (reg:CC CC_REGNUM))])] ""{ operands[4] = gen_reg_rtx (Pmode); operands[5] = gen_reg_rtx (Pmode); emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); operands[1] = replace_equiv_address (operands[1], operands[5]);})(define_insn "*strlen<mode>" [(set (match_operand:P 0 "register_operand" "=a") (unspec:P [(match_operand:P 2 "general_operand" "0") (mem:BLK (match_operand:P 3 "register_operand" "1")) (reg:SI 0) (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) (clobber (match_scratch:P 1 "=a")) (clobber (reg:CC CC_REGNUM))] "" "srst\t%0,%1\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]);; cmpstrM instruction pattern(s).;(define_expand "cmpstrsi" [(set (reg:SI 0) (const_int 0)) (parallel [(clobber (match_operand 3 "" "")) (clobber (match_dup 4)) (set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 1 "memory_operand" "") (match_operand:BLK 2 "memory_operand" ""))) (use (reg:SI 0))]) (parallel [(set (match_operand:SI 0 "register_operand" "=d") (unspec:SI [(reg:C
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -