⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sh.md

📁 GCC编译器源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
(define_insn "negc"  [(set (match_operand:SI 0 "arith_reg_operand" "=r")	(neg:SI (plus:SI (reg:SI 18)			 (match_operand:SI 1 "arith_reg_operand" "r"))))   (set (reg:SI 18)	(ne:SI (ior:SI (reg:SI 18) (match_dup 1))	       (const_int 0)))]  ""  "negc	%1,%0"  [(set_attr "type" "arith")])(define_expand "negdi2"  [(set (match_operand:DI 0 "arith_reg_operand" "")	(neg:DI (match_operand:DI 1 "arith_reg_operand" "")))   (clobber (reg:SI 18))]  ""  "{  int low_word = (TARGET_LITTLE_ENDIAN ? 0 : 1);  int high_word = (TARGET_LITTLE_ENDIAN ? 1 : 0);  rtx low_src = operand_subword (operands[1], low_word, 0, DImode);  rtx high_src = operand_subword (operands[1], high_word, 0, DImode);  rtx low_dst = operand_subword (operands[0], low_word, 1, DImode);  rtx high_dst = operand_subword (operands[0], high_word, 1, DImode);  emit_insn (gen_clrt ());  emit_insn (gen_negc (low_dst, low_src));  emit_insn (gen_negc (high_dst, high_src));  DONE;}")(define_insn "negsi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r")	(neg:SI (match_operand:SI 1 "arith_reg_operand" "r")))]  ""  "neg	%1,%0"  [(set_attr "type" "arith")])(define_insn "one_cmplsi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r")	(not:SI (match_operand:SI 1 "arith_reg_operand" "r")))]  ""  "not	%1,%0"  [(set_attr "type" "arith")]);; -------------------------------------------------------------------------;; Zero extension instructions;; -------------------------------------------------------------------------(define_insn "zero_extendhisi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r")	(zero_extend:SI (match_operand:HI 1 "arith_reg_operand" "r")))]  ""  "extu.w	%1,%0"  [(set_attr "type" "arith")])(define_insn "zero_extendqisi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r")	(zero_extend:SI (match_operand:QI 1 "arith_reg_operand" "r")))]  ""  "extu.b	%1,%0"  [(set_attr "type" "arith")])(define_insn "zero_extendqihi2"  [(set (match_operand:HI 0 "arith_reg_operand" "=r")	(zero_extend:HI (match_operand:QI 1 "arith_reg_operand" "r")))]  ""  "extu.b	%1,%0"  [(set_attr "type" "arith")]);; -------------------------------------------------------------------------;; Sign extension instructions;; -------------------------------------------------------------------------;; ??? This should be a define expand.;; ??? Or perhaps it should be dropped?/* There is no point in defining extendsidi2; convert_move generates good   code for that.  */(define_insn "extendhisi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r,r")	(sign_extend:SI (match_operand:HI 1 "general_movsrc_operand" "r,m")))]  ""  "@	exts.w	%1,%0   	mov.w	%1,%0"  [(set_attr "type" "arith,load")])(define_insn "extendqisi2"  [(set (match_operand:SI 0 "arith_reg_operand" "=r,r")	(sign_extend:SI (match_operand:QI 1 "general_movsrc_operand" "r,m")))]  ""  "@	exts.b	%1,%0	mov.b	%1,%0"  [(set_attr "type" "arith,load")])(define_insn "extendqihi2"  [(set (match_operand:HI 0 "arith_reg_operand" "=r,r")	(sign_extend:HI (match_operand:QI 1 "general_movsrc_operand" "r,m")))]  ""  "@	exts.b	%1,%0	mov.b	%1,%0"  [(set_attr "type" "arith,load")]);; -------------------------------------------------------------------------;; Move instructions;; -------------------------------------------------------------------------;; define push and pop so it is easy for sh.c(define_insn "push"  [(set (mem:SI (pre_dec:SI (reg:SI 15)))	(match_operand:SI 0 "register_operand" "r,l,x"))]  ""  "@	mov.l	%0,@-r15	sts.l	%0,@-r15	sts.l	%0,@-r15"  [(set_attr "type" "store,pstore,store")   (set_attr "hit_stack" "yes")])(define_insn "pop"  [(set (match_operand:SI 0 "register_operand" "=r,l,x")	(mem:SI (post_inc:SI (reg:SI 15))))]  ""  "@	mov.l	@r15+,%0	lds.l	@r15+,%0	lds.l	@r15+,%0"  [(set_attr "type" "load,pload,load")   (set_attr "hit_stack" "yes")])(define_insn "push_e"  [(set (mem:SF (pre_dec:SI (reg:SI 15)))	(match_operand:SF 0 "register_operand" "r,f,y"))]  "TARGET_SH3E"  "@	mov.l	%0,@-r15	fmov.s	%0,@-r15	sts.l	%0,@-r15"  [(set_attr "type" "store")   (set_attr "hit_stack" "yes")])(define_insn "pop_e"  [(set (match_operand:SF 0 "register_operand" "=r,f,y")	(mem:SF (post_inc:SI (reg:SI 15))))]  "TARGET_SH3E"  "@	mov.l	@r15+,%0	fmov.s	@r15+,%0	lds.l	@r15+,%0"  [(set_attr "type" "load")   (set_attr "hit_stack" "yes")]);; These two patterns can happen as the result of optimization, when;; comparisons get simplified to a move of zero or 1 into the T reg.;; They don't disappear completely, because the T reg is a fixed hard reg.(define_insn "clrt"  [(set (reg:SI 18) (const_int 0))]  ""  "clrt")(define_insn "sett"  [(set (reg:SI 18) (const_int 1))]  ""  "sett");; t/r is first, so that it will be preferred over r/r when reloading a move;; of a pseudo-reg into the T reg(define_insn "movsi_i"  [(set (match_operand:SI 0 "general_movdst_operand" "=t,r,r,r,r,r,m,<,<,xl,x,l,r")	(match_operand:SI 1 "general_movsrc_operand" "r,Q,rI,m,xl,t,r,x,l,r,>,>,i"))]  "   ! TARGET_SH3E   && (register_operand (operands[0], SImode)       || register_operand (operands[1], SImode))"  "@	cmp/pl	%1	mov.l	%1,%0	mov	%1,%0	mov.l	%1,%0	sts	%1,%0	movt	%0	mov.l	%1,%0	sts.l	%1,%0	sts.l	%1,%0	lds	%1,%0	lds.l	%1,%0	lds.l	%1,%0	fake	%1,%0"  [(set_attr "type" "*,pcload_si,move,load_si,move,move,store,store,pstore,move,load,pload,pcload_si")   (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*")]);; t/r must come after r/r, lest reload will try to reload stuff like;; (subreg:SI (reg:SF 38 fr14) 0) into T (compiling stdlib/strtod.c -m3e -O2);; ??? This allows moves from macl to fpul to be recognized, but these moves;; will require a reload.(define_insn "movsi_ie"  [(set (match_operand:SI 0 "general_movdst_operand" "=r,r,t,r,r,r,m,<,<,xl,x,l,r,y,r,y")	(match_operand:SI 1 "general_movsrc_operand" "Q,rI,r,m,xl,t,r,x,l,r,>,>,i,r,y,y"))]  "TARGET_SH3E   && (register_operand (operands[0], SImode)       || register_operand (operands[1], SImode))"  "@	mov.l	%1,%0	mov	%1,%0	cmp/pl	%1	mov.l	%1,%0	sts	%1,%0	movt	%0	mov.l	%1,%0	sts.l	%1,%0	sts.l	%1,%0	lds	%1,%0	lds.l	%1,%0	lds.l	%1,%0	fake	%1,%0	lds	%1,%0	sts	%1,%0	! move optimized away"  [(set_attr "type" "pcload_si,move,*,load_si,move,move,store,store,pstore,move,load,pload,pcload_si,gp_fpul,gp_fpul,nil")   (set_attr "length" "*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,0")])(define_insn "movsi_i_lowpart"  [(set (strict_low_part (match_operand:SI 0 "general_movdst_operand" "=r,r,r,r,r,m,r"))	(match_operand:SI 1 "general_movsrc_operand" "Q,rI,m,xl,t,r,i"))]   "register_operand (operands[0], SImode)    || register_operand (operands[1], SImode)"  "@	mov.l	%1,%0	mov	%1,%0	mov.l	%1,%0	sts	%1,%0	movt	%0	mov.l	%1,%0	fake	%1,%0"  [(set_attr "type" "pcload,move,load,move,move,store,pcload")])(define_expand "movsi"  [(set (match_operand:SI 0 "general_movdst_operand" "")	(match_operand:SI 1 "general_movsrc_operand" ""))]  ""  "{ if (prepare_move_operands (operands, SImode)) DONE; }")(define_insn "movqi_i"  [(set (match_operand:QI 0 "general_movdst_operand" "=r,r,m,r,r,l")	(match_operand:QI 1 "general_movsrc_operand"  "ri,m,r,t,l,r"))]  "arith_reg_operand (operands[0], QImode)   || arith_reg_operand (operands[1], QImode)"  "@	mov	%1,%0	mov.b	%1,%0	mov.b	%1,%0	movt	%0	sts	%1,%0	lds	%1,%0" [(set_attr "type" "move,load,store,move,move,move")])(define_expand "movqi"  [(set (match_operand:QI 0 "general_operand" "")	(match_operand:QI 1 "general_operand"  ""))]  ""  "{ if (prepare_move_operands (operands, QImode)) DONE; }")(define_insn "movhi_i"  [(set (match_operand:HI 0 "general_movdst_operand" "=r,r,r,r,m,r,l,r")	(match_operand:HI 1 "general_movsrc_operand" "Q,rI,m,t,r,l,r,i"))]  "arith_reg_operand (operands[0], HImode)   || arith_reg_operand (operands[1], HImode)"  "@	mov.w	%1,%0	mov	%1,%0	mov.w	%1,%0	movt	%0	mov.w	%1,%0	sts	%1,%0	lds	%1,%0	fake	%1,%0"  [(set_attr "type" "pcload,move,load,move,store,move,move,pcload")])(define_expand "movhi"  [(set (match_operand:HI 0 "general_movdst_operand" "")	(match_operand:HI 1 "general_movsrc_operand"  ""))]  ""  "{ if (prepare_move_operands (operands, HImode)) DONE; }");; ??? This should be a define expand.;; x/r can be created by inlining/cse, e.g. for execute/961213-1.c;; compiled with -m2 -ml -O3 -funroll-loops(define_insn ""  [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,m,r,r,r,*!x")	(match_operand:DI 1 "general_movsrc_operand" "Q,r,m,r,I,i,x,r"))]  "arith_reg_operand (operands[0], DImode)   || arith_reg_operand (operands[1], DImode)"  "* return output_movedouble (insn, operands, DImode);"  [(set_attr "length" "4")   (set_attr "type" "pcload,move,load,store,move,pcload,move,move")]);; If the output is a register and the input is memory or a register, we have;; to be careful and see which word needs to be loaded first.  (define_split  [(set (match_operand:DI 0 "general_movdst_operand" "")	(match_operand:DI 1 "general_movsrc_operand" ""))]  "reload_completed"  [(set (match_dup 2) (match_dup 3))   (set (match_dup 4) (match_dup 5))]  "{  int regno;  if ((GET_CODE (operands[0]) == MEM       && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)      || (GET_CODE (operands[1]) == MEM	  && GET_CODE (XEXP (operands[1], 0)) == POST_INC))    FAIL;  if (GET_CODE (operands[0]) == REG)    regno = REGNO (operands[0]);  else if (GET_CODE (operands[0]) == SUBREG)    regno = REGNO (SUBREG_REG (operands[0])) + SUBREG_WORD (operands[0]);  else if (GET_CODE (operands[0]) == MEM)    regno = -1;  if (regno == -1      || ! refers_to_regno_p (regno, regno + 1, operands[1], 0))    {      operands[2] = operand_subword (operands[0], 0, 0, DImode);      operands[3] = operand_subword (operands[1], 0, 0, DImode);      operands[4] = operand_subword (operands[0], 1, 0, DImode);      operands[5] = operand_subword (operands[1], 1, 0, DImode);    }  else    {      operands[2] = operand_subword (operands[0], 1, 0, DImode);      operands[3] = operand_subword (operands[1], 1, 0, DImode);      operands[4] = operand_subword (operands[0], 0, 0, DImode);      operands[5] = operand_subword (operands[1], 0, 0, DImode);    }  if (operands[2] == 0 || operands[3] == 0      || operands[4] == 0 || operands[5] == 0)    FAIL;}")(define_expand "movdi"  [(set (match_operand:DI 0 "general_movdst_operand" "")	(match_operand:DI 1 "general_movsrc_operand" ""))]  ""  "{ if ( prepare_move_operands (operands, DImode)) DONE; }");; ??? This should be a define expand.(define_insn "movdf_k"  [(set (match_operand:DF 0 "general_movdst_operand" "=r,r,r,m")	(match_operand:DF 1 "general_movsrc_operand" "r,FQ,m,r"))]  "arith_reg_operand (operands[0], DFmode)   || arith_reg_operand (operands[1], DFmode)"  "* return output_movedouble (insn, operands, DFmode);"  [(set_attr "length" "4")   (set_attr "type" "move,pcload,load,store")]);; If the output is a register and the input is memory or a register, we have;; to be careful and see which word needs to be loaded first.  (define_split  [(set (match_operand:DF 0 "general_movdst_operand" "")	(match_operand:DF 1 "general_movsrc_operand" ""))]  "reload_completed"  [(set (match_dup 2) (match_dup 3))   (set (match_dup 4) (match_dup 5))]  "{  int regno;  if ((GET_CODE (operands[0]) == MEM       && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)      || (GET_CODE (operands[1]) == MEM	  && GET_CODE (XEXP (operands[1], 0)) == POST_INC))    FAIL;  if (GET_CODE (operands[0]) == REG)    regno = REGNO (operands[0]);  else if (GET_CODE (operands[0]) == SUBREG)    regno = REGNO (SUBREG_REG (operands[0])) + SUBREG_WORD (operands[0]);  else if (GET_CODE (operands[0]) == MEM)    regno = -1;  if (regno == -1      || ! refers_to_regno_p (regno, regno + 1, operands[1], 0))    {      operands[2] = operand_subword (operands[0], 0, 0, DFmode);      operands[3] = operand_subword (operands[1], 0, 0, DFmode);      operands[4] = operand_subword (operands[0], 1, 0, DFmode);      operands[5] = operand_subword (operands[1], 1, 0, DFmode);    }  else    {      operands[2] = operand_subword (operands[0], 1, 0, DFmode);      operands[3] = operand_subwor

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -