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

📄 alpha.md

📁 早期freebsd实现
💻 MD
📖 第 1 页 / 共 5 页
字号:
{  enum machine_mode mode = alpha_compare_fp_p ? DFmode : DImode;  operands[1] = gen_reg_rtx (mode);  operands[2] = gen_rtx (LE, mode, alpha_compare_op0, alpha_compare_op1);  operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (mode));}")(define_expand "bgt"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  if (alpha_compare_fp_p)    {      operands[1] = gen_reg_rtx (DFmode);      operands[2] = gen_rtx (LT, DFmode, alpha_compare_op1, alpha_compare_op0);      operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));    }  else    {      operands[1] = gen_reg_rtx (DImode);      operands[2] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);      operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);    }}")(define_expand "bge"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  if (alpha_compare_fp_p)    {      operands[1] = gen_reg_rtx (DFmode);      operands[2] = gen_rtx (LE, DFmode, alpha_compare_op1, alpha_compare_op0);      operands[3] = gen_rtx (NE, VOIDmode, operands[1], CONST0_RTX (DFmode));    }  else    {      operands[1] = gen_reg_rtx (DImode);      operands[2] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);      operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);    }}")(define_expand "bltu"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  operands[1] = gen_reg_rtx (DImode);  operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);  operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);}")(define_expand "bleu"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  operands[1] = gen_reg_rtx (DImode);  operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);  operands[3] = gen_rtx (NE, VOIDmode, operands[1], const0_rtx);}")(define_expand "bgtu"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  operands[1] = gen_reg_rtx (DImode);  operands[2] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);  operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);}")(define_expand "bgeu"  [(set (match_dup 1) (match_dup 2))   (set (pc)	(if_then_else (match_dup 3)		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "{  operands[1] = gen_reg_rtx (DImode);  operands[2] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);  operands[3] = gen_rtx (EQ, VOIDmode, operands[1], const0_rtx);}")(define_expand "seq"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "sne"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))   (set (match_dup 0) (xor:DI (match_dup 0) (const_int 1)))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (EQ, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "slt"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LT, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "sle"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LE, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "sgt"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LT, DImode, force_reg (DImode, alpha_compare_op1),			 alpha_compare_op0);}")(define_expand "sge"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LE, DImode, force_reg (DImode, alpha_compare_op1),			 alpha_compare_op0);}")(define_expand "sltu"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LTU, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "sleu"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LEU, DImode, alpha_compare_op0, alpha_compare_op1);}")(define_expand "sgtu"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LTU, DImode, force_reg (DImode, alpha_compare_op1),			 alpha_compare_op0);}")(define_expand "sgeu"  [(set (match_operand:DI 0 "register_operand" "")	(match_dup 1))]  ""  "{  if (alpha_compare_fp_p)    FAIL;  operands[1] = gen_rtx (LEU, DImode, force_reg (DImode, alpha_compare_op1),			 alpha_compare_op0);}");; These define_split definitions are used in cases when comparisons have;; not be stated in the correct way and we need to reverse the second;; comparison.  For example, x >= 7 has to be done as x < 6 with the;; comparison that tests the result being reversed.  We have one define_split;; for each use of a comparison.  They do not match valid insns and need;; not generate valid insns.;;;; We can also handle equality comparisons (and inequality comparisons in;; cases where the resulting add cannot overflow) with out-of-range numbers by;; doing an add followed by a comparison with zero.  For this case, we;; also have an SImode pattern since we can merge the add and sign;; extend and the order doesn't matter.;;;; We do not do this for floating-point, since it isn't clear how the "wrong";; operation could have been generated.(define_split  [(set (match_operand:DI 0 "register_operand" "")	(if_then_else:DI	 (match_operator 1 "comparison_operator"			 [(match_operand:DI 2 "reg_or_0_operand" "")			  (match_operand:DI 3 "reg_or_cint_operand" "")])	 (match_operand:DI 4 "reg_or_cint_operand" "")	 (match_operand:DI 5 "reg_or_cint_operand" "")))   (clobber (match_operand:DI 6 "register_operand" ""))]  "operands[3] != const0_rtx"  [(set (match_dup 6) (match_dup 7))   (set (match_dup 0)	(if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]  "{ enum rtx_code code = GET_CODE (operands[1]);  int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);  /* If we are comparing for equality with a constant and that constant     appears in the arm when the register equals the constant, use the     register since that is more likely to match (and to produce better code     if both would).  */  if (code == EQ && GET_CODE (operands[3]) == CONST_INT      && rtx_equal_p (operands[4], operands[3]))    operands[4] = operands[2];  else if (code == NE && GET_CODE (operands[3]) == CONST_INT	   && rtx_equal_p (operands[5], operands[3]))    operands[5] = operands[2];  if ((code == NE || code == EQ       || (extended_count (operands[2], DImode, unsignedp) >= 1	   && extended_count (operands[3], DImode, unsignedp) >= 1))      && GET_CODE (operands[3]) == CONST_INT      && (unsigned) INTVAL (operands[3]) > 255)    {      operands[7] = gen_rtx (PLUS, DImode, operands[2],			     GEN_INT (- INTVAL (operands[3])));      operands[8] = gen_rtx (code, VOIDmode, operands[6], const0_rtx);    }  else if (code == EQ || code == LE || code == LT	   || code == LEU || code == LTU)    {      operands[7] = gen_rtx (code, DImode, operands[2], operands[3]);      operands[8] = gen_rtx (NE, VOIDmode, operands[6], const0_rtx);    }  else    {      operands[7] = gen_rtx (reverse_condition (code), DImode, operands[2],			     operands[3]);      operands[8] = gen_rtx (EQ, VOIDmode, operands[6], const0_rtx);    }}")(define_split  [(set (match_operand:DI 0 "register_operand" "")	(if_then_else:DI	 (match_operator 1 "comparison_operator"			 [(match_operand:SI 2 "reg_or_0_operand" "")			  (match_operand:SI 3 "const_int_operand" "")])	 (match_operand:DI 4 "reg_or_8bit_operand" "")	 (match_operand:DI 5 "reg_or_8bit_operand" "")))   (clobber (match_operand:DI 6 "register_operand" ""))]  "(unsigned) INTVAL (operands[3]) > 255"  [(set (match_dup 6) (match_dup 7))   (set (match_dup 0)	(if_then_else:DI (match_dup 8) (match_dup 4) (match_dup 5)))]  "{ enum rtx_code code = GET_CODE (operands[1]);  int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);  if ((code != NE && code != EQ       && ! (extended_count (operands[2], DImode, unsignedp) >= 1	     && extended_count (operands[3], DImode, unsignedp) >= 1)))    FAIL;   operands[7] = gen_rtx (SIGN_EXTEND, DImode,			 gen_rtx (PLUS, SImode, operands[2],				  GEN_INT (- INTVAL (operands[3]))));  operands[8] = gen_rtx (GET_CODE (operands[1]), VOIDmode, operands[6],			 const0_rtx);}")(define_split  [(set (pc)	(if_then_else	 (match_operator 1 "comparison_operator"			 [(match_operand:DI 2 "reg_or_0_operand" "")			  (match_operand:DI 3 "reg_or_cint_operand" "")])	 (label_ref (match_operand 0 "" ""))	 (pc)))   (clobber (match_operand:DI 4 "register_operand" ""))]  "operands[3] != const0_rtx"  [(set (match_dup 4) (match_dup 5))   (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]  "{ enum rtx_code code = GET_CODE (operands[1]);  int unsignedp = (code == GEU || code == LEU || code == GTU || code == LTU);  if ((code == NE || code == EQ       || (extended_count (operands[2], DImode, unsignedp) >= 1	   && extended_count (operands[3], DImode, unsignedp) >= 1))      && GET_CODE (operands[3]) == CONST_INT      && (unsigned) INTVAL (operands[3]) > 255)    {      operands[5] = gen_rtx (PLUS, DImode, operands[2],			     GEN_INT (- INTVAL (operands[3])));      operands[6] = gen_rtx (code, VOIDmode, operands[4], const0_rtx);    }  else if (code == EQ || code == LE || code == LT	   || code == LEU || code == LTU)    {      operands[5] = gen_rtx (code, DImode, operands[2], operands[3]);      operands[6] = gen_rtx (NE, VOIDmode, operands[4], const0_rtx);    }  else    {      operands[5] = gen_rtx (reverse_condition (code), DImode, operands[2],			     operands[3]);      operands[6] = gen_rtx (EQ, VOIDmode, operands[4], const0_rtx);    }}")(define_split  [(set (pc)	(if_then_else	 (match_operator 1 "comparison_operator"			 [(match_operand:SI 2 "reg_or_0_operand" "")			  (match_operand:SI 3 "const_int_operand" "")])	 (label_ref (match_operand 0 "" ""))	 (pc)))   (clobber (match_operand:DI 4 "register_operand" ""))]  "INTVAL (operands[3]) < 0   && (GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE)"  [(set (match_dup 4) (match_dup 5))   (set (pc) (if_then_else (match_dup 6) (label_ref (match_dup 0)) (pc)))]  "{ operands[5] = gen_rtx (SIGN_EXTEND, DImode,			 gen_rtx (PLUS, SImode, operands[2],				  GEN_INT (- INTVAL (operands[3]))));  operands[6] = gen_rtx (GET_CODE (operands[1]), VOIDmode,			 operands[4], const0_rtx);}");; Here are the CALL and unconditional branch insns.(define_expand "call"  [(parallel [(call (mem:DI (match_dup 2))		    (match_operand 1 "" ""))	      (use (match_operand:DI 0 "" ""))	      (clobber (reg:DI 26))])]  ""  "{ if (GET_CODE (operands[0]) != MEM)    abort ();  operands[0] = XEXP (operands[0], 0);  operands[2] = gen_rtx (REG, DImode, 27);  emit_move_insn (operands[2], operands[0]);  if (GET_CODE (operands[0]) != SYMBOL_REF)    operands[0] = const0_rtx;}")(define_expand "call_value"  [(parallel [(set (match_operand 0 "" "")		   (call (mem:DI (match_dup 3))			 (match_operand 2 "" "")))	      (use (match_operand:DI 1 "" ""))	      (clobber (reg:DI 26))])]  ""  "{ if (GET_CODE (operands[1]) != MEM)    abort ();  operands[1] = XEXP (operands[1], 0);  operands[3] = gen_rtx (REG, DImode, 27);  emit_move_insn (operands[3], operands[1]);  if (GET_CODE (opera

⌨️ 快捷键说明

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