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

📄 ns32k.md

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 MD
📖 第 1 页 / 共 5 页
字号:
  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*ashrisi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(ashiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashd %n2,%0")(define_insn "*ashrsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(ashiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "ashd %2,%0")(define_expand "ashrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(ashiftrt:HI (match_operand:HI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*ashrihi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(ashiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashw %n2,%0")(define_insn "*ashrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(ashiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "ashw %2,%0")(define_expand "ashrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(ashiftrt:QI (match_operand:QI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*ashriqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(ashiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashb %n2,%0")(define_insn "*ashrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(ashiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "ashb %2,%0");; logical shift instructions;; Logical right shift on the 32k works by negating the shift count.(define_expand "lshrsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(lshiftrt:SI (match_operand:SI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*lshrisi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(lshiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshd %n2,%0")(define_insn "*lshrsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(lshiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "lshd %2,%0")(define_expand "lshrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(lshiftrt:HI (match_operand:HI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*lshrihi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(lshiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshw %n2,%0")(define_insn "*lshrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(lshiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "lshw %2,%0")(define_expand "lshrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(lshiftrt:QI (match_operand:QI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*lshriqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(lshiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshb %n2,%0")(define_insn "*lshrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(lshiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "lshb %2,%0");; Rotate instructions;; See note 1(define_insn "rotlsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(rotate:SI (match_operand:SI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "g")))]  ""  "rotd %2,%0")(define_insn "rotlhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(rotate:HI (match_operand:HI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "g")))]  ""  "rotw %2,%0")(define_insn "rotlqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(rotate:QI (match_operand:QI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "g")))]  ""  "rotb %2,%0");; Right rotate on the 32k works by negating the shift count.(define_expand "rotrsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(rotatert:SI (match_operand:SI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*rotrisi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(rotatert:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotd %n2,%0")(define_insn "*rotrsi3"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm")	(rotatert:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "rotd %2,%0")(define_expand "rotrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(rotatert:HI (match_operand:HI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*rotrihi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(rotatert:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotw %n2,%0")(define_insn "*rotrhi3"  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm")	(rotatert:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "rotw %2,%0")(define_expand "rotrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(rotatert:QI (match_operand:QI 1 "general_operand" "g")		     (match_operand:SI 2 "general_operand" "g")))]  ""  "{  if (GET_CODE (operands[2]) != CONST_INT)    operands[2] = gen_rtx_NEG (SImode, negate_rtx (SImode, operands[2]));}")(define_insn "*rotriqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(rotatert:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotb %n2,%0")(define_insn "*rotrqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(rotatert:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "register_operand" "r"))))]  ""  "rotb %2,%0");;- load or push effective address ;; These come after the move, add, and multiply patterns;; because we don't want pushl $1 turned into pushad 1.(define_insn "*addrsi"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm<")	(match_operand:QI 1 "address_operand" "p"))]  ""  "*{  if (REG_P (operands[0])      && GET_CODE (operands[1]) == MULT      && GET_CODE (XEXP (operands[1], 1)) == CONST_INT      && (INTVAL (XEXP (operands[1], 1)) == 2	  || INTVAL (XEXP (operands[1], 1)) == 4))    {      rtx xoperands[3];      xoperands[0] = operands[0];      xoperands[1] = XEXP (operands[1], 0);      xoperands[2] = GEN_INT (INTVAL (XEXP (operands[1], 1)) >> 1);      return output_shift_insn (xoperands);    }  return \"addr %a1,%0\";}");;; Index insns.  These are about the same speed as multiply-add counterparts.;;; but slower than using power-of-2 shifts if we can use them;;;; See note 1;(define_insn "";  [(set (match_operand:SI 0 "register_operand" "=r");	(plus:SI (match_operand:SI 1 "general_operand" "g");		 (mult:SI (match_operand:SI 2 "register_operand" "0");			  (plus:SI (match_operand:SI 3 "general_operand" "g") (const_int 1)))))];  "GET_CODE (operands[3]) != CONST_INT || INTVAL (operands[3]) > 8";  "indexd %0,%3,%1");;(define_insn "";  [(set (match_operand:SI 0 "register_operand" "=r");	(plus:SI (mult:SI (match_operand:SI 1 "register_operand" "0");			  (plus:SI (match_operand:SI 2 "general_operand" "g") (const_int 1)));		 (match_operand:SI 3 "general_operand" "g")))];  "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 8";  "indexd %0,%2,%3");; Set, Clear, and Invert bit;; See note 1(define_insn "*sbitsi"  [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "+rm")			 (const_int 1)			 (match_operand:SI 1 "general_operand" "g"))	(const_int 1))]  ""  "sbitd %1,%0");; See note 1(define_insn "*cbitsi"  [(set (zero_extract:SI (match_operand:SI 0 "nonimmediate_operand" "+rm")			 (const_int 1)			 (match_operand:SI 1 "general_operand" "g"))	(const_int 0))]  ""  "cbitd %1,%0");; See note 1(define_insn "*ibitsi"  [(set (match_operand:SI 0 "nonimmediate_operand" "+rm")	(xor:SI (ashift:SI (const_int 1)			   (match_operand:SI 1 "general_operand" "g"))		(match_dup 0)))]  ""  "ibitd %1,%0");; See note 1(define_insn "*ibitqi"  [(set (match_operand:QI 0 "nonimmediate_operand" "=rm")	(xor:QI (subreg:QI		 (ashift:SI (const_int 1)			    (match_operand:QI 1 "general_operand" "g")) 0)		(match_dup 0)))]  ""  "ibitb %1,%0");; Recognize jbs and jbc instructions.(define_insn "*tbit"  [(set (cc0)	(zero_extract (match_operand:SI 0 "nonimmediate_operand" "rm")		      (const_int 1)		      (match_operand:SI 1 "general_operand" "g")))]  ""  "*{ cc_status.flags = CC_Z_IN_F;  return \"tbitd %1,%0\";}");; extract(base, width, offset);; Signed bit-field extraction is not supported in hardware on the;; NS 32032.  It is therefore better to let GCC figure out a;; good strategy for generating the proper instruction sequence;; and represent it as rtl.;; Optimize the case of extracting a byte or word from a register.;; Otherwise we must load a register with the offset of the;; chunk we want, and perform an extract insn (each of which;; is very expensive).  Since we use the stack to do our bit-twiddling;; we cannot use it for a destination.  Perhaps things are fast;; enough on the 32532 that such hacks are not needed.(define_insn "*extract_bytes"  [(set (match_operand:SI 0 "nonimmediate_operand" "=ro")	(zero_extract:SI (match_operand:SI 1 "register_operand" "r")			 (match_operand:SI 2 "const_int_operand" "i")			 (match_operand:SI 3 "const_int_operand" "i")))]  "(INTVAL (operands[2]) == 8 || INTVAL (operands[2]) == 16)   && (INTVAL (operands[3]) == 8 || INTVAL (operands[3]) == 16 || INTVAL (operands[3]) == 24)"  "*{  output_asm_insn (\"movd %1,tos\", operands);  if (INTVAL (operands[2]) == 16)    {      if (INTVAL (operands[3]) == 8)	output_asm_insn (\"movzwd 1(sp),%0\", operands);      else	output_asm_insn (\"movzwd 2(sp),%0\", operands);    }  else    {      if (INTVAL (operands[3]) == 8)	output_asm_insn (\"movzbd 1(sp),%0\", operands);      else if (INTVAL (operands[3]) == 16)	output_asm_insn (\"movzbd 2(sp),%0\", operands);      else	output_asm_insn (\"movzbd 3(sp),%0\", operands);    }  if (TARGET_32532 || TARGET_32332)    return \"cmpqd %$0,tos\";  else    return \"adjspb %$-4\";}");; The exts/ext instructions have the problem that they always access;; 32 bits even if the bit-field is smaller. For example the instruction;; 	extsd 7(r1),r0,2,5;; would read not only at address 7(r1) but also at 8(r1) to 10(r1).;; If these addresses are in a different (unmapped) page a memory fault;; is the result.;;;; Timing considerations:;;	movd	0(r1),r0	3 bytes;;	lshd	-26,r0		4;;	andd	0x1f,r0		5;; takes about 13 cycles on the 532 while;;	extsd	7(r1),r0,2,5	5 bytes;; takes about 21 cycles.;;;; The inss/ins instructions suffer from the same problem.;;;; A machine specific option (-mbitfield/-mnobitfield) is used;; to allow/disallow the use of these instructions.(define_insn "*bitfield_ext"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm<")	(zero_extract:SI (match_operand:SI 1 "register_operand" "g")			 (match_operand:SI 2 "const_int_operand" "i")			 (match_operand:SI 3 "nonmemory_operand" "rK")))]  "TARGET_BITFIELD"  "*{ if (GET_CODE (operands[3]) == CONST_INT)    return \"extsd %1,%0,%3,%2\";  else return \"extd %3,%1,%0,%2\";}")(define_insn "extzv"  [(set (match_operand:SI 0 "nonimmediate_operand" "=rm<")	(zero_extract:SI (match_operand:QI 1 "general_operand" "g")			 (match_operand:SI 2 "const_int_operand" "i")			 (match_operand:SI 3 "nonmemory_operand" "rK")))]  "TARGET_BITFIELD"  "*{ if (GET_CODE (operands[3]) == CONST_INT)    return \"extsd %1,%0,%3,%2\";  else return \"extd %3,%1,%0,%2\";}")(define_insn "*bitfield_set"  [(set (zero_extract:SI (match_operand:SI 0 "memory_operand" "+o,+r")			 (match_operand:SI 1 "const_int_operand" "i,i")			 (match_operand:SI 2 "nonmemory_operand" "rn,rK"))	(match_operand:SI 3 "nonimmediate_operand" "rm,rm"))]  "TARGET_BITFIELD"  "*{ if

⌨️ 快捷键说明

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