+2019-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91201
+ * config/i386/mmx.md (reduc_plus_scal_v8qi): New expander.
+
2019-07-31 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn-valu.md
(set_attr "type" "mmxshft,sseiadd,sseiadd")
(set_attr "mode" "DI,TI,TI")])
+(define_expand "reduc_plus_scal_v8qi"
+ [(plus:V8QI
+ (match_operand:QI 0 "register_operand")
+ (match_operand:V8QI 1 "register_operand"))]
+ "TARGET_MMX_WITH_SSE"
+{
+ rtx tmp = gen_reg_rtx (V8QImode);
+ emit_move_insn (tmp, CONST0_RTX (V8QImode));
+ rtx tmp2 = gen_reg_rtx (V1DImode);
+ emit_insn (gen_mmx_psadbw (tmp2, operands[1], tmp));
+ tmp2 = gen_lowpart (V8QImode, tmp2);
+ emit_insn (gen_vec_extractv8qiqi (operands[0], tmp2, const0_rtx));
+ DONE;
+})
+
(define_insn_and_split "mmx_pmovmskb"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(unspec:SI [(match_operand:V8QI 1 "register_operand" "y,x")]
+2019-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91201
+ * gcc.target/i386/sse2-pr91201-2.c: New test.
+
2019-07-31 Richard Biener <rguenther@suse.de>
PR tree-optimization/91178
--- /dev/null
+/* PR tree-optimization/91201 */
+/* { dg-do compile { target lp64 } } */
+/* { dg-options "-O3 -msse2 -mno-sse3" } */
+/* { dg-final { scan-assembler "\tpsadbw\t" } } */
+
+unsigned char bytes[1024];
+
+unsigned char
+sum (void)
+{
+ unsigned char r = 0;
+ unsigned char *p = (unsigned char *) bytes;
+ int n;
+
+ for (n = 8; n < sizeof (bytes); ++n)
+ {
+ p[n - 8] += p[n];
+ r += p[n];
+ }
+ return r;
+}