mn10300.md

来自「gcc3.2.1源代码」· Markdown 代码 · 共 2,118 行 · 第 1/4 页

MD
2,118
字号
    return \"lsr 4,%0\;asl2 %0\;asl2 %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])      && 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\;and %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 \"and %1,%2,%0\";  if (REG_P (operands[2]) && REG_P (operands[0])      && true_regnum (operands[2]) == true_regnum (operands[0]))    return \"and %1,%0\";  return \"and %2,%0\";}"  [(set_attr "cc" "none_0hit,set_znv,set_znv")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,dx")	(and:SI (match_operand:SI 1 "register_operand" "%0,0")		(match_operand:SI 2 "nonmemory_operand" "N,dxi")))]  ""  "*{  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xff)    return \"extbu %0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xffff)    return \"exthu %0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x7fffffff)    return \"add %0,%0\;lsr 1,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x3fffffff)    return \"asl2 %0\;lsr 2,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x1fffffff)    return \"add %0,%0\;asl2 %0\;lsr 3,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0x0fffffff)    return \"asl2 %0\;asl2 %0\;lsr 4,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffffe)    return \"lsr 1,%0\;add %0,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffffc)    return \"lsr 2,%0\;asl2 %0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffff8)    return \"lsr 3,%0\;add %0,%0\;asl2 %0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 0xfffffff0)    return \"lsr 4,%0\;asl2 %0\;asl2 %0\";  return \"and %2,%0\";}"  [(set_attr "cc" "none_0hit,set_znv")]);; ----------------------------------------------------------------------;; OR INSTRUCTIONS;; ----------------------------------------------------------------------(define_expand "iorsi3"  [(set (match_operand:SI 0 "register_operand" "")	(ior:SI (match_operand:SI 1 "register_operand" "")		(match_operand:SI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,!dax")	(ior: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\;or %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 \"or %1,%2,%0\";  if (REG_P (operands[2]) && REG_P (operands[0])      && true_regnum (operands[2]) == true_regnum (operands[0]))    return \"or %1,%0\";  return \"or %2,%0\";}"  [(set_attr "cc" "set_znv")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx")	(ior:SI (match_operand:SI 1 "register_operand" "%0")		(match_operand:SI 2 "nonmemory_operand" "dxi")))]  ""  "or %2,%0"  [(set_attr "cc" "set_znv")]);; ----------------------------------------------------------------------;; XOR INSTRUCTIONS;; ----------------------------------------------------------------------(define_expand "xorsi3"  [(set (match_operand:SI 0 "register_operand" "")	(xor:SI (match_operand:SI 1 "register_operand" "")		(match_operand:SI 2 "nonmemory_operand" "")))]  ""  "")(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 "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 %1,%A0  or %1,%0"  [(set_attr "cc" "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 (ie 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 %1,%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 %1,%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.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.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_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" ""))]  ""  "{  if (! call_address_operand (XEXP (operands[0], 0), VOIDmode))    XEXP (operands[0], 0) = force_reg (SImode, XEXP (operands[0], 0));  emit_call_insn (gen_call_internal (XEXP (operands[0], 0), operands[1]));  DONE;}")(define_insn "call_internal"  [(call (mem:QI (match_operand:SI 0 "call_address_operand" "aS"))	 (match_operand:SI 1 "general_operand" "g"))]  ""  "*{  if (REG_P (operands[0]))    return \"calls %C0\";  else    return \"call %C0,[],0\";}"  [(set_attr "cc" "clobber")]);; Call subroutine, returning value in operand 0;; (which must be a hard register).(define_expand "call_value"  [(set (match_operand 0 "" "")	(call (match_operand:QI 1 "general_operand" "")	      (match_operand:SI 2 "general_operand" "")))]  ""  "{  if (! call_address_operand (XEXP (operands[1], 0), VOIDmode))    XEXP (operands[1], 0) = force_reg (SImode, XEXP (operands[1], 0));  emit_call_insn (gen_call_value_internal (operands[0],					   XEXP (operands[1], 0),					   operands[2]));  DONE;}")(define_insn "call_value_internal"  [(set (match_operand 0 "" "=dax")	(call (mem:QI (match_operand:SI 1 "call_address_operand" "aS"))	      (match_operand:SI 2 "general_operand" "g")))]  ""  "*{  if (REG_P (operands[1]))    return \"calls %C1\";  else    return \"call %C1,[],0\";}"  [(set_attr "cc" "clobber")])(define_expand "untyped_call"  [(parallel [(call (match_operand 0 "" "")                    (const_int 0))              (match_operand 1 "" "")              (match_operand 2 "" "")])]  ""  "{  int i;  emit_call_insn (gen_call (operands[0], const0_rtx));  for (i = 0; i < XVECLEN (operands[2], 0); i++)    {

⌨️ 快捷键说明

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