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

📄 mn10300.md

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 MD
📖 第 1 页 / 共 5 页
字号:
  "")(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand" "=dx,dx,!dax,!dax")	(sign_extend:SI	 (match_operand:QI 1 "general_operand" "0,dx,0,dax")))]  "TARGET_AM33"  "@  extb %0  mov %1,%0\;extb %0  extb %0  mov %1,%0\;extb %0"  [(set_attr "cc" "none_0hit")])(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand" "=dx,dx")	(sign_extend:SI	 (match_operand:QI 1 "general_operand" "0,dx")))]  ""  "@  extb %0  mov %1,%0\;extb %0"  [(set_attr "cc" "none_0hit")])(define_expand "extendhisi2"  [(set (match_operand:SI 0 "general_operand" "")	(sign_extend:SI	 (match_operand:HI 1 "general_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand" "=dx,dx,!dax,!dax")	(sign_extend:SI	 (match_operand:HI 1 "general_operand" "0,dax,0,dax")))]  "TARGET_AM33"  "@  exth %0  mov %1,%0\;exth %0  exth %0  mov %1,%0\;exth %0"  [(set_attr "cc" "none_0hit")])(define_insn ""  [(set (match_operand:SI 0 "nonimmediate_operand" "=dx,dx")	(sign_extend:SI	 (match_operand:HI 1 "general_operand" "0,dx")))]  ""  "@  exth %0  mov %1,%0\;exth %0"  [(set_attr "cc" "none_0hit")]);; ----------------------------------------------------------------------;; SHIFTS;; ----------------------------------------------------------------------(define_expand "ashlsi3"  [(set (match_operand:SI 0 "register_operand" "")	(ashift:SI	 (match_operand:SI 1 "register_operand" "")	 (match_operand:QI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dax,dx,!dax")	(ashift:SI	 (match_operand:SI 1 "register_operand" "0,0,dax")	 (match_operand:QI 2 "nonmemory_operand" "J,dxi,dax")))]  "TARGET_AM33"  "*{  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 1)    return \"add %0,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 2)    return \"asl2 %0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 3      && REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS)    return \"asl2 %0\;add %0,%0\";  if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 4      && REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS)    return \"asl2 %0\;asl2 %0\";  if (true_regnum (operands[1]) == true_regnum (operands[0]))    return \"asl %S2,%0\";  if (REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS      && REGNO_REG_CLASS (true_regnum (operands[1])) == DATA_REGS      && true_regnum (operands[0]) != true_regnum (operands[2]))    return \"mov %1,%0\;asl %S2,%0\";  return \"asl %2,%1,%0\";}"  [(set_attr "cc" "set_zn")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dax,dx,dx,dx,dx")	(ashift:SI	 (match_operand:SI 1 "register_operand" "0,0,0,0,0")	 (match_operand:QI 2 "nonmemory_operand" "J,K,M,L,dxi")))]  ""  "@  add %0,%0  asl2 %0  asl2 %0\;add %0,%0  asl2 %0\;asl2 %0  asl %S2,%0"  [(set_attr "cc" "set_zn")])(define_expand "lshrsi3"  [(set (match_operand:SI 0 "register_operand" "")	(lshiftrt:SI	 (match_operand:SI 1 "register_operand" "")	 (match_operand:QI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,!dax")	(lshiftrt:SI	 (match_operand:SI 1 "register_operand" "0,dax")	 (match_operand:QI 2 "nonmemory_operand" "dxi,dax")))]  "TARGET_AM33"  "*{  if (true_regnum (operands[1]) == true_regnum (operands[0]))    return \"lsr %S2,%0\";  if (REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS      && REGNO_REG_CLASS (true_regnum (operands[1])) == DATA_REGS      && true_regnum (operands[0]) != true_regnum (operands[2]))    return \"mov %1,%0\;lsr %S2,%0\";  return \"lsr %2,%1,%0\";}"  [(set_attr "cc" "set_zn")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx")	(lshiftrt:SI	 (match_operand:SI 1 "register_operand" "0")	 (match_operand:QI 2 "nonmemory_operand" "dxi")))]  ""  "lsr %S2,%0"  [(set_attr "cc" "set_zn")])(define_expand "ashrsi3"  [(set (match_operand:SI 0 "register_operand" "")	(ashiftrt:SI	 (match_operand:SI 1 "register_operand" "")	 (match_operand:QI 2 "nonmemory_operand" "")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx,!dax")	(ashiftrt:SI	 (match_operand:SI 1 "register_operand" "0,dax")	 (match_operand:QI 2 "nonmemory_operand" "dxi,dax")))]  "TARGET_AM33"  "*{  if (true_regnum (operands[1]) == true_regnum (operands[0]))    return \"asr %S2,%0\";  if (REGNO_REG_CLASS (true_regnum (operands[0])) == DATA_REGS      && REGNO_REG_CLASS (true_regnum (operands[1])) == DATA_REGS      && true_regnum (operands[0]) != true_regnum (operands[2]))    return \"mov %1,%0\;asr %S2,%0\";  return \"asr %2,%1,%0\";}"  [(set_attr "cc" "set_zn")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=dx")	(ashiftrt:SI	 (match_operand:SI 1 "register_operand" "0")	 (match_operand:QI 2 "nonmemory_operand" "dxi")))]  ""  "asr %S2,%0"  [(set_attr "cc" "set_zn")]);; ----------------------------------------------------------------------;; FP INSTRUCTIONS;; ----------------------------------------------------------------------;;;; The mn103 series does not have floating point instructions, but since;; FP values are held in integer regs, we can clear the high bit easily;; which gives us an efficient inline floating point absolute value.;;;; Similarly for negation of a FP value.;;(define_expand "absdf2"  [(set (match_operand:DF 0 "register_operand" "")        (abs:DF (match_operand:DF 1 "register_operand" "")))]  ""  "{  rtx target, result, insns;  start_sequence ();  target = operand_subword (operands[0], 1, 1, DFmode);  result = expand_binop (SImode, and_optab,			 operand_subword_force (operands[1], 1, DFmode),			 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);  if (result == 0)    abort ();  if (result != target)    emit_move_insn (result, target);  emit_move_insn (operand_subword (operands[0], 0, 1, DFmode),		  operand_subword_force (operands[1], 0, DFmode));  insns = get_insns ();  end_sequence ();  emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);  DONE;}")(define_expand "abssf2"  [(set (match_operand:SF 0 "register_operand" "")        (abs:SF (match_operand:SF 1 "register_operand" "")))]  ""  "{  rtx result;  rtx target;  target = operand_subword_force (operands[0], 0, SFmode);  result = expand_binop (SImode, and_optab,			 operand_subword_force (operands[1], 0, SFmode),			 GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN);  if (result == 0)    abort ();  if (result != target)    emit_move_insn (result, target);  /* Make a place for REG_EQUAL.  */  emit_move_insn (operands[0], operands[0]);  DONE;}")(define_expand "negdf2"  [(set (match_operand:DF 0 "register_operand" "")        (neg:DF (match_operand:DF 1 "register_operand" "")))]  ""  "{  rtx target, result, insns;  start_sequence ();  target = operand_subword (operands[0], 1, 1, DFmode);  result = expand_binop (SImode, xor_optab,			 operand_subword_force (operands[1], 1, DFmode),			 GEN_INT (trunc_int_for_mode (0x80000000, SImode)),			 target, 0, OPTAB_WIDEN);  if (result == 0)    abort ();  if (result != target)    emit_move_insn (result, target);  emit_move_insn (operand_subword (operands[0], 0, 1, DFmode),		  operand_subword_force (operands[1], 0, DFmode));  insns = get_insns ();  end_sequence ();  emit_no_conflict_block (insns, operands[0], operands[1], 0, 0);  DONE;}")(define_expand "negsf2"  [(set (match_operand:SF 0 "register_operand" "")        (neg:SF (match_operand:SF 1 "register_operand" "")))]  ""  "{  rtx result;  rtx target;  target = operand_subword_force (operands[0], 0, SFmode);  result = expand_binop (SImode, xor_optab,			 operand_subword_force (operands[1], 0, SFmode),			 GEN_INT (trunc_int_for_mode (0x80000000, SImode)),			 target, 0, OPTAB_WIDEN);  if (result == 0)    abort ();  if (result != target)    emit_move_insn (result, target);  /* Make a place for REG_EQUAL.  */  emit_move_insn (operands[0], operands[0]);  DONE;}");; ----------------------------------------------------------------------;; PROLOGUE/EPILOGUE;; ----------------------------------------------------------------------(define_expand "prologue"  [(const_int 0)]  ""  "expand_prologue (); DONE;")(define_expand "epilogue"  [(return)]  ""  "{  expand_epilogue ();  DONE;}")(define_insn "return_internal"  [(const_int 2)   (return)]  ""  "rets"  [(set_attr "cc" "clobber")]);; This insn restores the callee saved registers and does a return, it;; can also deallocate stack space.(define_insn "return_internal_regs"  [(const_int 0)   (match_operand:SI 0  "const_int_operand" "i")   (return)]  ""  "*{  fputs (\"\\tret \", asm_out_file);  mn10300_print_reg_list (asm_out_file, mn10300_get_live_callee_saved_regs ());  fprintf (asm_out_file, \",%d\\n\", (int) INTVAL (operands[0]));  return \"\";}"  [(set_attr "cc" "clobber")]);; This instruction matches one generated by mn10300_gen_multiple_store()(define_insn "store_movm"  [(match_parallel 0 "store_multiple_operation"    [(set (reg:SI 9) (plus:SI (reg:SI 9) (match_operand 1 "" "")))])]  ""  "*{  fputs (\"\\tmovm \", asm_out_file);  mn10300_print_reg_list (asm_out_file,                          store_multiple_operation (operands[0], VOIDmode));  fprintf (asm_out_file, \",(sp)\\n\");  return \"\";}"  [(set_attr "cc" "clobber")])  (define_insn "return"  [(return)]  "can_use_return_insn ()"  "*{  rtx next = next_active_insn (insn);  if (next      && GET_CODE (next) == JUMP_INSN      && GET_CODE (PATTERN (next)) == RETURN)    return \"\";  else    return \"rets\";}"  [(set_attr "cc" "clobber")]);; Try to combine consecutive updates of the stack pointer (or any;; other register for that matter).(define_peephole  [(set (match_operand:SI 0 "register_operand" "=dxay")	(plus:SI (match_dup 0)		 (match_operand 1 "const_int_operand" "")))   (set (match_dup 0)	(plus:SI (match_dup 0)		 (match_operand 2 "const_int_operand" "")))]  ""  "*{  operands[1] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[1]));  return \"add %1,%0\";}"  [(set_attr "cc" "clobber")]);;;; We had patterns to check eq/ne, but the they don't work because;; 0x80000000 + 0x80000000 = 0x0 with a carry out.;;;; The Z flag and C flag would be set, and we have no way to;; check for the Z flag set and C flag clear.;;;; This will work on the mn10200 because we can check the ZX flag;; if the comparison is in HImode.(define_peephole  [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))   (set (pc) (if_then_else (ge (cc0) (const_int 0))			   (match_operand 1 "" "")			   (pc)))]  "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"  "add %0,%0\;bcc %1"  [(set_attr "cc" "clobber")])(define_peephole  [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))   (set (pc) (if_then_else (lt (cc0) (const_int 0))			   (match_operand 1 "" "")			   (pc)))]  "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"  "add %0,%0\;bcs %1"  [(set_attr "cc" "clobber")])(define_peephole  [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))   (set (pc) (if_then_else (ge (cc0) (const_int 0))			   (pc)			   (match_operand 1 "" "")))]  "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"  "add %0,%0\;bcs %1"  [(set_attr "cc" "clobber")])(define_peephole  [(set (cc0) (match_operand:SI 0 "register_operand" "dx"))   (set (pc) (if_then_else (lt (cc0) (const_int 0))			   (pc)			   (match_operand 1 "" "")))]  "dead_or_set_p (ins1, operands[0]) && REG_OK_FOR_INDEX_P (operands[0])"  "add %0,%0\;bcc %1"  [(set_attr "cc" "clobber")])

⌨️ 快捷键说明

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