;; Insn type, it is used to default other attribute values.
(define_attr "type"
- "unknown,move,load,store,load_multiple,store_multiple,alu,compare,branch,call,misc"
+ "unknown,load,store,load_multiple,store_multiple,alu,alu_shift,mul,mac,div,branch,call,misc"
(const_string "unknown"))
-
;; Length, in bytes, default is 4-bytes.
(define_attr "length" "" (const_int 4))
(match_operand:SI 1 "nds32_symbolic_operand" " i, i"))]
""
"la\t%0, %1"
- [(set_attr "type" "move")
+ [(set_attr "type" "alu")
(set_attr "length" "8")])
return "add_slli\t%0, %3, %1, %2";
}
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "combo" "2")
+ (set_attr "length" "4")])
(define_insn "*add_srli"
[(set (match_operand:SI 0 "register_operand" "= r")
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"add_srli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "combo" "2")
+ (set_attr "length" "4")])
;; GCC intends to simplify (minus (reg) (ashift ...))
return "sub_slli\t%0, %1, %2, %3";
}
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "combo" "2")
+ (set_attr "length" "4")])
(define_insn "*sub_srli"
[(set (match_operand:SI 0 "register_operand" "= r")
(match_operand:SI 3 "immediate_operand" " Iu05"))))]
"TARGET_ISA_V3"
"sub_srli\t%0, %1, %2, %3"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "combo" "2")
+ (set_attr "length" "4")])
;; Multiplication instructions.
"@
mul33\t%0, %2
mul\t%0, %1, %2"
- [(set_attr "type" "alu,alu")
+ [(set_attr "type" "mul,mul")
(set_attr "length" " 2, 4")])
(define_insn "mulsidi3"
(sign_extend:DI (match_operand:SI 2 "register_operand" " r"))))]
"TARGET_ISA_V2 || TARGET_ISA_V3"
"mulsr64\t%0, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "mul")
(set_attr "length" "4")])
(define_insn "umulsidi3"
(zero_extend:DI (match_operand:SI 2 "register_operand" " r"))))]
"TARGET_ISA_V2 || TARGET_ISA_V3"
"mulr64\t%0, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "mul")
(set_attr "length" "4")])
(match_operand:SI 2 "register_operand" " r"))))]
""
"maddr32\t%0, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "mac")
(set_attr "length" "4")])
(define_insn "*maddr32_1"
(match_operand:SI 3 "register_operand" " 0")))]
""
"maddr32\t%0, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "mac")
(set_attr "length" "4")])
(define_insn "*msubr32"
(match_operand:SI 2 "register_operand" " r"))))]
""
"msubr32\t%0, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "mac")
(set_attr "length" "4")])
(mod:SI (match_dup 1) (match_dup 2)))]
""
"divsr\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "div")
(set_attr "length" "4")])
(define_insn "udivmodsi4"
(umod:SI (match_dup 1) (match_dup 2)))]
""
"divr\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
+ [(set_attr "type" "div")
(set_attr "length" "4")])
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"and_slli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
(define_insn "*and_srli"
[(set (match_operand:SI 0 "register_operand" "= r")
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"and_srli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
;; ----------------------------------------------------------------------------
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"or_slli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
(define_insn "*or_srli"
[(set (match_operand:SI 0 "register_operand" "= r")
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"or_srli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
;; ----------------------------------------------------------------------------
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"xor_slli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
(define_insn "*xor_srli"
[(set (match_operand:SI 0 "register_operand" "= r")
(match_operand:SI 3 "register_operand" " r")))]
"TARGET_ISA_V3"
"xor_srli\t%0, %3, %1, %2"
- [(set_attr "type" "alu")
- (set_attr "length" "4")])
+ [(set_attr "type" "alu_shift")
+ (set_attr "length" "4")])
;; Rotate Right Instructions.
"@
rotri\t%0, %1, %2
rotr\t%0, %1, %2"
- [(set_attr "type" "alu,alu")
- (set_attr "length" " 4, 4")])
+ [(set_attr "type" " alu, alu")
+ (set_attr "length" " 4, 4")])
;; ----------------------------------------------------------------------------
"@
cmovz\t%0, %2, %1
cmovn\t%0, %3, %1"
- [(set_attr "type" "move")
+ [(set_attr "type" "alu")
(set_attr "length" "4")])
(define_insn "cmovn"
"@
cmovn\t%0, %2, %1
cmovz\t%0, %3, %1"
- [(set_attr "type" "move")
+ [(set_attr "type" "alu")
(set_attr "length" "4")])
sltsi45\t%1, %2
slts\t%0, %1, %2
sltsi\t%0, %1, %2"
- [(set_attr "type" "compare,compare,compare,compare")
+ [(set_attr "type" " alu, alu, alu, alu")
(set_attr "length" " 2, 2, 4, 4")])
(define_insn "slt_compare"
slti45\t%1, %2
slt\t%0, %1, %2
slti\t%0, %1, %2"
- [(set_attr "type" "compare,compare,compare,compare")
- (set_attr "length" " 2, 2, 4, 4")])
+ [(set_attr "type" "alu, alu, alu, alu")
+ (set_attr "length" " 2, 2, 4, 4")])
;; ----------------------------------------------------------------------------
return nds32_output_casesi (operands);
}
[(set_attr "length" "20")
- (set_attr "type" "alu")])
+ (set_attr "type" "branch")])
;; ----------------------------------------------------------------------------