From bd2537ed5d4cda1a896974f30bd62dfb68ae39b0 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Thu, 20 Feb 2020 21:58:57 +0100 Subject: [PATCH] i386: Fix *vec_extractv2sf_1 and *vec_extractv2sf_1 shufps alternative [PR93828] shufps moves two of the four packed single-precision floating-point values from *destination* operand (first operand) into the low quadword of the destination operand. Match source operand to the destination. PR target/93828 * config/i386/mmx.md (*vec_extractv2sf_1): Match source operand to destination operand for shufps alternative. (*vec_extractv2si_1): Ditto. --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/mmx.md | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9680a1afb405..a9042799a97d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2020-02-20 Uroš Bizjak + + PR target/93828 + * config/i386/mmx.md (*vec_extractv2sf_1): Match source operand + to destination operand for shufps alternative. + (*vec_extractv2si_1): Ditto. + 2020-02-20 H.J. Lu Backport from master diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index b566cc800202..15e4c84b54fa 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -626,13 +626,13 @@ (define_insn "*vec_extractv2sf_1" [(set (match_operand:SF 0 "nonimmediate_operand" "=y,x,x,y,x,f,r") (vec_select:SF - (match_operand:V2SF 1 "nonimmediate_operand" " 0,x,x,o,o,o,o") + (match_operand:V2SF 1 "nonimmediate_operand" " 0,x,0,o,o,o,o") (parallel [(const_int 1)])))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ punpckhdq\t%0, %0 %vmovshdup\t{%1, %0|%0, %1} - shufps\t{$0xe5, %1, %0|%0, %1, 0xe5} + shufps\t{$0xe5, %0, %0|%0, %0, 0xe5} # # # @@ -1320,13 +1320,13 @@ (define_insn "*vec_extractv2si_1" [(set (match_operand:SI 0 "nonimmediate_operand" "=y,x,x,y,x,r") (vec_select:SI - (match_operand:V2SI 1 "nonimmediate_operand" " 0,x,x,o,o,o") + (match_operand:V2SI 1 "nonimmediate_operand" " 0,x,0,o,o,o") (parallel [(const_int 1)])))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" "@ punpckhdq\t%0, %0 %vpshufd\t{$0xe5, %1, %0|%0, %1, 0xe5} - shufps\t{$0xe5, %1, %0|%0, %1, 0xe5} + shufps\t{$0xe5, %0, %0|%0, %0, 0xe5} # # #" -- 2.47.2