This repository has been archived by the owner on Jan 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Support C++ translation units #3
Comments
Thank you for the bug report Hans! The bug report comes in three parts: 1. C++ compile errors. 2. C89 compatibility. 3. Compile warnings at higher warning levels.
|
I've committed fixes (type casts) that make it compile for me with c++ icc and gcc (with default warning levels only). |
Thank you! I found some more missing AVX-512 intrinsics:
There are may be more. I will build a more complete list. |
added __mm512_adn, all 512 blends. Can't add cmp - have to add manually as parser does not process TRUE and FALSE cases in switch. |
izard
added a commit
that referenced
this issue
Sep 3, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Immintrin-debug is implemented in C which is also desired (given that C code should be able to make use of this project). However, using the Immintrin-debug header file in a C++ translation unit will cause at least compiler errors (as C++ is less permissive). Anyhow, a lot of warnings are also present with C code at higher warning levels (let alone extra and/or pedantic warnings).
How to reproduce:
To translate using a C++ translation unit:
To compile with a lot of warning flags:
Immintrin-debug may switch to some more sophisticated function-decoration at least with respect to "static" and "inline" (different meanings in C++ and C; for the latter "inline" for instance was only introduced in C99 and may be emulated prior to this standard).
I understand that not all of the above warnings will be resolved easily (nor they should as effort is not justified). However, it should work with C++ translation units.
Btw, compilers (regardless of C and C++) may or may not allow intrinsics with/without prototype functions plus if prototypes are present they may differ slightly between Intel and GNU intrinsic headers (aka
void*
vs e.g.float*
in some places etc.). For the latter, casts may assume target signature withfloat*
(or stronger type in general) even if say Intel's prototype hasvoid*
(assuming the stronger type works with any compiler as type-"promotion" [demotion] tovoid*
is applied automatically and considered safe).The text was updated successfully, but these errors were encountered: