+2016-12-06 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/78658
+ * config/rs6000/rs6000.md (zero_extendqi<mode>2): Use ^ instead of
+ ?* constraints for the ISA 3.0 patterns, so the register allocator
+ is more likely to allocate QImode/HImode to vector registers for
+ conversion to floating point unless a reload is needed.
+ (zero_extendhi<mode>2): Likewise.
+ (float<QHI:mode><FP_ISA3:mode>2_internal): Properly deal with the
+ first alternative which is converting QImode/HImode to floating
+ point and the QImode/HImode value is in a vector register, and
+ does not allocate the second pseudo register. Remove zero
+ extending into traditional floating point registers, since the
+ instruction used only works on traditional altivec registers.
+ (floatuns<QHI:mode><FP_ISA3:mode>2_internal): Likewise.
+
2016-12-06 David Malcolm <dmalcolm@redhat.com>
* config/i386/i386.c: Include print-rtl.h.
;; complex forms. Basic data transfer is done later.
(define_insn "zero_extendqi<mode>2"
- [(set (match_operand:EXTQI 0 "gpc_reg_operand" "=r,r,?*wJwK,?*wK")
- (zero_extend:EXTQI (match_operand:QI 1 "reg_or_mem_operand" "m,r,Z,*wK")))]
+ [(set (match_operand:EXTQI 0 "gpc_reg_operand" "=r,r,^wJwK,^wK")
+ (zero_extend:EXTQI (match_operand:QI 1 "reg_or_mem_operand" "m,r,Z,wK")))]
""
"@
lbz%U1%X1 %0,%1
(define_insn "zero_extendhi<mode>2"
- [(set (match_operand:EXTHI 0 "gpc_reg_operand" "=r,r,?*wJwK,?*wK")
+ [(set (match_operand:EXTHI 0 "gpc_reg_operand" "=r,r,^wJwK,^wK")
(zero_extend:EXTHI (match_operand:HI 1 "reg_or_mem_operand" "m,r,Z,wK")))]
""
"@
if (!MEM_P (input))
{
+ rtx tmp = operands[3];
if (altivec_register_operand (input, <QHI:MODE>mode))
emit_insn (gen_extend<QHI:mode>di2 (di, input));
+ else if (GET_CODE (tmp) == SCRATCH)
+ emit_insn (gen_extend<QHI:mode>di2 (di, input));
else
{
- rtx tmp = operands[3];
emit_insn (gen_extend<QHI:mode>di2 (tmp, input));
emit_move_insn (di, tmp);
}
(define_insn_and_split "*floatuns<QHI:mode><FP_ISA3:mode>2_internal"
[(set (match_operand:FP_ISA3 0 "vsx_register_operand" "=<Fv>,<Fv>,<Fv>")
(unsigned_float:FP_ISA3
- (match_operand:QHI 1 "reg_or_indexed_operand" "wJwK,r,Z")))
+ (match_operand:QHI 1 "reg_or_indexed_operand" "wK,r,Z")))
(clobber (match_scratch:DI 2 "=wK,wi,wJwK"))
(clobber (match_scratch:DI 3 "=X,r,X"))]
"TARGET_P9_VECTOR && TARGET_DIRECT_MOVE && TARGET_POWERPC64
else
{
rtx tmp = operands[3];
- emit_insn (gen_zero_extend<QHI:mode>di2 (tmp, input));
- emit_move_insn (di, tmp);
+ if (GET_CODE (tmp) == SCRATCH)
+ emit_insn (gen_extend<QHI:mode>di2 (di, input));
+ else
+ {
+ emit_insn (gen_zero_extend<QHI:mode>di2 (tmp, input));
+ emit_move_insn (di, tmp);
+ }
}
emit_insn (gen_floatdi<FP_ISA3:mode>2 (result, di));