📄 c4x.md
字号:
(const_int 1) (const_int 0))] (const_int 0)))(define_attr "setar4" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ar4_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ar4" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ar4_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "usear4" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ar4_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar4_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar4_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "db,dbc") (if_then_else (match_operand 0 "ar4_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "readar4" "" (cond [(eq_attr "type" "compare") (if_then_else (match_operand 0 "ar4_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,store,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar4_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar4_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setar5" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ar5_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ar5" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ar5_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "usear5" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ar5_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar5_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar5_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "db,dbc") (if_then_else (match_operand 0 "ar5_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "readar5" "" (cond [(eq_attr "type" "compare") (if_then_else (match_operand 0 "ar5_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,store,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar5_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar5_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setar6" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ar6_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ar6" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ar6_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "usear6" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ar6_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar6_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar6_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "db,dbc") (if_then_else (match_operand 0 "ar6_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "readar6" "" (cond [(eq_attr "type" "compare") (if_then_else (match_operand 0 "ar6_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,store,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar6_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar6_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setar7" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ar7_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ar7" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ar7_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "usear7" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ar7_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar7_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar7_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "db,dbc") (if_then_else (match_operand 0 "ar7_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "readar7" "" (cond [(eq_attr "type" "compare") (if_then_else (match_operand 0 "ar7_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,store,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ar7_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ar7_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setir0" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ir0_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ir0" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ir0_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "useir0" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ir0_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ir0_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ir0_mem_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setir1" "" (cond [(eq_attr "type" "unary,binary") (if_then_else (match_operand 0 "ir1_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "setlda_ir1" "" (cond [(eq_attr "type" "lda") (if_then_else (match_operand 0 "ir1_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "useir1" "" (cond [(eq_attr "type" "compare,store") (if_then_else (match_operand 0 "ir1_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "ir1_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "ir1_mem_operand" "") (const_int 1) (const_int 0))] (const_int 0))); With the C3x, things are simpler, but slower, i.e. more pipeline conflicts :(; There are three functional groups:; (1) AR0-AR7, IR0-IR1, BK; (2) DP; (3) SP;; When a register in one of these functional groups is loaded,; the contents of that or any other register in its group; will not be available to the next instruction for 2 machine cycles.; Similarly, when a register in one of the functional groups is read; excepting (IR0-IR1, BK, DP) the contents of that or any other register; in its group will not be available to the next instruction for; 1 machine cycle.;; Let's ignore functional groups 2 and 3 for now, since they are not; so important.(define_attr "setgroup1" "" (cond [(eq_attr "type" "lda,unary,binary") (if_then_else (match_operand 0 "group1_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "usegroup1" "" (cond [(eq_attr "type" "compare,store,store_store,store_load") (if_then_else (match_operand 0 "group1_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,lda,unary,unarycc,binary,binarycc,load_load,load_store") (if_then_else (match_operand 1 "group1_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "store_store,load_store") (if_then_else (match_operand 2 "group1_mem_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "load_load,store_load") (if_then_else (match_operand 3 "group1_mem_operand" "") (const_int 1) (const_int 0))] (const_int 0)))(define_attr "readarx" "" (cond [(eq_attr "type" "compare") (if_then_else (match_operand 0 "arx_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "compare,store,lda,unary,unarycc,binary,binarycc") (if_then_else (match_operand 1 "arx_reg_operand" "") (const_int 1) (const_int 0)) (eq_attr "type" "binary,binarycc") (if_then_else (match_operand 2 "arx_reg_operand" "") (const_int 1) (const_int 0))] (const_int 0)));; C4x INSN PATTERNS:;; Note that the movMM and addP patterns can be called during reload; so we need to take special care with theses patterns since; we cannot blindly clobber CC or generate new pseudo registers.;; TWO OPERAND INTEGER INSTRUCTIONS;;; LDP/LDPK;(define_insn "set_ldp" [(set (match_operand:QI 0 "dp_reg_operand" "=z") (high:QI (match_operand:QI 1 "" "")))] "! TARGET_SMALL" "* return (TARGET_C3X) ? \"ldp\\t%A1\" : \"ldpk\\t%A1\";" [(set_attr "type" "ldp")])(define_insn "set_ldp_prologue" [(set (match_operand:QI 0 "dp_reg_operand" "=z") (high:QI (match_operand:QI 1 "" "")))] "TARGET_SMALL && TARGET_PARANOID" "* return (TARGET_C3X) ? \"ldp\\t@data_sec\" : \"ldpk\\t@data_sec\";" [(set_attr "type" "ldp")])(define_insn "set_high" [(set (match_operand:QI 0 "std_reg_operand" "=c") (high:QI (match_operand:QI 1 "symbolic_address_operand" "")))] "! TARGET_C3X && ! TARGET_TI" "ldhi\\t^%H1,%0" [(set_attr "type" "unary")])(define_insn "set_lo_sum" [(set (match_operand:QI 0 "std_reg_operand" "+c") (lo_sum:QI (match_dup 0) (match_operand:QI 1 "symbolic_address_operand" "")))] "! TARGET_TI" "or\\t#%H1,%0" [(set_attr "type" "unary")])(define_split [(set (match_operand:QI 0 "std_reg_operand" "") (match_operand:QI 1 "symbolic_address_operand" ""))] "reload_completed && ! TARGET_C3X && ! TARGET_TI" [(set (match_dup 0) (high:QI (match_dup 1))) (set (match_dup 0) (lo_sum:QI (match_dup 0) (match_dup 1)))] "")(define_split [(set (match_operand:QI 0 "reg_operand" "") (match_operand:QI 1 "const_int_operand" "")) (clobber (reg:QI 16))] "! TARGET_C3X && ! IS_INT16_CONST (INTVAL (operands[1])) && ! IS_HIGH_CONST (INTVAL (operands[1])) && reload_completed && std_reg_operand (operands[0], QImode)" [(set (match_dup 0) (match_dup 2)) (set (match_dup 0) (ior:QI (match_dup 0) (match_dup 3)))] "{ operands[2] = GEN_INT (INTVAL (operands[1]) & ~0xffff); operands[3] = GEN_INT (INTVAL (operands[1]) & 0xffff);}")(define_split [(set (match_operand:QI 0 "reg_operand" "") (match_operand:QI 1 "const_int_operand" ""))] "! TARGET_C3X && ! IS_INT16_CONST (INTVAL (operands[1])) && ! IS_HIGH_CONST (INTVAL (operands[1]))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -