[Bug target/71659] _xgetbv intrinsic missing

2019-01-21 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

H.J. Lu  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |9.0

--- Comment #7 from H.J. Lu  ---
(In reply to Daniel Fruzynski from comment #4)
> This intrinsics was added in gcc 8. Initial implementation was buggy (see
> r85684) and was fixed in 8.2 However there is one more issue here: Intel
> Intrinsics Guide says that it should be available by including
> , however in gcc you need to include .

Fixed for GCC 9.

> Additionally there are no defines for XFEATURE_ENABLED_MASK and possible
> output values.

I will investigate it.

[Bug target/71659] _xgetbv intrinsic missing

2019-01-21 Thread hjl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

--- Comment #6 from hjl at gcc dot gnu.org  ---
Author: hjl
Date: Mon Jan 21 12:23:49 2019
New Revision: 268113

URL: https://gcc.gnu.org/viewcvs?rev=268113&root=gcc&view=rev
Log:
i386: Move Intel intrinsics head files to 

According to Intel Intrinsics Guide:

https://software.intel.com/sites/landingpage/IntrinsicsGuide/

Intel intrinsics should be available by including .  This
patch moves remaining Intel intrinsics head files from  to
.

PR target/71659
* config/i386/adxintrin.h: Just check _IMMINTRIN_H_INCLUDED.
* config/i386/clflushoptintrin.h: Check _IMMINTRIN_H_INCLUDED
instead of _X86INTRIN_H_INCLUDED.
* onfig/i386/clwbintrin.h: Likewise.
* config/i386/pkuintrin.h: Likewise.
* config/i386/prfchwintrin.h: Likewise.
* config/i386/rdseedintrin.h: Likewise.
* config/i386/wbnoinvdintrin.h: Likewise.
* config/i386/xsavecintrin.h: Likewise.
* config/i386/xsavesintrin.h: Likewise.
* config/i386/fxsrintrin.h: Enable _IMMINTRIN_H_INCLUDED check.
* config/i386/xsaveintrin.h: Likewise.
* config/i386/xsaveoptintrin.h: Likewise.
* config/i386/x86intrin.h: Move "#include" ,
, , ,
, , ,
, , ,
 and  to ...
* config/i386/immintrin.h: Here.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/adxintrin.h
trunk/gcc/config/i386/clflushoptintrin.h
trunk/gcc/config/i386/clwbintrin.h
trunk/gcc/config/i386/fxsrintrin.h
trunk/gcc/config/i386/immintrin.h
trunk/gcc/config/i386/pkuintrin.h
trunk/gcc/config/i386/prfchwintrin.h
trunk/gcc/config/i386/rdseedintrin.h
trunk/gcc/config/i386/wbnoinvdintrin.h
trunk/gcc/config/i386/x86intrin.h
trunk/gcc/config/i386/xsavecintrin.h
trunk/gcc/config/i386/xsaveintrin.h
trunk/gcc/config/i386/xsaveoptintrin.h
trunk/gcc/config/i386/xsavesintrin.h

[Bug target/71659] _xgetbv intrinsic missing

2019-01-17 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

--- Comment #5 from Daniel Fruzynski  ---
I meant pr85684

[Bug target/71659] _xgetbv intrinsic missing

2019-01-17 Thread bugzi...@poradnik-webmastera.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

Daniel Fruzynski  changed:

   What|Removed |Added

 CC||bugzilla@poradnik-webmaster
   ||a.com

--- Comment #4 from Daniel Fruzynski  ---
This intrinsics was added in gcc 8. Initial implementation was buggy (see
r85684) and was fixed in 8.2 However there is one more issue here: Intel
Intrinsics Guide says that it should be available by including ,
however in gcc you need to include .

Additionally there are no defines for XFEATURE_ENABLED_MASK and possible output
values.

[Bug target/71659] _xgetbv intrinsic missing

2018-06-18 Thread noloader at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

--- Comment #3 from Jeffrey Walton  ---
(In reply to postmaster from comment #2)
> Portability is one main reason to add missing intrinsics... with combination
> of cpuid check and _xgetbv() we can cleanly check if AVX or MPX is available
> at run-time. We can also check specific instructions during configure
> process to see if we need to add workarounds for bad or missing
> functions/intrinsics.

+1. We were trying to use Intel's algorithm described at
https://software.intel.com/en-us/blogs/2011/04/14/is-avx-enabled . We should
only need __get_cpuid and _xgetbv. We should not need that nasty GCC inline
assembly.

[Bug target/71659] _xgetbv intrinsic missing

2017-02-28 Thread postmaster at raasu dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

postmaster at raasu dot org changed:

   What|Removed |Added

 CC||postmaster at raasu dot org

--- Comment #2 from postmaster at raasu dot org ---
Portability is one main reason to add missing intrinsics... with combination of
cpuid check and _xgetbv() we can cleanly check if AVX or MPX is available at
run-time. We can also check specific instructions during configure process to
see if we need to add workarounds for bad or missing functions/intrinsics.

Some developers think that cleanliness of the code is more important than need
to reduplicate hand-written assembler code every time for optimal performance.

We have to remember that gcc is not only used for BSD-like operating systems,
including OS/X, Linux, *BSD etc, but for Cygwin, MSYS/MSYS2 and MinGW which
benefit from gcc being as close as possible compiler of Visual C++ regarding
intrinsics support.

[Bug target/71659] _xgetbv intrinsic missing

2016-06-25 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71659

--- Comment #1 from H.J. Lu  ---
You need more than an intrinsic to know if AVX or MPX is available.
So far, run-time implementation has no issue with inline asm statement.