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

📄 alpha.md

📁 gcc3.2.1源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
		     (const_int 56)))]  ""{  if (TARGET_BWX)    {      emit_insn (gen_extendqisi2x (operands[0],				   force_reg (QImode, operands[1])));      DONE;    }  /* If we have an unaligned MEM, extend to a DImode form of     the result (which we do specially).  */  if (unaligned_memory_operand (operands[1], QImode))    {      rtx temp = gen_reg_rtx (DImode);      emit_insn (gen_extendqidi2 (temp, operands[1]));      emit_move_insn (operands[0], gen_lowpart (SImode, temp));      DONE;    }  operands[0] = gen_lowpart (DImode, operands[0]);  operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1]));  operands[2] = gen_reg_rtx (DImode);})(define_expand "extendqidi2"  [(set (match_dup 2)	(ashift:DI (match_operand:QI 1 "some_operand" "")		   (const_int 56)))   (set (match_operand:DI 0 "register_operand" "")	(ashiftrt:DI (match_dup 2)		     (const_int 56)))]  ""{  if (TARGET_BWX)    {      emit_insn (gen_extendqidi2x (operands[0],				   force_reg (QImode, operands[1])));      DONE;    }  if (unaligned_memory_operand (operands[1], QImode))    {      rtx seq	= gen_unaligned_extendqidi (operands[0],				    get_unaligned_address (operands[1], 1));      alpha_set_memflags (seq, operands[1]);      emit_insn (seq);      DONE;    }  operands[1] = gen_lowpart (DImode, force_reg (QImode, operands[1]));  operands[2] = gen_reg_rtx (DImode);})(define_expand "extendhisi2"  [(set (match_dup 2)	(ashift:DI (match_operand:HI 1 "some_operand" "")		   (const_int 48)))   (set (match_operand:SI 0 "register_operand" "")	(ashiftrt:DI (match_dup 2)		     (const_int 48)))]  ""{  if (TARGET_BWX)    {      emit_insn (gen_extendhisi2x (operands[0],				   force_reg (HImode, operands[1])));      DONE;    }  /* If we have an unaligned MEM, extend to a DImode form of     the result (which we do specially).  */  if (unaligned_memory_operand (operands[1], HImode))    {      rtx temp = gen_reg_rtx (DImode);      emit_insn (gen_extendhidi2 (temp, operands[1]));      emit_move_insn (operands[0], gen_lowpart (SImode, temp));      DONE;    }  operands[0] = gen_lowpart (DImode, operands[0]);  operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1]));  operands[2] = gen_reg_rtx (DImode);})(define_expand "extendhidi2"  [(set (match_dup 2)	(ashift:DI (match_operand:HI 1 "some_operand" "")		   (const_int 48)))   (set (match_operand:DI 0 "register_operand" "")	(ashiftrt:DI (match_dup 2)		     (const_int 48)))]  ""{  if (TARGET_BWX)    {      emit_insn (gen_extendhidi2x (operands[0],				   force_reg (HImode, operands[1])));      DONE;    }  if (unaligned_memory_operand (operands[1], HImode))    {      rtx seq	= gen_unaligned_extendhidi (operands[0],				    get_unaligned_address (operands[1], 2));      alpha_set_memflags (seq, operands[1]);      emit_insn (seq);      DONE;    }  operands[1] = gen_lowpart (DImode, force_reg (HImode, operands[1]));  operands[2] = gen_reg_rtx (DImode);});; Here's how we sign extend an unaligned byte and halfword.  Doing this;; as a pattern saves one instruction.  The code is similar to that for;; the unaligned loads (see below).;;;; Operand 1 is the address + 1 (+2 for HI), operand 0 is the result.(define_expand "unaligned_extendqidi"  [(use (match_operand:QI 0 "register_operand" ""))   (use (match_operand:DI 1 "address_operand" ""))]  ""{  if (WORDS_BIG_ENDIAN)    emit_insn (gen_unaligned_extendqidi_be (operands[0], operands[1]));  else    emit_insn (gen_unaligned_extendqidi_le (operands[0], operands[1]));  DONE;})(define_expand "unaligned_extendqidi_le"  [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))   (set (match_dup 3)	(mem:DI (and:DI (plus:DI (match_dup 2) (const_int -1))			(const_int -8))))   (set (match_dup 4)	(ashift:DI (match_dup 3)		   (minus:DI (const_int 64)			     (ashift:DI			      (and:DI (match_dup 2) (const_int 7))			      (const_int 3)))))   (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)	(ashiftrt:DI (match_dup 4) (const_int 56)))]  "! WORDS_BIG_ENDIAN"{  operands[2] = gen_reg_rtx (DImode);  operands[3] = gen_reg_rtx (DImode);  operands[4] = gen_reg_rtx (DImode);})(define_expand "unaligned_extendqidi_be"  [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))   (set (match_dup 3) (plus:DI (match_dup 2) (const_int -1)))   (set (match_dup 4)	(mem:DI (and:DI (match_dup 3)			(const_int -8))))   (set (match_dup 5) (plus:DI (match_dup 2) (const_int -2)))   (set (match_dup 6)	(ashift:DI (match_dup 4)		   (ashift:DI		     (and:DI		       (plus:DI (match_dup 5) (const_int 1))		       (const_int 7))		     (const_int 3))))   (set (subreg:DI (match_operand:QI 0 "register_operand" "") 0)	(ashiftrt:DI (match_dup 6) (const_int 56)))]  "WORDS_BIG_ENDIAN"{  operands[2] = gen_reg_rtx (DImode);  operands[3] = gen_reg_rtx (DImode);  operands[4] = gen_reg_rtx (DImode);  operands[5] = gen_reg_rtx (DImode);  operands[6] = gen_reg_rtx (DImode);})(define_expand "unaligned_extendhidi"  [(use (match_operand:QI 0 "register_operand" ""))   (use (match_operand:DI 1 "address_operand" ""))]  ""{  operands[0] = gen_lowpart (DImode, operands[0]);  emit_insn ((WORDS_BIG_ENDIAN	      ? gen_unaligned_extendhidi_be	      : gen_unaligned_extendhidi_le) (operands[0], operands[1]));  DONE;})(define_expand "unaligned_extendhidi_le"  [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))   (set (match_dup 3)	(mem:DI (and:DI (plus:DI (match_dup 2) (const_int -2))			(const_int -8))))   (set (match_dup 4)	(ashift:DI (match_dup 3)		   (minus:DI (const_int 64)			     (ashift:DI			      (and:DI (match_dup 2) (const_int 7))			      (const_int 3)))))   (set (match_operand:DI 0 "register_operand" "")	(ashiftrt:DI (match_dup 4) (const_int 48)))]  "! WORDS_BIG_ENDIAN"{  operands[2] = gen_reg_rtx (DImode);  operands[3] = gen_reg_rtx (DImode);  operands[4] = gen_reg_rtx (DImode);})(define_expand "unaligned_extendhidi_be"  [(set (match_dup 2) (match_operand:DI 1 "address_operand" ""))   (set (match_dup 3) (plus:DI (match_dup 2) (const_int -2)))   (set (match_dup 4)	(mem:DI (and:DI (match_dup 3)			(const_int -8))))   (set (match_dup 5) (plus:DI (match_dup 2) (const_int -3)))   (set (match_dup 6)	(ashift:DI (match_dup 4)		   (ashift:DI		     (and:DI		       (plus:DI (match_dup 5) (const_int 1))		       (const_int 7))		     (const_int 3))))   (set (match_operand:DI 0 "register_operand" "")	(ashiftrt:DI (match_dup 6) (const_int 48)))]  "WORDS_BIG_ENDIAN"{  operands[2] = gen_reg_rtx (DImode);  operands[3] = gen_reg_rtx (DImode);  operands[4] = gen_reg_rtx (DImode);  operands[5] = gen_reg_rtx (DImode);  operands[6] = gen_reg_rtx (DImode);})(define_insn "*extxl_const"  [(set (match_operand:DI 0 "register_operand" "=r")	(zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")			 (match_operand:DI 2 "mode_width_operand" "n")			 (match_operand:DI 3 "mul8_operand" "I")))]  ""  "ext%M2l %r1,%s3,%0"  [(set_attr "type" "shift")])(define_insn "extxl_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")			 (match_operand:DI 2 "mode_width_operand" "n")			 (ashift:DI (match_operand:DI 3 "reg_or_8bit_operand" "rI")				    (const_int 3))))]  "! WORDS_BIG_ENDIAN"  "ext%M2l %r1,%3,%0"  [(set_attr "type" "shift")])(define_insn "extxl_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(zero_extract:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")			 (match_operand:DI 2 "mode_width_operand" "n")			 (minus:DI			   (const_int 56)			   (ashift:DI			     (match_operand:DI 3 "reg_or_8bit_operand" "rI")			     (const_int 3)))))]  "WORDS_BIG_ENDIAN"  "ext%M2l %r1,%3,%0"  [(set_attr "type" "shift")]);; Combine has some strange notion of preserving existing undefined behaviour;; in shifts larger than a word size.  So capture these patterns that it;; should have turned into zero_extracts.(define_insn "*extxl_1_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI (lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")		  (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")			     (const_int 3)))	     (match_operand:DI 3 "mode_mask_operand" "n")))]  "! WORDS_BIG_ENDIAN"  "ext%U3l %1,%2,%0"  [(set_attr "type" "shift")])(define_insn "*extxl_1_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI (lshiftrt:DI		  (match_operand:DI 1 "reg_or_0_operand" "rJ")		  (minus:DI (const_int 56)		    (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")			       (const_int 3))))		(match_operand:DI 3 "mode_mask_operand" "n")))]  "WORDS_BIG_ENDIAN"  "ext%U3l %1,%2,%0"  [(set_attr "type" "shift")])(define_insn "*extql_2_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(lshiftrt:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")	  (ashift:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")		     (const_int 3))))]  "! WORDS_BIG_ENDIAN"  "extql %1,%2,%0"  [(set_attr "type" "shift")])(define_insn "*extql_2_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(lshiftrt:DI	  (match_operand:DI 1 "reg_or_0_operand" "rJ")	  (minus:DI (const_int 56)		    (ashift:DI		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")		      (const_int 3)))))]  "WORDS_BIG_ENDIAN"  "extql %1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extqh_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(ashift:DI	 (match_operand:DI 1 "reg_or_0_operand" "rJ")	  (minus:DI (const_int 64)		    (ashift:DI		     (and:DI		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")		      (const_int 7))		     (const_int 3)))))]  "! WORDS_BIG_ENDIAN"  "extqh %r1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extqh_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(ashift:DI	  (match_operand:DI 1 "reg_or_0_operand" "rJ")	  (ashift:DI	    (and:DI	      (plus:DI (match_operand:DI 2 "reg_or_8bit_operand" "rI")		       (const_int 1))	      (const_int 7))	    (const_int 3))))]  "WORDS_BIG_ENDIAN"  "extqh %r1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extlh_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(ashift:DI	 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")		 (const_int 2147483647))	 (minus:DI (const_int 64)		    (ashift:DI		     (and:DI		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")		      (const_int 7))		     (const_int 3)))))]  "! WORDS_BIG_ENDIAN"  "extlh %r1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extlh_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI	  (ashift:DI	    (match_operand:DI 1 "reg_or_0_operand" "rJ")	    (ashift:DI	      (and:DI		(plus:DI		  (match_operand:DI 2 "reg_or_8bit_operand" "rI")		  (const_int 1))		(const_int 7))	      (const_int 3)))	  (const_int 2147483647)))]  "WORDS_BIG_ENDIAN"  "extlh %r1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extwh_le"  [(set (match_operand:DI 0 "register_operand" "=r")	(ashift:DI	 (and:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")		 (const_int 65535))	 (minus:DI (const_int 64)		    (ashift:DI		     (and:DI		      (match_operand:DI 2 "reg_or_8bit_operand" "rI")		      (const_int 7))		     (const_int 3)))))]  "! WORDS_BIG_ENDIAN"  "extwh %r1,%2,%0"  [(set_attr "type" "shift")])(define_insn "extwh_be"  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI	  (ashift:DI (match_operand:DI 1 "reg_or_0_operand" "rJ")		     (ashift:DI		       (and:DI			 (plus:DI			   (match_operand:DI 2 "reg_or_8bit_operand" "rI")			   (const_int 1))			 (const_int 7))		       (const_int 3)))	  (const_int 65535)))]  "WORDS_BIG_ENDIAN"  "extwh %r1,%2,%0"  [(set_attr "type" "shift")]);; This converts an extXl into an extXh with an appropriate adjustment;; to the address calculation.;;(define_split;;  [(set (match_operand:DI 0 "register_operand" "");;	(ashift:DI (zero_extract:DI (match_operand:DI 1 "register_operand" "");;				    (match_operand:DI 2 "mode_width_operand" "");;				    (ashift:DI (match_operand:DI 3 "" "");;					       (const_int 3)));;		   (match_operand:DI 4 "const_int_operand" "")));;   (clobber (match_operand:DI 5 "register_operand" ""))];;  "INTVAL (operands[4]) == 64 - INTVAL (operands[2])";;  [(set (match_dup 5) (match_dup 6

⌨️ 快捷键说明

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