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

📄 h8300.md

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 MD
📖 第 1 页 / 共 5 页
字号:
  ""  "* return output_logical_op (SImode, operands);"  [(set (attr "length")	(symbol_ref "compute_logical_op_length (SImode, operands)"))   (set (attr "cc")	(symbol_ref "compute_logical_op_cc (SImode, operands)"))]);; ----------------------------------------------------------------------;; NEGATION INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "negqi2"  [(set (match_operand:QI 0 "register_operand" "=r")	(neg:QI (match_operand:QI 1 "register_operand" "0")))]  ""  "neg	%X0"  [(set_attr "length" "2")   (set_attr "cc" "set_zn")])(define_expand "neghi2"  [(set (match_operand:HI 0 "register_operand" "")	(neg:HI (match_operand:HI 1 "register_operand" "")))]  ""  "{  if (TARGET_H8300)    {      emit_insn (gen_neghi2_h8300 (operands[0], operands[1]));      DONE;    }}")(define_expand "neghi2_h8300"  [(set (match_dup 2)	(not:HI (match_operand:HI 1 "register_operand" "")))   (set (match_dup 2) (plus:HI (match_dup 2) (const_int 1)))   (set (match_operand:HI 0 "register_operand" "")	(match_dup 2))]  ""  "operands[2] = gen_reg_rtx (HImode);")(define_insn "neghi2_h8300h"  [(set (match_operand:HI 0 "register_operand" "=r")	(neg:HI (match_operand:HI 1 "register_operand" "0")))]  "TARGET_H8300H || TARGET_H8300S"  "neg	%T0"  [(set_attr "length" "2")   (set_attr "cc" "set_zn")])(define_expand "negsi2"  [(set (match_operand:SI 0 "register_operand" "")	(neg:SI (match_operand:SI 1 "register_operand" "")))]  ""  "{  if (TARGET_H8300)    {      emit_insn (gen_negsi2_h8300 (operands[0], operands[1]));      DONE;    }}")(define_expand "negsi2_h8300"  [(set (match_dup 2)	(not:SI (match_operand:SI 1 "register_operand" "")))   (set (match_dup 2) (plus:SI (match_dup 2) (const_int 1)))   (set (match_operand:SI 0 "register_operand" "")	(match_dup 2))]  ""  "operands[2] = gen_reg_rtx (SImode);")(define_insn "negsi2_h8300h"  [(set (match_operand:SI 0 "register_operand" "=r")	(neg:SI (match_operand:SI 1 "register_operand" "0")))]  "TARGET_H8300H || TARGET_H8300S"  "neg	%S0"  [(set_attr "length" "2")   (set_attr "cc" "set_zn")]);; ----------------------------------------------------------------------;; NOT INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "one_cmplqi2"  [(set (match_operand:QI 0 "register_operand" "=r")	(not:QI (match_operand:QI 1 "register_operand" "0")))]  ""  "not	%X0"  [(set_attr "length" "2")   (set_attr "cc" "set_znv")])(define_expand "one_cmplhi2"  [(set (match_operand:HI 0 "register_operand" "=r")	(not:HI (match_operand:HI 1 "register_operand" "0")))]  ""  "")(define_insn ""  [(set (match_operand:HI 0 "register_operand" "=r")	(not:HI (match_operand:HI 1 "register_operand" "0")))]  "TARGET_H8300"  "not	%s0\;not	%t0"  [(set_attr "cc" "clobber")   (set_attr "length" "4")])(define_insn ""  [(set (match_operand:HI 0 "register_operand" "=r")	(not:HI (match_operand:HI 1 "register_operand" "0")))]  "TARGET_H8300H || TARGET_H8300S"  "not	%T0"  [(set_attr "cc" "set_znv")   (set_attr "length" "2")])(define_expand "one_cmplsi2"  [(set (match_operand:SI 0 "register_operand" "=r")	(not:SI (match_operand:SI 1 "register_operand" "0")))]  ""  "")(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=r")	(not:SI (match_operand:SI 1 "register_operand" "0")))]  "TARGET_H8300"  "not	%w0\;not	%x0\;not	%y0\;not	%z0"  [(set_attr "cc" "clobber")   (set_attr "length" "8")])(define_insn ""  [(set (match_operand:SI 0 "register_operand" "=r")	(not:SI (match_operand:SI 1 "register_operand" "0")))]  "TARGET_H8300H || TARGET_H8300S"  "not	%S0"  [(set_attr "cc" "set_znv")   (set_attr "length" "2")]);; ----------------------------------------------------------------------;; 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 "branch_true"  [(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))    {      cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;      return 0;    }  if (get_attr_length (insn) == 2)    return \"b%j1	%l0\";  else if (get_attr_length (insn) == 4)    return \"b%j1	%l0:16\";  else    return \"b%k1	.Lh8BR%=\;jmp	@%l0\\n.Lh8BR%=:\";}" [(set_attr "type" "branch")   (set_attr "cc" "none")])(define_insn "branch_false"  [(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))    {      cc_status.flags &= ~CC_OVERFLOW_UNUSABLE;      return 0;    }  if (get_attr_length (insn) == 2)    return \"b%k1	%l0\";  else if (get_attr_length (insn) == 4)    return \"b%k1	%l0:16\";  else    return \"b%j1	.Lh8BR%=\;jmp	@%l0\\n.Lh8BR%=:\";}"  [(set_attr "type" "branch")   (set_attr "cc" "none")]);; Unconditional and other jump instructions.(define_insn "jump"  [(set (pc)	(label_ref (match_operand 0 "" "")))]  ""  "*{  if (get_attr_length (insn) == 2)    return \"bra	%l0\";  else if (get_attr_length (insn) == 4)    return \"bra	%l0:16\";  else    return \"jmp	@%l0\";}"  [(set_attr "type" "branch")   (set_attr "cc" "none")]);; This is a define expand, because pointers may be either 16 or 32 bits.(define_expand "tablejump"  [(parallel [(set (pc) (match_operand 0 "register_operand" ""))	      (use (label_ref (match_operand 1 "" "")))])]  ""  "")(define_insn "tablejump_h8300"  [(set (pc) (match_operand:HI 0 "register_operand" "r"))   (use (label_ref (match_operand 1 "" "")))]  "TARGET_H8300"  "jmp	@%0"  [(set_attr "cc" "none")   (set_attr "length" "2")])(define_insn "tablejump_h8300h"  [(set (pc) (match_operand:SI 0 "register_operand" "r"))   (use (label_ref (match_operand 1 "" "")))]  "TARGET_H8300H || TARGET_H8300S"  "jmp	@%0"  [(set_attr "cc" "none")   (set_attr "length" "2")])(define_insn "tablejump_normal_mode"   [(set (pc) (match_operand:HI 0 "register_operand" "r"))    (use (label_ref (match_operand 1 "" "")))]   "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE"   "jmp @%S0"   [(set_attr "cc" "none")    (set_attr "length" "2")]);; This is a define expand, because pointers may be either 16 or 32 bits.(define_expand "indirect_jump"  [(set (pc) (match_operand 0 "jump_address_operand" ""))]  ""  "")(define_insn "indirect_jump_h8300"  [(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))]  "TARGET_H8300"  "jmp	@%0"  [(set_attr "cc" "none")   (set_attr "length" "2")])(define_insn "indirect_jump_h8300h"  [(set (pc) (match_operand:SI 0 "jump_address_operand" "Vr"))]  "TARGET_H8300H || TARGET_H8300S"  "jmp @%0"  [(set_attr "cc" "none")   (set_attr "length" "2")])(define_insn "indirect_jump_normal_mode"  [(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))]  "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE"  "jmp @%S0"  [(set_attr "cc" "none")   (set_attr "length" "2")]);; Call subroutine with no return value.;; ??? Even though we use HImode here, this works on the H8/300H and H8S.(define_insn "call"  [(call (match_operand:QI 0 "call_insn_operand" "or")	 (match_operand:HI 1 "general_operand" "g"))]  ""  "*{  if (GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF      && SYMBOL_REF_FLAG (XEXP (operands[0], 0)))    return \"jsr\\t@%0:8\";  else    return \"jsr\\t%0\";}"  [(set_attr "cc" "clobber")   (set (attr "length")	(if_then_else (match_operand:QI 0 "small_call_insn_operand" "")		      (const_int 4)		      (const_int 8)))]);; Call subroutine, returning value in operand 0;; (which must be a hard register).;; ??? Even though we use HImode here, this works on the H8/300H and H8S.(define_insn "call_value"  [(set (match_operand 0 "" "=r")	(call (match_operand:QI 1 "call_insn_operand" "or")	      (match_operand:HI 2 "general_operand" "g")))]  ""  "*{  if (GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF      && SYMBOL_REF_FLAG (XEXP (operands[1], 0)))    return \"jsr\\t@%1:8\";  else    return \"jsr\\t%1\";}"  [(set_attr "cc" "clobber")   (set (attr "length")	(if_then_else (match_operand:QI 0 "small_call_insn_operand" "")		      (const_int 4)		      (const_int 8)))])(define_insn "nop"  [(const_int 0)]  ""  "nop"  [(set_attr "cc" "none")   (set_attr "length" "2")]);; ----------------------------------------------------------------------;; PROLOGUE/EPILOGUE-RELATED INSTRUCTIONS;; ----------------------------------------------------------------------(define_insn "*stm_h8300s_2"  [(parallel     [(set (reg:SI SP_REG)	   (plus:SI (reg:SI SP_REG) (const_int -8)))      (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -4)))	   (match_operand:SI 0 "register_operand" ""))      (set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -8)))	   (match_operand:SI 1 "register_operand" ""))])]  "TARGET_H8300S   && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)       || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)       || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"  "stm.l\\t%S0-%S1,@-er7"  [(set_attr "cc" "none")

⌨️ 快捷键说明

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