This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, i386]: Fix PR85950, Unsafe-math-optimizations regresses optimization using SSE4.1 roundss
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 2 Jun 2018 06:11:57 -0700
- Subject: Re: [PATCH, i386]: Fix PR85950, Unsafe-math-optimizations regresses optimization using SSE4.1 roundss
- References: <CAFULd4Y704OJrSBXmtRq-bf9fC2hKTWCYi+r2zuGXSB5uk_O6A@mail.gmail.com>
On Tue, May 29, 2018 at 11:38 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> Attached patch enables l<rounding_insn><MODEF:mode><SWI48:mode>2 for
> TARGET_SSE4.1, and while there, also corrects operand 1 predicate of
> rounds{s,d} instruction.
>
> 2018-05-29 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/85950
> * config/i386/i386.md (l<rounding_insn><MODEF:mode><SWI48:mode>2):
> Enable for TARGET_SSE4_1 and generate rounds{s,d} and cvtts{s,d}2si{,q}
> sequence.
> (sse4_1_round<mode>2): Use nonimmediate_operand
> for operand 1 predicate.
>
> testsuite/ChangeLog:
>
> 2018-05-29 Uros Bizjak <ubizjak@gmail.com>
>
> PR target/85950
> * gcc.target/i386/pr85950.c: New test.
>
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.
>
> Committed to mainline SVN.
>
The testcase needs -mno-avx512f. Otherwise -march=native on AVX512
machine will generate
vrndscalesd $9, %xmm0, %xmm0, %xmm0
vcvttsd2siq %xmm0, %rax
instead of
vroundsd $9, %xmm0, %xmm0, %xmm0
vcvttsd2siq %xmm0, %rax
--
H.J.