From c1a106c222804416897c53f3c5dc8f028137151e Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 28 Jun 2019 08:46:56 +0000 Subject: [PATCH] x86: fix CVT{,T}PD2PI insns With just an "m" constraint misaligned memory operands won't be forced into a register, and hence cause #GP. So far this was guaranteed only in the case that CVT{,T}PD2DQ were chosen (which looks to be the case on x86-64 only). Switch the second alternative to Bm and also replace nonimmediate_operand by vector_operand. From-SVN: r272780 --- gcc/ChangeLog | 5 +++++ gcc/config/i386/sse.md | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 898b5a1..35c5163 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-06-28 Jan Beulich + + * config/i386/sse.md (sse2_cvtpd2pi, sse2_cvttpd2pi): Use + vector_operand plus, on both alternatives, "Bm" constraint. + 2019-06-28 Dennis Zhang * config/arm/arm.md: Remove redundant constraints from diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 8b4f6c1..1546817 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -5505,7 +5505,7 @@ (define_insn "sse2_cvtpd2pi" [(set (match_operand:V2SI 0 "register_operand" "=v,?!y") - (unspec:V2SI [(match_operand:V2DF 1 "nonimmediate_operand" "vBm,xm")] + (unspec:V2SI [(match_operand:V2DF 1 "vector_operand" "vBm,xBm")] UNSPEC_FIX_NOTRUNC))] "TARGET_SSE2" "@ @@ -5523,7 +5523,7 @@ (define_insn "sse2_cvttpd2pi" [(set (match_operand:V2SI 0 "register_operand" "=v,?!y") - (fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "vBm,xm")))] + (fix:V2SI (match_operand:V2DF 1 "vector_operand" "vBm,xBm")))] "TARGET_SSE2" "@ * return TARGET_AVX ? \"vcvttpd2dq{x}\t{%1, %0|%0, %1}\" : \"cvttpd2dq\t{%1, %0|%0, %1}\"; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed07047..a1fbb04 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-06-28 Jan Beulich + + * gcc.target/i386/cvtpd2pi: New. + 2019-06-27 Jakub Jelinek PR c++/91024 -- 2.7.4