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

📄 ns32k.md

📁 GCC编译器源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
	(neg:DF (match_operand:DF 1 "general_operand" "fmF")))]  "TARGET_32081"  "negl %1,%0")(define_insn "negsf2"  [(set (match_operand:SF 0 "general_operand" "=fm<")	(neg:SF (match_operand:SF 1 "general_operand" "fmF")))]  "TARGET_32081"  "negf %1,%0")(define_insn "negdi2"  [(set (match_operand:DI 0 "general_operand" "=ro")	(neg:DI (match_operand:DI 1 "general_operand" "ro")))]  ""  "*{  rtx low[2], high[2], xops[4];  split_di (operands, 2, low, high);  xops[0] = low[0];  xops[1] = high[0];  xops[2] = low[1];  xops[3] = high[1];  if (rtx_equal_p (operands[0], operands[1]))    {      output_asm_insn (\"negd %3,%1\", xops);      output_asm_insn (\"negd %2,%0\", xops);      output_asm_insn (\"subcd %$0,%1\", xops);    }  else    {      output_asm_insn (\"negd %2,%0\", xops);      output_asm_insn (\"movqd %$0,%1\", xops);      output_asm_insn (\"subcd %3,%1\", xops);    }  return \"\"; }")(define_insn "negsi2"  [(set (match_operand:SI 0 "general_operand" "=g<")	(neg:SI (match_operand:SI 1 "general_operand" "rmn")))]  ""  "negd %1,%0")(define_insn "neghi2"  [(set (match_operand:HI 0 "general_operand" "=g<")	(neg:HI (match_operand:HI 1 "general_operand" "g")))]  ""  "negw %1,%0")(define_insn "negqi2"  [(set (match_operand:QI 0 "general_operand" "=g<")	(neg:QI (match_operand:QI 1 "general_operand" "g")))]  ""  "negb %1,%0")(define_insn "one_cmplsi2"  [(set (match_operand:SI 0 "general_operand" "=g<")	(not:SI (match_operand:SI 1 "general_operand" "rmn")))]  ""  "comd %1,%0")(define_insn "one_cmplhi2"  [(set (match_operand:HI 0 "general_operand" "=g<")	(not:HI (match_operand:HI 1 "general_operand" "g")))]  ""  "comw %1,%0")(define_insn "one_cmplqi2"  [(set (match_operand:QI 0 "general_operand" "=g<")	(not:QI (match_operand:QI 1 "general_operand" "g")))]  ""  "comb %1,%0");; arithmetic left and right shift operations;; on the 32532 we will always use lshd for arithmetic left shifts,;; because it is three times faster.  Broken programs which;; use negative shift counts are probably broken differently;; than elsewhere.;; alternative 0 never matches on the 32532(define_insn "ashlsi3"  [(set (match_operand:SI 0 "general_operand" "=g,g")	(ashift:SI (match_operand:SI 1 "general_operand" "r,0")		   (match_operand:SI 2 "general_operand" "I,rmn")))]  ""  "*{ if (TARGET_32532)    return \"lshd %2,%0\";  else    return output_shift_insn (operands);}")(define_insn "ashlhi3"  [(set (match_operand:HI 0 "general_operand" "=g")	(ashift:HI (match_operand:HI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "rmn")))]  ""  "*{ if (GET_CODE (operands[2]) == CONST_INT)    {      if (INTVAL (operands[2]) == 1)	return \"addw %0,%0\";      else if (! TARGET_32532 && INTVAL (operands[2]) == 2)	return \"addw %0,%0\;addw %0,%0\";    }  if (TARGET_32532)    return \"lshw %2,%0\";  else    return \"ashw %2,%0\";}")(define_insn "ashlqi3"  [(set (match_operand:QI 0 "general_operand" "=g")	(ashift:QI (match_operand:QI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "rmn")))]  ""  "*{ if (GET_CODE (operands[2]) == CONST_INT)    {      if (INTVAL (operands[2]) == 1)	return \"addb %0,%0\";      else if (! TARGET_32532 && INTVAL (operands[2]) == 2)	return \"addb %0,%0\;addb %0,%0\";    }  if (TARGET_32532)    return \"lshb %2,%0\";  else    return \"ashb %2,%0\";}");; Arithmetic right shift on the 32k works by negating the shift count.(define_expand "ashrsi3"  [(set (match_operand:SI 0 "general_operand" "=g")	(ashiftrt: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 ""  [(set (match_operand:SI 0 "general_operand" "=g")	(ashiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashd %$%n2,%0")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=g")	(ashiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "ashd %2,%0")(define_expand "ashrhi3"  [(set (match_operand:HI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:HI 0 "general_operand" "=g")	(ashiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashw %$%n2,%0")(define_insn ""  [(set (match_operand:HI 0 "general_operand" "=g")	(ashiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "ashw %2,%0")(define_expand "ashrqi3"  [(set (match_operand:QI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:QI 0 "general_operand" "=g")	(ashiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "ashb %$%n2,%0")(define_insn ""  [(set (match_operand:QI 0 "general_operand" "=g")	(ashiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_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 "general_operand" "=g")	(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 ""  [(set (match_operand:SI 0 "general_operand" "=g")	(lshiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshd %$%n2,%0")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=g")	(lshiftrt:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "lshd %2,%0")(define_expand "lshrhi3"  [(set (match_operand:HI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:HI 0 "general_operand" "=g")	(lshiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshw %$%n2,%0")(define_insn ""  [(set (match_operand:HI 0 "general_operand" "=g")	(lshiftrt:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "lshw %2,%0")(define_expand "lshrqi3"  [(set (match_operand:QI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:QI 0 "general_operand" "=g")	(lshiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "lshb %$%n2,%0")(define_insn ""  [(set (match_operand:QI 0 "general_operand" "=g")	(lshiftrt:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "lshb %2,%0");; Rotate instructions(define_insn "rotlsi3"  [(set (match_operand:SI 0 "general_operand" "=g")	(rotate:SI (match_operand:SI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "rmn")))]  ""  "rotd %2,%0")(define_insn "rotlhi3"  [(set (match_operand:HI 0 "general_operand" "=g")	(rotate:HI (match_operand:HI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "rmn")))]  ""  "rotw %2,%0")(define_insn "rotlqi3"  [(set (match_operand:QI 0 "general_operand" "=g")	(rotate:QI (match_operand:QI 1 "general_operand" "0")		   (match_operand:SI 2 "general_operand" "rmn")))]  ""  "rotb %2,%0");; Right rotate on the 32k works by negating the shift count.(define_expand "rotrsi3"  [(set (match_operand:SI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:SI 0 "general_operand" "=g")	(rotatert:SI (match_operand:SI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotd %$%n2,%0")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "=g")	(rotatert:SI (match_operand:SI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "rotd %2,%0")(define_expand "rotrhi3"  [(set (match_operand:HI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:HI 0 "general_operand" "=g")	(rotatert:HI (match_operand:HI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotw %$%n2,%0")(define_insn ""  [(set (match_operand:HI 0 "general_operand" "=g")	(rotatert:HI (match_operand:HI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_operand" "r"))))]  ""  "rotw %2,%0")(define_expand "rotrqi3"  [(set (match_operand:QI 0 "general_operand" "=g")	(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 ""  [(set (match_operand:QI 0 "general_operand" "=g")	(rotatert:QI (match_operand:QI 1 "general_operand" "0")		     (match_operand:SI 2 "immediate_operand" "i")))]  ""  "rotb %$%n2,%0")(define_insn ""  [(set (match_operand:QI 0 "general_operand" "=g")	(rotatert:QI (match_operand:QI 1 "general_operand" "0")		     (neg:SI (match_operand:SI 2 "general_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 ""  [(set (match_operand:SI 0 "general_operand" "=g<")	(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_rtx (CONST_INT, VOIDmode, 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 then using power-of-2 shifts if we can use them;;(define_insn "";  [(set (match_operand:SI 0 "register_operand" "=r");	(plus:SI (match_operand:SI 1 "general_operand" "rmn");		 (mult:SI (match_operand:SI 2 "register_operand" "0");			  (plus:SI (match_operand:SI 3 "general_operand" "rmn") (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" "rmn") (const_int 1)));		 (match_operand:SI 3 "general_operand" "rmn")))];  "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 8";  "indexd %0,%2,%3");; Set, Clear, and Invert bit(define_insn ""  [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "+g")			 (const_int 1)			 (match_operand:SI 1 "general_operand" "rmn"))	(const_int 1))]  ""  "sbitd %1,%0")(define_insn ""  [(set (zero_extract:SI (match_operand:SI 0 "general_operand" "+g")			 (const_int 1)			 (match_operand:SI 1 "general_operand" "rmn"))	(const_int 0))]  ""  "cbitd %1,%0")(define_insn ""  [(set (match_operand:SI 0 "general_operand" "+g")	(xor:SI (ashift:SI (const_int 1)			   (match_operand:SI 1 "general_operand" "rmn"))		(match_dup 0)))]  ""  "ibitd %1,%0")(define_insn ""  [(set (match_operand:QI 0 "general_operand" "=g")	(xor:QI (subreg:QI		 (ashift:SI (const_int 1)			    (match_operand:QI 1 "general_operand" "rmn")) 0)		(match_dup 0)))]  ""  "ibitb %1,%0");; Recognize jbs and jbc instructions.(define_insn ""  [(set (cc0)	(zero_extract (match_operand:SI 0 "general_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 bitfield 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.

⌨️ 快捷键说明

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