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

📄 sparc.md

📁 早期freebsd实现
💻 MD
📖 第 1 页 / 共 5 页
字号:
(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI (match_operand:DI 1 "arith_double_operand" "%r")		(match_operand:DI 2 "arith_double_operand" "rHI")))]  ""  "*{  rtx op2 = operands[2];  /* If constant is positive, upper bits zeroed, otherwise unchanged.     Give the assembler a chance to pick the move instruction. */  if (GET_CODE (op2) == CONST_INT)    {      int sign = INTVAL (op2);      if (sign < 0)	return \"mov %1,%0\;and %R1,%2,%R0\";      return \"mov 0,%0\;and %R1,%2,%R0\";    }  else if (GET_CODE (op2) == CONST_DOUBLE)    {      int sign = CONST_DOUBLE_HIGH (op2);      operands[2] = gen_rtx (CONST_INT, VOIDmode,			     CONST_DOUBLE_LOW (operands[1]));      if (sign < 0)	return \"mov %1,%0\;and %R1,%2,%R0\";      return \"mov 0,%0\;and %R1,%2,%R0\";    }  return \"and %1,%2,%0\;and %R1,%R2,%R0\";}"  [(set_attr "length" "2")])(define_insn "andsi3"  [(set (match_operand:SI 0 "register_operand" "=r")	(and:SI (match_operand:SI 1 "arith_operand" "%r")		(match_operand:SI 2 "arith_operand" "rI")))]  ""  "and %1,%2,%0")(define_split  [(set (match_operand:SI 0 "register_operand" "")	(and:SI (match_operand:SI 1 "register_operand" "")		(match_operand:SI 2 "" "")))   (clobber (match_operand:SI 3 "register_operand" ""))]  "GET_CODE (operands[2]) == CONST_INT   && !SMALL_INT (operands[2])   && (INTVAL (operands[2]) & 0x3ff) == 0x3ff"  [(set (match_dup 3) (match_dup 4))   (set (match_dup 0) (and:SI (not:SI (match_dup 3)) (match_dup 1)))]  "{  operands[4] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));}")(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(and:DI (not:DI (match_operand:DI 1 "register_operand" "r"))		(match_operand:DI 2 "register_operand" "r")))]  ""  "andn %2,%1,%0\;andn %R2,%R1,%R0"  [(set_attr "length" "2")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=r")	(and:SI (not:SI (match_operand:SI 1 "register_operand" "r"))		(match_operand:SI 2 "register_operand" "r")))]  ""  "andn %2,%1,%0")(define_expand "iordi3"  [(set (match_operand:DI 0 "register_operand" "")	(ior:DI (match_operand:DI 1 "arith_double_operand" "")		(match_operand:DI 2 "arith_double_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(ior:DI (match_operand:DI 1 "arith_double_operand" "%r")		(match_operand:DI 2 "arith_double_operand" "rHI")))]  ""  "*{  rtx op2 = operands[2];  /* If constant is positive, upper bits zeroed, otherwise unchanged.     Give the assembler a chance to pick the move instruction. */  if (GET_CODE (op2) == CONST_INT)    {      int sign = INTVAL (op2);      if (sign < 0)	return \"mov -1,%0\;or %R1,%2,%R0\";      return \"mov %1,%0\;or %R1,%2,%R0\";    }  else if (GET_CODE (op2) == CONST_DOUBLE)    {      int sign = CONST_DOUBLE_HIGH (op2);      operands[2] = gen_rtx (CONST_INT, VOIDmode,			     CONST_DOUBLE_LOW (operands[1]));      if (sign < 0)	return \"mov -1,%0\;or %R1,%2,%R0\";      return \"mov %1,%0\;or %R1,%2,%R0\";    }  return \"or %1,%2,%0\;or %R1,%R2,%R0\";}"  [(set_attr "length" "2")])(define_insn "iorsi3"  [(set (match_operand:SI 0 "register_operand" "=r")	(ior:SI (match_operand:SI 1 "arith_operand" "%r")		(match_operand:SI 2 "arith_operand" "rI")))]  ""  "or %1,%2,%0")(define_split  [(set (match_operand:SI 0 "register_operand" "")	(ior:SI (match_operand:SI 1 "register_operand" "")		(match_operand:SI 2 "" "")))   (clobber (match_operand:SI 3 "register_operand" ""))]  "GET_CODE (operands[2]) == CONST_INT   && !SMALL_INT (operands[2])   && (INTVAL (operands[2]) & 0x3ff) == 0x3ff"  [(set (match_dup 3) (match_dup 4))   (set (match_dup 0) (ior:SI (not:SI (match_dup 3)) (match_dup 1)))]  "{  operands[4] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));}")(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(ior:DI (not:DI (match_operand:DI 1 "register_operand" "r"))		(match_operand:DI 2 "register_operand" "r")))]  ""  "orn %2,%1,%0\;orn %R2,%R1,%R0"  [(set_attr "length" "2")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=r")	(ior:SI (not:SI (match_operand:SI 1 "register_operand" "r"))		(match_operand:SI 2 "register_operand" "r")))]  ""  "orn %2,%1,%0")(define_expand "xordi3"  [(set (match_operand:DI 0 "register_operand" "")	(xor:DI (match_operand:DI 1 "arith_double_operand" "")		(match_operand:DI 2 "arith_double_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(xor:DI (match_operand:DI 1 "arith_double_operand" "%r")		(match_operand:DI 2 "arith_double_operand" "rHI")))]  ""  "*{  rtx op2 = operands[2];  /* If constant is positive, upper bits zeroed, otherwise unchanged.     Give the assembler a chance to pick the move instruction. */  if (GET_CODE (op2) == CONST_INT)    {      int sign = INTVAL (op2);      if (sign < 0)	return \"xor %1,-1,%0\;xor %R1,%2,%R0\";      return \"mov %1,%0\;xor %R1,%2,%R0\";    }  else if (GET_CODE (op2) == CONST_DOUBLE)    {      int sign = CONST_DOUBLE_HIGH (op2);      operands[2] = gen_rtx (CONST_INT, VOIDmode,			     CONST_DOUBLE_LOW (operands[1]));      if (sign < 0)	return \"xor %1,-1,%0\;xor %R1,%2,%R0\";      return \"mov %1,%0\;xor %R1,%2,%R0\";    }  return \"xor %1,%2,%0\;xor %R1,%R2,%R0\";}"  [(set_attr "length" "2")])(define_insn "xorsi3"  [(set (match_operand:SI 0 "register_operand" "=r")	(xor:SI (match_operand:SI 1 "arith_operand" "%rJ")		(match_operand:SI 2 "arith_operand" "rI")))]  ""  "xor %r1,%2,%0")(define_split  [(set (match_operand:SI 0 "register_operand" "")	(xor:SI (match_operand:SI 1 "register_operand" "")		(match_operand:SI 2 "" "")))   (clobber (match_operand:SI 3 "register_operand" ""))]  "GET_CODE (operands[2]) == CONST_INT   && !SMALL_INT (operands[2])   && (INTVAL (operands[2]) & 0x3ff) == 0x3ff"  [(set (match_dup 3) (match_dup 4))   (set (match_dup 0) (not:SI (xor:SI (match_dup 3) (match_dup 1))))]  "{  operands[4] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));}")(define_split  [(set (match_operand:SI 0 "register_operand" "")	(not:SI (xor:SI (match_operand:SI 1 "register_operand" "")			(match_operand:SI 2 "" ""))))   (clobber (match_operand:SI 3 "register_operand" ""))]  "GET_CODE (operands[2]) == CONST_INT   && !SMALL_INT (operands[2])   && (INTVAL (operands[2]) & 0x3ff) == 0x3ff"  [(set (match_dup 3) (match_dup 4))   (set (match_dup 0) (xor:SI (match_dup 3) (match_dup 1)))]  "{  operands[4] = gen_rtx (CONST_INT, VOIDmode, ~INTVAL (operands[2]));}");; xnor patterns.  Note that (a ^ ~b) == (~a ^ b) == ~(a ^ b).;; Combine now canonicalizes to the rightmost expression.(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(not:DI (xor:DI (match_operand:DI 1 "register_operand" "r")			(match_operand:DI 2 "register_operand" "r"))))]  ""  "xnor %1,%2,%0\;xnor %R1,%R2,%R0"  [(set_attr "length" "2")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=r")	(not:SI (xor:SI (match_operand:SI 1 "reg_or_0_operand" "rJ")			(match_operand:SI 2 "arith_operand" "rI"))))]  ""  "xnor %r1,%2,%0");; These correspond to the above in the case where we also (or only);; want to set the condition code.  (define_insn ""  [(set (reg:CC 0)	(compare:CC	 (match_operator:SI 2 "cc_arithop"			    [(match_operand:SI 0 "arith_operand" "%r")			     (match_operand:SI 1 "arith_operand" "rI")])	 (const_int 0)))]  ""  "%A2cc %0,%1,%%g0"  [(set_attr "type" "compare")])(define_insn ""  [(set (reg:CC 0)	(compare:CC	 (match_operator:SI 3 "cc_arithop"			    [(match_operand:SI 1 "arith_operand" "%r")			     (match_operand:SI 2 "arith_operand" "rI")])	 (const_int 0)))   (set (match_operand:SI 0 "register_operand" "=r")	(match_dup 3))]  ""  "%A3cc %1,%2,%0")(define_insn ""  [(set (reg:CC 0)	(compare:CC	 (not:SI (xor:SI (match_operand:SI 0 "reg_or_0_operand" "%rJ")			 (match_operand:SI 1 "arith_operand" "rI")))	 (const_int 0)))]  ""  "xnorcc %r0,%1,%%g0"  [(set_attr "type" "compare")])(define_insn ""  [(set (reg:CC 0)	(compare:CC	 (not:SI (xor:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ")			 (match_operand:SI 2 "arith_operand" "rI")))	 (const_int 0)))   (set (match_operand:SI 0 "register_operand" "=r")	(not:SI (xor:SI (match_dup 1) (match_dup 2))))]  ""  "xnorcc %r1,%2,%0")(define_insn ""  [(set (reg:CC 0)	(compare:CC	 (match_operator:SI 2 "cc_arithopn"			    [(not:SI (match_operand:SI 0 "arith_operand" "rI"))			     (match_operand:SI 1 "reg_or_0_operand" "rJ")])	 (const_int 0)))]  ""  "%B2cc %r1,%0,%%g0"  [(set_attr "type" "compare")])(define_insn ""  [(set (reg:CC 0)	(compare:CC	 (match_operator:SI 3 "cc_arithopn"			    [(not:SI (match_operand:SI 1 "arith_operand" "rI"))			     (match_operand:SI 2 "reg_or_0_operand" "rJ")])	 (const_int 0)))   (set (match_operand:SI 0 "register_operand" "=r")	(match_dup 3))]  ""  "%B3cc %r2,%1,%0");; We cannot use the "neg" pseudo insn because the Sun assembler;; does not know how to make it work for constants.(define_insn "negdi2"  [(set (match_operand:DI 0 "register_operand" "=r")	(neg:DI (match_operand:DI 1 "register_operand" "r")))   (clobber (reg:SI 0))]  ""  "subcc %%g0,%R1,%R0\;subx %%g0,%1,%0"  [(set_attr "type" "unary")   (set_attr "length" "2")])(define_insn "negsi2"  [(set (match_operand:SI 0 "general_operand" "=r")	(neg:SI (match_operand:SI 1 "arith_operand" "rI")))]  ""  "sub %%g0,%1,%0"  [(set_attr "type" "unary")])(define_insn ""  [(set (reg:CC_NOOV 0)	(compare:CC_NOOV (neg:SI (match_operand:SI 0 "arith_operand" "rI"))			 (const_int 0)))]  ""  "subcc %%g0,%0,%%g0"  [(set_attr "type" "compare")])(define_insn ""  [(set (reg:CC_NOOV 0)	(compare:CC_NOOV (neg:SI (match_operand:SI 1 "arith_operand" "rI"))			 (const_int 0)))   (set (match_operand:SI 0 "register_operand" "=r")	(neg:SI (match_dup 1)))]  ""  "subcc %%g0,%1,%0"  [(set_attr "type" "unary")]);; We cannot use the "not" pseudo insn because the Sun assembler;; does not know how to make it work for constants.(define_expand "one_cmpldi2"  [(set (match_operand:DI 0 "register_operand" "=r")	(not:DI (match_operand:DI 1 "arith_double_operand" "rHI")))]  ""  "")(define_insn ""  [(set (match_operand:DI 0 "register_operand" "=r")	(not:DI (match_operand:DI 1 "arith_double_operand" "rHI")))]  ""  "*{  rtx op1 = operands[1];  if (GET_CODE (op1) == CONST_INT)    {      int sign = INTVAL (op1);      if (sign < 0)	return \"xnor %%g0,%1,%R0\;xnor %%g0,-1,%0\";      return \"xnor %%g0,%1,%R0\;xnor %%g0,0,%0\";    }  else if (GET_CODE (op1) == CONST_DOUBLE)    {      int sign = CONST_DOUBLE_HIGH (op1);      operands[1] = gen_rtx (CONST_INT, VOIDmode,			     CONST_DOUBLE_LOW (operands[1]));      if (sign < 0)	return \"xnor %%g0,%1,%R0\;xnor %%g0,-1,%0\";      return \"xnor %%g0,%1,%R0\;xnor %%g0,0,%0\";    }  return \"xnor %%g0,%1,%0\;xnor %%g0,%R1,%R0\";}"  [(set_attr "type" "unary")   (set_attr "length" "2")])(define_insn "one_cmplsi2"  [(set (match_operand:SI 0 "register_operand" "=r")	(not:SI (match_operand:SI 1 "arith_operand" "rI")))]  ""  "xnor %%g0,%1,%0"  [(set_attr "type" "unary")])(define_insn ""  [(set (reg:CC 0)	(compare:CC (not:SI (match_operand:SI 0 "arith_operand" "rI"))		    (const_int 0)))]  ""  "xnorcc %%g0,%0,%%g0"  [(set_attr "type" "compare")])(define_insn ""  [(set (reg:CC 0)	(compare:CC (not:SI (match_operand:SI 1 "arith_operand" "rI"))		    (const_int 0)))   (set (match_operand:SI 0 "register_operand" "=r")	(not:SI (match_dup 1)))]  ""  "xnorcc %%g0,%1,%0"  [(set_attr "type" "unary")]);; Floating point arithmetic instructions.(define_insn "addtf3"  [(set (match_operand:TF 0 "register_operand" "=f")	(plus:TF (match_operand:TF 1 "register_operand" "f")		 (match_operand:TF 2 "register_operand" "f")))]  ""  "faddq %1,%2,%0"  [(set_attr "type" "fp")])(define_insn "adddf3"  [(set (match_operand:DF 0 "register_operand" "=f")	(plus:DF (match_operand:DF 1 "register_operand" "f")		 (match_operand:DF 2 "register_operand" "f")))]  ""  "faddd %1,%2,%0"  [(set_attr "type" "fp")])(define_insn "addsf3"  [(set (match_operand:SF 0 "register_operand" "=f")	(plus:SF (match_operand:SF 1 "register_operand" "f")		 (match_operand:SF 2 "register_operand" "f")))]  ""  "fadds %1,%2,%0"  [(set_attr "type" "fp")])(define_insn "subtf3"  [(set (match_operand:TF 0 "register_operand" "=f")	(minus:TF (match_operand:TF 1 "register_operand" "f")		  (match_operand:TF 2 "register_operand" "f")))]  ""  "fsubq %1,%2,%0"  [(set_attr "type" "fp")])(define_insn "subdf3"  [(set (match_operand:DF 0 "register_operand" "=f")	(minus:DF (match_operand:DF 1 "register_operand" "f")		  (m

⌨️ 快捷键说明

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