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

📄 mn10300.md

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 MD
📖 第 1 页 / 共 5 页
字号:
(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,!dax")	(xor:SI (match_operand:SI 1 "register_operand" "%0,dax")		(match_operand:SI 2 "nonmemory_operand" "dxi,dax")))]  "TARGET_AM33"  "*{  if (REG_P (operands[2]) && REG_P (operands[1])      && true_regnum (operands[0]) != true_regnum (operands[1])      && true_regnum (operands[0]) != true_regnum (operands[2])      && REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS      && REGNO_REG_CLASS (true_regnum (operands[1])) == DATA_REGS      && REGNO_REG_CLASS (true_regnum (operands[2])) == DATA_REGS)    return \"mov %1,%0\;xor %2,%0\";  if (REG_P (operands[2]) && REG_P (operands[1])      && true_regnum (operands[0]) != true_regnum (operands[1])      && true_regnum (operands[0]) != true_regnum (operands[2]))    return \"xor %1,%2,%0\";  if (REG_P (operands[2]) && REG_P (operands[0])      && true_regnum (operands[2]) == true_regnum (operands[0]))    return \"xor %1,%0\";  return \"xor %2,%0\";}"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx")	(xor:SI (match_operand:SI 1 "register_operand" "%0")		(match_operand:SI 2 "nonmemory_operand" "dxi")))]  ""  "xor %2,%0"  [(set_attr "cc" "set_znv")]);; ----------------------------------------------------------------------;; NOT INSTRUCTIONS;; ----------------------------------------------------------------------(define_expand "one_cmplsi2"  [(set (match_operand:SI 0 "register_operand" "")	(not:SI (match_operand:SI 1 "register_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,!dax")	(not:SI (match_operand:SI 1 "register_operand" "0,0")))]  "TARGET_AM33"  "not %0"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx")	(not:SI (match_operand:SI 1 "register_operand" "0")))]  ""  "not %0"  [(set_attr "cc" "set_znv")]);; -----------------------------------------------------------------;; BIT FIELDS;; -----------------------------------------------------------------;; These set/clear memory in byte sized chunks.;;;; They are no smaller/faster than loading the value into a register;; and storing the register, but they don't need a scratch register;; which may allow for better code generation.(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=R,d") (const_int 0))]  ""  "@  bclr 255,%A0  clr %0"  [(set_attr "cc" "clobber")])(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=R,d") (const_int -1))]  ""  "@  bset 255,%A0  mov -1,%0"  [(set_attr "cc" "clobber,none_0hit")])(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "+R,d")	(subreg:QI	  (and:SI (subreg:SI (match_dup 0) 0)		  (match_operand:SI 1 "const_int_operand" "i,i")) 0))]  ""  "@  bclr %N1,%A0  and %1,%0"  [(set_attr "cc" "clobber,set_znv")])(define_insn ""  [(set (match_operand:QI 0 "memory_operand" "=R,T")	(and:QI	 (match_dup 0)	 (not:QI (match_operand:QI 1 "nonmemory_operand" "i,d"))))]  ""  "@  bclr %U1,%A0  bclr %1,%0"  [(set_attr "cc" "clobber,clobber")])(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "+R,d")	(subreg:QI	  (ior:SI (subreg:SI (match_dup 0) 0)		  (match_operand:SI 1 "const_int_operand" "i,i")) 0))]  ""  "@  bset %U1,%A0  or %1,%0"  [(set_attr "cc" "clobber,set_znv")])(define_expand "iorqi3"  [(set (match_operand:QI 0 "nonimmediate_operand" "")	(ior:QI (match_operand:QI 1 "nonimmediate_operand" "")		(match_operand:QI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=R,T,r")	(ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")		;; This constraint should really be nonmemory_operand,		;; but making it general_operand, along with the		;; condition that not both input operands are MEMs, it		;; here helps combine do a better job.		(match_operand:QI 2 "general_operand" "i,d,ir")))]  "TARGET_AM33 &&   (GET_CODE (operands[2]) != MEM || GET_CODE (operands[1]) != MEM)"  "@  bset %U2,%A0  bset %2,%0  or %2,%0"  [(set_attr "cc" "clobber,clobber,set_znv")])(define_insn ""  [(set (match_operand:QI 0 "nonimmediate_operand" "=R,T,d")	(ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")		;; This constraint should really be nonmemory_operand,		;; but making it general_operand, along with the		;; condition that not both input operands are MEMs, it		;; here helps combine do a better job.		(match_operand:QI 2 "general_operand" "i,d,id")))]  "GET_CODE (operands[2]) != MEM || GET_CODE (operands[1]) != MEM"  "@  bset %U2,%A0  bset %2,%0  or %2,%0"  [(set_attr "cc" "clobber,clobber,set_znv")])(define_insn ""  [(set (cc0)     (zero_extract:SI (match_operand:SI 0 "register_operand" "dx")		      (match_operand 1 "const_int_operand" "")		      (match_operand 2 "const_int_operand" "")))]  ""  "*{  int len = INTVAL (operands[1]);  int bit = INTVAL (operands[2]);  int mask = 0;  rtx xoperands[2];  while (len > 0)    {      mask |= (1 << bit);      bit++;      len--;    }  xoperands[0] = operands[0];  xoperands[1] = GEN_INT (trunc_int_for_mode (mask, SImode));  output_asm_insn (\"btst %1,%0\", xoperands);  return \"\";}"  [(set_attr "cc" "clobber")])(define_insn ""  [(set (cc0)     (zero_extract:SI (match_operand:QI 0 "general_operand" "R,dx")		      (match_operand 1 "const_int_operand" "")		      (match_operand 2 "const_int_operand" "")))]  "mask_ok_for_mem_btst (INTVAL (operands[1]), INTVAL (operands[2]))"  "*{  int len = INTVAL (operands[1]);  int bit = INTVAL (operands[2]);  int mask = 0;  rtx xoperands[2];  while (len > 0)    {      mask |= (1 << bit);      bit++;      len--;    }  /* If the source operand is not a reg (i.e. it is memory), then extract the     bits from mask that we actually want to test.  Note that the mask will     never cross a byte boundary.  */  if (!REG_P (operands[0]))    {      if (mask & 0xff)	mask = mask & 0xff;      else if (mask & 0xff00)	mask = (mask >> 8) & 0xff;      else if (mask & 0xff0000)	mask = (mask >> 16) & 0xff;      else if (mask & 0xff000000)	mask = (mask >> 24) & 0xff;    }    xoperands[0] = operands[0];  xoperands[1] = GEN_INT (trunc_int_for_mode (mask, SImode));  if (GET_CODE (operands[0]) == REG)    output_asm_insn (\"btst %1,%0\", xoperands);  else    output_asm_insn (\"btst %U1,%A0\", xoperands);  return \"\";}"  [(set_attr "cc" "clobber")])(define_insn ""  [(set (cc0) (and:SI (match_operand:SI 0 "register_operand" "dx")		      (match_operand:SI 1 "const_int_operand" "")))]  ""  "btst %1,%0"  [(set_attr "cc" "clobber")])(define_insn ""  [(set (cc0)     (and:SI       (subreg:SI (match_operand:QI 0 "general_operand" "R,dx") 0)       (match_operand:SI 1 "const_8bit_operand" "")))]  ""  "@  btst %U1,%A0  btst %1,%0"  [(set_attr "cc" "clobber")]);; ----------------------------------------------------------------------;; JUMP INSTRUCTIONS;; ----------------------------------------------------------------------;; Conditional jump instructions(define_expand "ble"  [(set (pc)	(if_then_else (le (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bleu"  [(set (pc)	(if_then_else (leu (cc0)			   (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bge"  [(set (pc)	(if_then_else (ge (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bgeu"  [(set (pc)	(if_then_else (geu (cc0)			   (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "blt"  [(set (pc)	(if_then_else (lt (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bltu"  [(set (pc)	(if_then_else (ltu (cc0)			   (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bgt"  [(set (pc)	(if_then_else (gt (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bgtu"  [(set (pc)	(if_then_else (gtu (cc0)			   (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "beq"  [(set (pc)	(if_then_else (eq (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_expand "bne"  [(set (pc)	(if_then_else (ne (cc0)			  (const_int 0))		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "")(define_insn ""  [(set (pc)	(if_then_else (match_operator 1 "comparison_operator"				      [(cc0) (const_int 0)])		      (label_ref (match_operand 0 "" ""))		      (pc)))]  ""  "*{  if (cc_status.mdep.fpCC)    return \"fb%b1 %0\";  if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0      && (GET_CODE (operands[1]) == GT	  || GET_CODE (operands[1]) == GE	  || GET_CODE (operands[1]) == LE	  || GET_CODE (operands[1]) == LT))    return 0;  return \"b%b1 %0\";}" [(set_attr "cc" "none")])(define_insn ""  [(set (pc)	(if_then_else (match_operator 1 "comparison_operator"				      [(cc0) (const_int 0)])		      (pc)		      (label_ref (match_operand 0 "" ""))))]  ""  "*{  if (cc_status.mdep.fpCC)    return \"fb%B1 %0\";  if ((cc_status.flags & CC_OVERFLOW_UNUSABLE) != 0      && (GET_CODE (operands[1]) == GT	  || GET_CODE (operands[1]) == GE	  || GET_CODE (operands[1]) == LE	  || GET_CODE (operands[1]) == LT))    return 0;  return \"b%B1 %0\";}" [(set_attr "cc" "none")]);; Unconditional and other jump instructions.(define_insn "jump"  [(set (pc)	(label_ref (match_operand 0 "" "")))]  ""  "jmp %l0" [(set_attr "cc" "none")])(define_insn "indirect_jump"  [(set (pc) (match_operand:SI 0 "register_operand" "a"))]  ""  "jmp (%0)"  [(set_attr "cc" "none")])(define_expand "builtin_setjmp_receiver"  [(match_operand 0 "" "")]  "flag_pic"  "{  if (flag_pic)    emit_insn (gen_GOTaddr2picreg ());  DONE;}")(define_expand "casesi"  [(match_operand:SI 0 "register_operand" "")   (match_operand:SI 1 "immediate_operand" "")   (match_operand:SI 2 "immediate_operand" "")   (match_operand 3 "" "") (match_operand 4 "" "")]  ""  "{  rtx table = gen_reg_rtx (SImode);  rtx index = gen_reg_rtx (SImode);  rtx addr = gen_reg_rtx (Pmode);  emit_move_insn (table, gen_rtx_LABEL_REF (VOIDmode, operands[3]));  emit_move_insn (index, plus_constant (operands[0], - INTVAL (operands[1])));  emit_insn (gen_cmpsi (index, operands[2]));  emit_jump_insn (gen_bgtu (operands[4]));  emit_move_insn (index, gen_rtx_ASHIFT (SImode, index, const2_rtx));  emit_move_insn (addr, gen_rtx_MEM (SImode,				     gen_rtx_PLUS (SImode, table, index)));  if (flag_pic)    emit_move_insn (addr, gen_rtx_PLUS (SImode, addr, table));  emit_jump_insn (gen_tablejump (addr, operands[3]));  DONE;}")(define_insn "tablejump"  [(set (pc) (match_operand:SI 0 "register_operand" "a"))   (use (label_ref (match_operand 1 "" "")))]  ""  "jmp (%0)"  [(set_attr "cc" "none")]);; Call subroutine with no return value.(define_expand "call"  [(call (match_operand:QI 0 "general_operand" "")	 (match_operand:SI 1 "general_operand" ""))]  ""

⌨️ 快捷键说明

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