* config/i386/i386.md (*popcounthi2_1): New insn_and_split pattern.
testsuite/ChangeLog:
* gcc.target/i386/pr59874-3.c: New test.
From-SVN: r243811
+2016-12-19 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (*popcounthi2_1): New insn_and_split pattern.
+
2016-12-19 Sandra Loosemore <sandra@codesourcery.com>
- * doc/cpp.texi: Clean up anachronistic C99 references and remove
+ * doc/cpp.texi: Clean up anachronistic C99 references and remove
discussion of very old GCC versions.
(Differences from previous versions): Delete entire section.
* config/arc/arc.md (mulsidi_600): Change to insn_and_split,
generate new mul64 insn for core multiplication work.
(umulsidi_600): Likewise, but use mulu64 insn.
- (mul64): New pattern, content taken from old mulsidi_600 insn
- pattern.
+ (mul64): New pattern, content taken from old mulsidi_600 insn pattern.
(mulu64): Likewise, but using umulsidi_600.
(mulsidi3): Remove move to destination, this is now handled by
mulsidi_600 insn_and_split.
(set_attr "type" "bitmanip")
(set_attr "mode" "<MODE>")])
+(define_insn_and_split "*popcounthi2_1"
+ [(set (match_operand:SI 0 "register_operand")
+ (popcount:SI
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand"))))
+ (clobber (reg:CC FLAGS_REG))]
+ "TARGET_POPCNT
+ && can_create_pseudo_p ()"
+ "#"
+ "&& 1"
+ [(const_int 0)]
+{
+ rtx tmp = gen_reg_rtx (HImode);
+
+ emit_insn (gen_popcounthi2 (tmp, operands[1]));
+ emit_insn (gen_zero_extendhisi2 (operands[0], tmp));
+ DONE;
+})
+
(define_insn "popcounthi2"
[(set (match_operand:HI 0 "register_operand" "=r")
(popcount:HI
+2016-12-19 Uros Bizjak <ubizjak@gmail.com>
+
+ * gcc.target/i386/pr59874-3.c: New test.
+
2016-12-19 Will Schmidt <will_schmidt@vnet.ibm.com>
- * gcc.dg/vmx/mult-even-odd-be-order.c: Mark
- variables as volatile.
- * gcc.target/powerpc/fold-vec-mult-char.c: New.
- * gcc.target/powerpc/fold-vec-mult-float.c: New.
- * gcc.target/powerpc/fold-vec-mult-floatdouble.c: New.
- * gcc.target/powerpc/fold-vec-mult-int.c: New.
- * gcc.target/powerpc/fold-vec-mult-int128-p8.c: New.
- * gcc.target/powerpc/fold-vec-mult-int128-p9.c: New.
- * gcc.target/powerpc/fold-vec-mult-longlong.c: New.
- * gcc.target/powerpc/fold-vec-mult-short.c: New.
+ * gcc.dg/vmx/mult-even-odd-be-order.c: Mark variables as volatile.
+ * gcc.target/powerpc/fold-vec-mult-char.c: New.
+ * gcc.target/powerpc/fold-vec-mult-float.c: New.
+ * gcc.target/powerpc/fold-vec-mult-floatdouble.c: New.
+ * gcc.target/powerpc/fold-vec-mult-int.c: New.
+ * gcc.target/powerpc/fold-vec-mult-int128-p8.c: New.
+ * gcc.target/powerpc/fold-vec-mult-int128-p9.c: New.
+ * gcc.target/powerpc/fold-vec-mult-longlong.c: New.
+ * gcc.target/powerpc/fold-vec-mult-short.c: New.
2016-12-19 Will Schmidt <will_schmidt@vnet.ibm.com>
-
+
* gcc.target/powerpc/fold-vec-sub-char.c: New.
* gcc.target/powerpc/fold-vec-sub-float.c: New.
* gcc.target/powerpc/fold-vec-sub-floatdouble.c: New.
2016-12-17 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78746
- * charlen_03.f90: Remove test.
+ * charlen_03.f90: Remove test.
* charlen_10.f90: Ditto.
2016-12-17 Jakub Jelinek <jakub@redhat.com>
--- /dev/null
+/* PR target/59874 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mpopcnt -masm=att" } */
+/* { dg-final { scan-assembler "popcntw" } } */
+
+unsigned int
+foo (unsigned short x)
+{
+ return __builtin_popcount (x);
+}