+2017-11-04 Michael Clark <michaeljclark@mac.com>
+
+ * config/riscv/riscv.c (riscv_print_operand): Add a 'i' format.
+ config/riscv/riscv.md (addsi3): Use 'i' for immediates.
+ (adddi3): Likewise.
+ (*addsi3_extended): Likewise.
+ (*addsi3_extended2): Likewise.
+ (<optab>si3): Likewise.
+ (<optab>di3): Likewise.
+ (<optab><mode>3): Likewise.
+ (<*optabe>si3_internal): Likewise.
+ (zero_extendqi<SUPERQI:mode>2): Likewise.
+ (*add<mode>hi3): Likewise.
+ (*xor<mode>hi3): Likewise.
+ (<optab>di3): Likewise.
+ (*<optab>si3_extend): Likewise.
+ (*sge<u>_<X:mode><GPR:mode>): Likewise.
+ (*slt<u>_<X:mode><GPR:mode>): Likewise.
+ (*sle<u>_<X:mode><GPR:mode>): Likewise.
+
2017-11-04 Andrew Waterman <andrew@sifive.com>
* config/riscv/riscv.c (riscv_option_override): Conditionally set
(plus:SI (match_operand:SI 1 "register_operand" " r,r")
(match_operand:SI 2 "arith_operand" " r,I")))]
""
- { return TARGET_64BIT ? "addw\t%0,%1,%2" : "add\t%0,%1,%2"; }
+ { return TARGET_64BIT ? "add%i2w\t%0,%1,%2" : "add%i2\t%0,%1,%2"; }
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
(plus:DI (match_operand:DI 1 "register_operand" " r,r")
(match_operand:DI 2 "arith_operand" " r,I")))]
"TARGET_64BIT"
- "add\t%0,%1,%2"
+ "add%i2\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "DI")])
(plus:SI (match_operand:SI 1 "register_operand" " r,r")
(match_operand:SI 2 "arith_operand" " r,I"))))]
"TARGET_64BIT"
- "addw\t%0,%1,%2"
+ "add%i2w\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
(match_operand:DI 2 "arith_operand" " r,I"))
0)))]
"TARGET_64BIT"
- "addw\t%0,%1,%2"
+ "add%i2w\t%0,%1,%2"
[(set_attr "type" "arith")
(set_attr "mode" "SI")])
(any_div:SI (match_operand:SI 1 "register_operand" " r")
(match_operand:SI 2 "register_operand" " r")))]
"TARGET_DIV"
- { return TARGET_64BIT ? "<insn>w\t%0,%1,%2" : "<insn>\t%0,%1,%2"; }
+ { return TARGET_64BIT ? "<insn>%i2w\t%0,%1,%2" : "<insn>%i2\t%0,%1,%2"; }
[(set_attr "type" "idiv")
(set_attr "mode" "SI")])
(any_div:DI (match_operand:DI 1 "register_operand" " r")
(match_operand:DI 2 "register_operand" " r")))]
"TARGET_DIV && TARGET_64BIT"
- "<insn>\t%0,%1,%2"
+ "<insn>%i2\t%0,%1,%2"
[(set_attr "type" "idiv")
(set_attr "mode" "DI")])
(any_div:SI (match_operand:SI 1 "register_operand" " r")
(match_operand:SI 2 "register_operand" " r"))))]
"TARGET_DIV && TARGET_64BIT"
- "<insn>w\t%0,%1,%2"
+ "<insn>%i2w\t%0,%1,%2"
[(set_attr "type" "idiv")
(set_attr "mode" "DI")])
(any_bitwise:X (match_operand:X 1 "register_operand" "%r,r")
(match_operand:X 2 "arith_operand" " r,I")))]
""
- "<insn>\t%0,%1,%2"
+ "<insn>%i2\t%0,%1,%2"
[(set_attr "type" "logical")
(set_attr "mode" "<MODE>")])
(any_bitwise:SI (match_operand:SI 1 "register_operand" "%r,r")
(match_operand:SI 2 "arith_operand" " r,I")))]
"TARGET_64BIT"
- "<insn>\t%0,%1,%2"
+ "<insn>%i2\t%0,%1,%2"
[(set_attr "type" "logical")
(set_attr "mode" "SI")])
(match_operand:QI 1 "nonimmediate_operand" " r,m")))]
""
"@
- and\t%0,%1,0xff
+ andi\t%0,%1,0xff
lbu\t%0,%1"
[(set_attr "move_type" "andi,load")
(set_attr "mode" "<SUPERQI:MODE>")])
(plus:HI (match_operand:HISI 1 "register_operand" " r,r")
(match_operand:HISI 2 "arith_operand" " r,I")))]
""
- { return TARGET_64BIT ? "addw\t%0,%1,%2" : "add\t%0,%1,%2"; }
+ { return TARGET_64BIT ? "add%i2w\t%0,%1,%2" : "add%i2\t%0,%1,%2"; }
[(set_attr "type" "arith")
(set_attr "mode" "HI")])
(xor:HI (match_operand:HISI 1 "register_operand" " r,r")
(match_operand:HISI 2 "arith_operand" " r,I")))]
""
- "xor\t%0,%1,%2"
+ "xor%i2\t%0,%1,%2"
[(set_attr "type" "logical")
(set_attr "mode" "HI")])
operands[2] = GEN_INT (INTVAL (operands[2])
& (GET_MODE_BITSIZE (SImode) - 1));
- return TARGET_64BIT ? "<insn>w\t%0,%1,%2" : "<insn>\t%0,%1,%2";
+ return TARGET_64BIT ? "<insn>%i2w\t%0,%1,%2" : "<insn>%i2\t%0,%1,%2";
}
[(set_attr "type" "shift")
(set_attr "mode" "SI")])
operands[2] = GEN_INT (INTVAL (operands[2])
& (GET_MODE_BITSIZE (DImode) - 1));
- return "<insn>\t%0,%1,%2";
+ return "<insn>%i2\t%0,%1,%2";
}
[(set_attr "type" "shift")
(set_attr "mode" "DI")])
if (GET_CODE (operands[2]) == CONST_INT)
operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f);
- return "<insn>w\t%0,%1,%2";
+ return "<insn>%i2w\t%0,%1,%2";
}
[(set_attr "type" "shift")
(set_attr "mode" "SI")])
(any_ge:GPR (match_operand:X 1 "register_operand" " r")
(const_int 1)))]
""
- "slt<u>\t%0,zero,%1"
+ "slt%i2<u>\t%0,zero,%1"
[(set_attr "type" "slt")
(set_attr "mode" "<MODE>")])
(any_lt:GPR (match_operand:X 1 "register_operand" " r")
(match_operand:X 2 "arith_operand" " rI")))]
""
- "slt<u>\t%0,%1,%2"
+ "slt%i2<u>\t%0,%1,%2"
[(set_attr "type" "slt")
(set_attr "mode" "<MODE>")])
""
{
operands[2] = GEN_INT (INTVAL (operands[2]) + 1);
- return "slt<u>\t%0,%1,%2";
+ return "slt%i2<u>\t%0,%1,%2";
}
[(set_attr "type" "slt")
(set_attr "mode" "<MODE>")])