Re: [PATCH][X86] Fix rounding pattern similar to PR73350
Hello Julia, Uroš, On 16 Jun 09:05, Uros Bizjak wrote: > On Fri, Jun 16, 2017 at 8:46 AM, Koval, Juliawrote: > > Hi, > > > > This test hangs on avx512er, maybe that's why: > >> According to POSIX, the behavior of a process is undefined after it > >> ignores a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by > >> kill(2) or raise(3). > > > > And volatile make it work even without a patch(r1 and r2 are not combined > > then). > > > > Added other changes. > > The testcase LGTM. I'll leave the final approval to Kirill. The change and the case are fine to me. I've committed it to main trunk. > > Uros. =- Thanks, K
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Fri, Jun 16, 2017 at 8:46 AM, Koval, Juliawrote: > Hi, > > This test hangs on avx512er, maybe that's why: >> According to POSIX, the behavior of a process is undefined after it ignores >> a SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(2) or >> raise(3). > > And volatile make it work even without a patch(r1 and r2 are not combined > then). > > Added other changes. The testcase LGTM. I'll leave the final approval to Kirill. Uros.
RE: [PATCH][X86] Fix rounding pattern similar to PR73350
Hi, This test hangs on avx512er, maybe that's why: > According to POSIX, the behavior of a process is undefined after it ignores a > SIGFPE, SIGILL, or SIGSEGV signal that was not generated by kill(2) or > raise(3). And volatile make it work even without a patch(r1 and r2 are not combined then). Added other changes. Thanks, Julia > -Original Message- > From: Uros Bizjak [mailto:ubiz...@gmail.com] > Sent: Wednesday, June 14, 2017 11:54 AM > To: Koval, Julia <julia.ko...@intel.com> > Cc: Richard Biener <richard.guent...@gmail.com>; Jakub Jelinek > <ja...@redhat.com>; H.J. Lu <hjl.to...@gmail.com>; GCC Patches patc...@gcc.gnu.org>; Kirill Yukhin <kirill.yuk...@gmail.com> > Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > > On Tue, Jun 13, 2017 at 1:37 PM, Koval, Julia <julia.ko...@intel.com> wrote: > > Thank you for your help. I fixed the test similar to existing sigaction > > tests. > > > > gcc/ > > * config/i386/i386.c: Fix rounding expand for new pattern. > > * config/i386/subst.md: Fix pattern (parallel -> unspec). > > gcc/testsuite/ > > * gcc.target/i386/pr73350-2.c: New test. > > The test will fail at runtime on non-avx512er targets. Can you please > test the attached testcase? > > Uros. 0001-fix.patch Description: 0001-fix.patch
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Tue, Jun 13, 2017 at 1:37 PM, Koval, Juliawrote: > Thank you for your help. I fixed the test similar to existing sigaction tests. > > gcc/ > * config/i386/i386.c: Fix rounding expand for new pattern. > * config/i386/subst.md: Fix pattern (parallel -> unspec). > gcc/testsuite/ > * gcc.target/i386/pr73350-2.c: New test. The test will fail at runtime on non-avx512er targets. Can you please test the attached testcase? Uros. /* { dg-do run { target *-*-linux* *-*-gnu* } } */ /* { dg-options "-O2 -mavx512er" } */ /* { dg-require-effective-target avx512er } */ #include "avx512er-check.h" #include #include #include static int counter; void handler (int i) { counter++; } static void avx512er_test (void) { struct sigaction s; sigemptyset (_mask); s.sa_handler = handler; s.sa_flags = 0; sigaction (SIGFPE, , NULL); __m512 a = _mm512_set1_ps (-1.f); _mm_setcsr ( _MM_MASK_MASK & ~_MM_MASK_INVALID ); volatile __m512 r1 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_NO_EXC); volatile __m512 r2 = _mm512_rsqrt28_round_ps (a, _MM_FROUND_CUR_DIRECTION); if (counter != 1) abort (); }
RE: [PATCH][X86] Fix rounding pattern similar to PR73350
Thank you for your help. I fixed the test similar to existing sigaction tests. gcc/ * config/i386/i386.c: Fix rounding expand for new pattern. * config/i386/subst.md: Fix pattern (parallel -> unspec). gcc/testsuite/ * gcc.target/i386/pr73350-2.c: New test. Thanks, Julia > -Original Message- > From: Richard Biener [mailto:richard.guent...@gmail.com] > Sent: Tuesday, June 13, 2017 10:09 AM > To: Koval, Julia <julia.ko...@intel.com> > Cc: Jakub Jelinek <ja...@redhat.com>; H.J. Lu <hjl.to...@gmail.com>; GCC > Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak <ubiz...@gmail.com>; Kirill > Yukhin <kirill.yuk...@gmail.com> > Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > > On Mon, Jun 12, 2017 at 6:50 PM, Koval, Julia <julia.ko...@intel.com> wrote: > > I'm so sorry, but I really don't get it. The right result of the test is: > > Floating > point exception (core dumped). The wrong result of the test is: nan(no > exception). If I get an exception(which is right) - the test is failed > anyway. The > exception is raised in one instruction, I can't get any intermediate value > there.. > > We do have a few testcases catching these cases by installing a signal > handler (grep for sigaction in testsuite/) > > Richard. > > > I tried to replaced it with compile time test(attached), which shows, that > > both > instruction are generated(not combined) - is it ok? > > > > Thanks, > > Julia > > > >> -Original Message- > >> From: Jakub Jelinek [mailto:ja...@redhat.com] > >> Sent: Monday, June 12, 2017 6:18 PM > >> To: H.J. Lu <hjl.to...@gmail.com> > >> Cc: Koval, Julia <julia.ko...@intel.com>; GCC Patches >> patc...@gcc.gnu.org>; Uros Bizjak <ubiz...@gmail.com>; Kirill Yukhin > >> <kirill.yuk...@gmail.com> > >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > >> > >> On Mon, Jun 12, 2017 at 09:08:00AM -0700, H.J. Lu wrote: > >> > On Mon, Jun 12, 2017 at 9:06 AM, Koval, Julia <julia.ko...@intel.com> > wrote: > >> > > I would like to, but as far as I know the only testcase possible is > >> > > below, > and > >> as far as I know there is no possibility to use dg-error for runtime > >> exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag > exception > >> or no exception and the error is, when they are combined in CSE. > >> > > >> > Can you use > >> > > >> > if (wrong) > >> > abort (); > >> > > >> > in testcase? > >> > >> Where wrong can also be if (__builtin_fabsf (somefloatval - expectedval) < > >> epsilon) > >> or similar if needed. Also, the testcase contains many unnecessary > >> includes, if you use __builtin_abort, I'd hope you only need x86intrin.h > >> and > >> nothing else. And, main can be just int main (), argc and argv aren't > >> used. > >> > > >> > >> -Original Message- > >> > >> From: H.J. Lu [mailto:hjl.to...@gmail.com] > >> > >> Sent: Monday, June 12, 2017 3:43 PM > >> > >> To: Koval, Julia <julia.ko...@intel.com> > >> > >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak > >> > >> <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> > >> > >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > >> > >> > >> > >> On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> > >> wrote: > >> > >> > This is the same issue as PR73350 and PR80862 for disabling FP > >> exceptions. > >> > >> > > >> > >> > gcc -O0 -mavx512f -mavx512er returns exception > >> > >> > gcc -O2 -mavx512f -mavx512er returns nan > >> > >> > > >> > >> > For this code: > >> > >> > > >> > >> > #include > >> > >> > #include > >> > >> > #include > >> > >> > #include > >> > >> > #include > >> > >> > > >> > >> > int main(int argc, char *argv[]) { > >> > >> > __m512 a = _mm512_set1_ps((float) -1); > >> > >> > __m512 b = _mm512_set1_ps((float) -1); > >> > >> > _mm_setcsr( _MM_MASK_MASK &~ > >> > >> > > >> > >> > (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) > >> ); > >> > >> > __m512 result1 = _mm512_rsqrt28_round_ps(a, > >> _MM_FROUND_NO_EXC ); > >> > >> > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, > >> > >> _MM_FROUND_NO_EXC); > >> > >> > __m512 result2 = _mm512_rsqrt28_round_ps(a, > >> > >> _MM_FROUND_CUR_DIRECTION); > >> > >> > > >> > >> > printf("%g\n", result1[0] - result2[0]); > >> > >> > > >> > >> > return 0; > >> > >> > } > >> > >> Jakub 0001-fix.patch Description: 0001-fix.patch
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Mon, Jun 12, 2017 at 6:50 PM, Koval, Julia <julia.ko...@intel.com> wrote: > I'm so sorry, but I really don't get it. The right result of the test is: > Floating point exception (core dumped). The wrong result of the test is: > nan(no exception). If I get an exception(which is right) - the test is failed > anyway. The exception is raised in one instruction, I can't get any > intermediate value there.. We do have a few testcases catching these cases by installing a signal handler (grep for sigaction in testsuite/) Richard. > I tried to replaced it with compile time test(attached), which shows, that > both instruction are generated(not combined) - is it ok? > > Thanks, > Julia > >> -Original Message- >> From: Jakub Jelinek [mailto:ja...@redhat.com] >> Sent: Monday, June 12, 2017 6:18 PM >> To: H.J. Lu <hjl.to...@gmail.com> >> Cc: Koval, Julia <julia.ko...@intel.com>; GCC Patches > patc...@gcc.gnu.org>; Uros Bizjak <ubiz...@gmail.com>; Kirill Yukhin >> <kirill.yuk...@gmail.com> >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 >> >> On Mon, Jun 12, 2017 at 09:08:00AM -0700, H.J. Lu wrote: >> > On Mon, Jun 12, 2017 at 9:06 AM, Koval, Julia <julia.ko...@intel.com> >> > wrote: >> > > I would like to, but as far as I know the only testcase possible is >> > > below, and >> as far as I know there is no possibility to use dg-error for runtime >> exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag >> exception >> or no exception and the error is, when they are combined in CSE. >> > >> > Can you use >> > >> > if (wrong) >> > abort (); >> > >> > in testcase? >> >> Where wrong can also be if (__builtin_fabsf (somefloatval - expectedval) < >> epsilon) >> or similar if needed. Also, the testcase contains many unnecessary >> includes, if you use __builtin_abort, I'd hope you only need x86intrin.h and >> nothing else. And, main can be just int main (), argc and argv aren't used. >> > >> > >> -----Original Message- >> > >> From: H.J. Lu [mailto:hjl.to...@gmail.com] >> > >> Sent: Monday, June 12, 2017 3:43 PM >> > >> To: Koval, Julia <julia.ko...@intel.com> >> > >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak >> > >> <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> >> > >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 >> > >> >> > >> On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> >> wrote: >> > >> > This is the same issue as PR73350 and PR80862 for disabling FP >> exceptions. >> > >> > >> > >> > gcc -O0 -mavx512f -mavx512er returns exception >> > >> > gcc -O2 -mavx512f -mavx512er returns nan >> > >> > >> > >> > For this code: >> > >> > >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > #include >> > >> > >> > >> > int main(int argc, char *argv[]) { >> > >> > __m512 a = _mm512_set1_ps((float) -1); >> > >> > __m512 b = _mm512_set1_ps((float) -1); >> > >> > _mm_setcsr( _MM_MASK_MASK &~ >> > >> > >> > >> (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) >> ); >> > >> > __m512 result1 = _mm512_rsqrt28_round_ps(a, >> _MM_FROUND_NO_EXC ); >> > >> > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, >> > >> _MM_FROUND_NO_EXC); >> > >> > __m512 result2 = _mm512_rsqrt28_round_ps(a, >> > >> _MM_FROUND_CUR_DIRECTION); >> > >> > >> > >> > printf("%g\n", result1[0] - result2[0]); >> > >> > >> > >> > return 0; >> > >> > } >> >> Jakub
RE: [PATCH][X86] Fix rounding pattern similar to PR73350
I'm so sorry, but I really don't get it. The right result of the test is: Floating point exception (core dumped). The wrong result of the test is: nan(no exception). If I get an exception(which is right) - the test is failed anyway. The exception is raised in one instruction, I can't get any intermediate value there.. I tried to replaced it with compile time test(attached), which shows, that both instruction are generated(not combined) - is it ok? Thanks, Julia > -Original Message- > From: Jakub Jelinek [mailto:ja...@redhat.com] > Sent: Monday, June 12, 2017 6:18 PM > To: H.J. Lu <hjl.to...@gmail.com> > Cc: Koval, Julia <julia.ko...@intel.com>; GCC Patches patc...@gcc.gnu.org>; Uros Bizjak <ubiz...@gmail.com>; Kirill Yukhin > <kirill.yuk...@gmail.com> > Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > > On Mon, Jun 12, 2017 at 09:08:00AM -0700, H.J. Lu wrote: > > On Mon, Jun 12, 2017 at 9:06 AM, Koval, Julia <julia.ko...@intel.com> wrote: > > > I would like to, but as far as I know the only testcase possible is > > > below, and > as far as I know there is no possibility to use dg-error for runtime > exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag > exception > or no exception and the error is, when they are combined in CSE. > > > > Can you use > > > > if (wrong) > > abort (); > > > > in testcase? > > Where wrong can also be if (__builtin_fabsf (somefloatval - expectedval) < > epsilon) > or similar if needed. Also, the testcase contains many unnecessary > includes, if you use __builtin_abort, I'd hope you only need x86intrin.h and > nothing else. And, main can be just int main (), argc and argv aren't used. > > > > >> -Original Message- > > >> From: H.J. Lu [mailto:hjl.to...@gmail.com] > > >> Sent: Monday, June 12, 2017 3:43 PM > > >> To: Koval, Julia <julia.ko...@intel.com> > > >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak > > >> <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> > > >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > > >> > > >> On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> > wrote: > > >> > This is the same issue as PR73350 and PR80862 for disabling FP > exceptions. > > >> > > > >> > gcc -O0 -mavx512f -mavx512er returns exception > > >> > gcc -O2 -mavx512f -mavx512er returns nan > > >> > > > >> > For this code: > > >> > > > >> > #include > > >> > #include > > >> > #include > > >> > #include > > >> > #include > > >> > > > >> > int main(int argc, char *argv[]) { > > >> > __m512 a = _mm512_set1_ps((float) -1); > > >> > __m512 b = _mm512_set1_ps((float) -1); > > >> > _mm_setcsr( _MM_MASK_MASK &~ > > >> > > > >> (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) > ); > > >> > __m512 result1 = _mm512_rsqrt28_round_ps(a, > _MM_FROUND_NO_EXC ); > > >> > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, > > >> _MM_FROUND_NO_EXC); > > >> > __m512 result2 = _mm512_rsqrt28_round_ps(a, > > >> _MM_FROUND_CUR_DIRECTION); > > >> > > > >> > printf("%g\n", result1[0] - result2[0]); > > >> > > > >> > return 0; > > >> > } > > Jakub 0001-fix.patch Description: 0001-fix.patch
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Mon, Jun 12, 2017 at 09:08:00AM -0700, H.J. Lu wrote: > On Mon, Jun 12, 2017 at 9:06 AM, Koval, Julia <julia.ko...@intel.com> wrote: > > I would like to, but as far as I know the only testcase possible is below, > > and as far as I know there is no possibility to use dg-error for runtime > > exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag > > exception or no exception and the error is, when they are combined in CSE. > > Can you use > > if (wrong) > abort (); > > in testcase? Where wrong can also be if (__builtin_fabsf (somefloatval - expectedval) < epsilon) or similar if needed. Also, the testcase contains many unnecessary includes, if you use __builtin_abort, I'd hope you only need x86intrin.h and nothing else. And, main can be just int main (), argc and argv aren't used. > > >> -Original Message- > >> From: H.J. Lu [mailto:hjl.to...@gmail.com] > >> Sent: Monday, June 12, 2017 3:43 PM > >> To: Koval, Julia <julia.ko...@intel.com> > >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak > >> <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> > >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > >> > >> On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> > >> wrote: > >> > This is the same issue as PR73350 and PR80862 for disabling FP > >> > exceptions. > >> > > >> > gcc -O0 -mavx512f -mavx512er returns exception > >> > gcc -O2 -mavx512f -mavx512er returns nan > >> > > >> > For this code: > >> > > >> > #include > >> > #include > >> > #include > >> > #include > >> > #include > >> > > >> > int main(int argc, char *argv[]) { > >> > __m512 a = _mm512_set1_ps((float) -1); > >> > __m512 b = _mm512_set1_ps((float) -1); > >> > _mm_setcsr( _MM_MASK_MASK &~ > >> > > >> (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) ); > >> > __m512 result1 = _mm512_rsqrt28_round_ps(a, _MM_FROUND_NO_EXC ); > >> > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, > >> _MM_FROUND_NO_EXC); > >> > __m512 result2 = _mm512_rsqrt28_round_ps(a, > >> _MM_FROUND_CUR_DIRECTION); > >> > > >> > printf("%g\n", result1[0] - result2[0]); > >> > > >> > return 0; > >> > } Jakub
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Mon, Jun 12, 2017 at 9:06 AM, Koval, Julia <julia.ko...@intel.com> wrote: > I would like to, but as far as I know the only testcase possible is below, > and as far as I know there is no possibility to use dg-error for runtime > exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag > exception or no exception and the error is, when they are combined in CSE. Can you use if (wrong) abort (); in testcase? >> -Original Message- >> From: H.J. Lu [mailto:hjl.to...@gmail.com] >> Sent: Monday, June 12, 2017 3:43 PM >> To: Koval, Julia <julia.ko...@intel.com> >> Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak >> <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> >> Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 >> >> On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> wrote: >> > This is the same issue as PR73350 and PR80862 for disabling FP exceptions. >> > >> > gcc -O0 -mavx512f -mavx512er returns exception >> > gcc -O2 -mavx512f -mavx512er returns nan >> > >> > For this code: >> > >> > #include >> > #include >> > #include >> > #include >> > #include >> > >> > int main(int argc, char *argv[]) { >> > __m512 a = _mm512_set1_ps((float) -1); >> > __m512 b = _mm512_set1_ps((float) -1); >> > _mm_setcsr( _MM_MASK_MASK &~ >> > >> (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) ); >> > __m512 result1 = _mm512_rsqrt28_round_ps(a, _MM_FROUND_NO_EXC ); >> > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, >> _MM_FROUND_NO_EXC); >> > __m512 result2 = _mm512_rsqrt28_round_ps(a, >> _MM_FROUND_CUR_DIRECTION); >> > >> > printf("%g\n", result1[0] - result2[0]); >> > >> > return 0; >> > } >> > >> > This patch fixes the issue. >> > >> > gcc/ >> > * config/i386/i386.c: Fix rounding expand for new pattern >> > * config/i386/subst.md: Fix pattern (parallel -> unspec) >> > >> > Ok for trunk? >> > >> >> Please include the testcase. >> >> Thanks. >> >> -- >> H.J. -- H.J.
RE: [PATCH][X86] Fix rounding pattern similar to PR73350
I would like to, but as far as I know the only testcase possible is below, and as far as I know there is no possibility to use dg-error for runtime exceptions(Sorry, if I'm wrong). There are only 2 versions of the flag exception or no exception and the error is, when they are combined in CSE. > -Original Message- > From: H.J. Lu [mailto:hjl.to...@gmail.com] > Sent: Monday, June 12, 2017 3:43 PM > To: Koval, Julia <julia.ko...@intel.com> > Cc: GCC Patches <gcc-patches@gcc.gnu.org>; Uros Bizjak > <ubiz...@gmail.com>; Kirill Yukhin <kirill.yuk...@gmail.com> > Subject: Re: [PATCH][X86] Fix rounding pattern similar to PR73350 > > On Mon, Jun 12, 2017 at 6:21 AM, Koval, Julia <julia.ko...@intel.com> wrote: > > This is the same issue as PR73350 and PR80862 for disabling FP exceptions. > > > > gcc -O0 -mavx512f -mavx512er returns exception > > gcc -O2 -mavx512f -mavx512er returns nan > > > > For this code: > > > > #include > > #include > > #include > > #include > > #include > > > > int main(int argc, char *argv[]) { > > __m512 a = _mm512_set1_ps((float) -1); > > __m512 b = _mm512_set1_ps((float) -1); > > _mm_setcsr( _MM_MASK_MASK &~ > > > (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) ); > > __m512 result1 = _mm512_rsqrt28_round_ps(a, _MM_FROUND_NO_EXC ); > > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, > _MM_FROUND_NO_EXC); > > __m512 result2 = _mm512_rsqrt28_round_ps(a, > _MM_FROUND_CUR_DIRECTION); > > > > printf("%g\n", result1[0] - result2[0]); > > > > return 0; > > } > > > > This patch fixes the issue. > > > > gcc/ > > * config/i386/i386.c: Fix rounding expand for new pattern > > * config/i386/subst.md: Fix pattern (parallel -> unspec) > > > > Ok for trunk? > > > > Please include the testcase. > > Thanks. > > -- > H.J.
Re: [PATCH][X86] Fix rounding pattern similar to PR73350
On Mon, Jun 12, 2017 at 6:21 AM, Koval, Juliawrote: > This is the same issue as PR73350 and PR80862 for disabling FP exceptions. > > gcc -O0 -mavx512f -mavx512er returns exception > gcc -O2 -mavx512f -mavx512er returns nan > > For this code: > > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]) { > __m512 a = _mm512_set1_ps((float) -1); > __m512 b = _mm512_set1_ps((float) -1); > _mm_setcsr( _MM_MASK_MASK &~ > (_MM_MASK_OVERFLOW|_MM_MASK_INVALID|_MM_MASK_DIV_ZERO) ); > __m512 result1 = _mm512_rsqrt28_round_ps(a, _MM_FROUND_NO_EXC ); > printf("%d %d\n", _MM_FROUND_CUR_DIRECTION, _MM_FROUND_NO_EXC); > __m512 result2 = _mm512_rsqrt28_round_ps(a, _MM_FROUND_CUR_DIRECTION); > > printf("%g\n", result1[0] - result2[0]); > > return 0; > } > > This patch fixes the issue. > > gcc/ > * config/i386/i386.c: Fix rounding expand for new pattern > * config/i386/subst.md: Fix pattern (parallel -> unspec) > > Ok for trunk? > Please include the testcase. Thanks. -- H.J.