I strongly believe this API change needs to be reverted (unless I completely 
misunderstand how vfixupimm works):

1. This change breaks API with previous GCC releases. I.e. source code that 
compiled with GCC 8 will not compile with GCC 9 anymore. If you really want a 
"simplified" fixup intrinsic, add a new one.

1'. It'll be really frustrating to support code that compiles on more than a 
single compiler & version.

2. Some existing documentation (e.g. https://software.intel.com/sites/
landingpage/IntrinsicsGuide) still documents the old interface.

3. Why was this change introduced to the SDM in the first place? E.g. a logb 
implementation looked like this:

```
_mm_fixupimm_ps(_mm_getexp_ps(x), x, _mm_set1_epi32(0x00550433), 0x00);
```

i.e. if x is
- QNaN or SNaN return QNaN
- 0 return -inf
- +1 return _mm_getexp_ps(x)
- +/-inf return +inf
- else return _mm_getexp_ps(x)

How is the new _mm_fixupimm_ps supposed to be useful if I can't pass 
_mm_getexp_ps(x) anymore? What does `_mm_fixupimm_ps(x, 
_mm_set1_epi32(0x00550433), 0x00)` even mean? It returns whatever garbage the 
dst register holds?

Cheers,
  Matthias

On Dienstag, 30. Oktober 2018 10:12:23 CET Wei Xiao wrote:
> Hi,
> 
> The attached patch updates VFIXUPIMM* Intrinsics to align with the
> latest Intel® 64 and IA-32 Architectures Software Developer’s Manual
> (SDM).
> Tested with GCC regression test on x86, no regression.
> 
> Is it ok?
> 
> Thanks
> Wei
> 
>     gcc/
>     2018-10-30 Wei Xiao <wei3.x...@intel.com>
> 
>         *config/i386/avx512fintrin.h: Update VFIXUPIMM* intrinsics.
>         (_mm512_fixupimm_round_pd): Update parameters and builtin.
>         (_mm512_maskz_fixupimm_round_pd): Ditto.
>         (_mm512_fixupimm_round_ps): Ditto.
>         (_mm512_maskz_fixupimm_round_ps): Ditto.
>         (_mm_fixupimm_round_sd): Ditto.
>         (_mm_maskz_fixupimm_round_sd): Ditto.
>         (_mm_fixupimm_round_ss): Ditto.
>         (_mm_maskz_fixupimm_round_ss): Ditto.
>         (_mm512_fixupimm_pd): Ditto.
>         (_mm512_maskz_fixupimm_pd): Ditto.
>         (_mm512_fixupimm_ps): Ditto.
>         (_mm512_maskz_fixupimm_ps): Ditto.
>         (_mm_fixupimm_sd): Ditto.
>         (_mm_maskz_fixupimm_sd): Ditto.
>         (_mm_fixupimm_ss): Ditto.
>         (_mm_maskz_fixupimm_ss): Ditto.
>         (_mm512_mask_fixupimm_round_pd): Update builtin.
>         (_mm512_mask_fixupimm_round_ps): Ditto.
>         (_mm_mask_fixupimm_round_sd): Ditto.
>         (_mm_mask_fixupimm_round_ss): Ditto.
>         (_mm512_mask_fixupimm_pd): Ditto.
>         (_mm512_mask_fixupimm_ps): Ditto.
>         (_mm_mask_fixupimm_sd): Ditto.
>         (_mm_mask_fixupimm_ss): Ditto.
>         *config/i386/avx512vlintrin.h:
>         (_mm256_fixupimm_pd): Update parameters and builtin.
>         (_mm256_maskz_fixupimm_pd): Ditto.
>         (_mm256_fixupimm_ps): Ditto.
>         (_mm256_maskz_fixupimm_ps): Ditto.
>         (_mm_fixupimm_pd): Ditto.
>         (_mm_maskz_fixupimm_pd): Ditto.
>         (_mm_fixupimm_ps): Ditto.
>         (_mm_maskz_fixupimm_ps): Ditto.
>         (_mm256_mask_fixupimm_pd): Update builtin.
>         (_mm256_mask_fixupimm_ps): Ditto.
>         (_mm_mask_fixupimm_pd): Ditto.
>         (_mm_mask_fixupimm_ps): Ditto.
>         *config/i386/i386-builtin-types.def: Add new builtin types.
>         *config/i386/i386-builtin.def: Update builtin definitions.
>         *config/i386/i386.c: Handle new builtin types.
>         *config/i386/sse.md: Update VFIXUPIMM* patterns.
>         (<avx512>_fixupimm<mode>_maskz<round_saeonly_expand_name>): Update.
>         (<avx512>_fixupimm<mode><sd_maskz_name><round_saeonly_name>):
> Update. (<avx512>_fixupimm<mode>_mask<round_saeonly_name>): Update.
> (avx512f_sfixupimm<mode>_maskz<round_saeonly_expand_name>): Update.
> (avx512f_sfixupimm<mode><sd_maskz_name><round_saeonly_name>): Update.
> (avx512f_sfixupimm<mode>_mask<round_saeonly_name>): Update.
> *config/i386/subst.md:
>         (round_saeonly_sd_mask_operand4): Add new subst_attr.
>         (round_saeonly_sd_mask_op4): Ditto.
>         (round_saeonly_expand_operand5): Ditto.
>         (round_saeonly_expand): Update.
> 
>     gcc/testsuite
>     2018-10-30 Wei Xiao <wei3.x...@intel.com>
> 
>         *gcc.target/i386/avx-1.c: Update tests for VFIXUPIMM* intrinsics.
>         *gcc.target/i386/avx512f-vfixupimmpd-1.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmpd-2.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmps-1.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmsd-1.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmsd-2.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmss-1.c: Ditto.
>         *gcc.target/i386/avx512f-vfixupimmss-2.c: Ditto.
>         *gcc.target/i386/avx512vl-vfixupimmpd-1.c: Ditto.
>         *gcc.target/i386/avx512vl-vfixupimmps-1.c: Ditto.
>         *gcc.target/i386/sse-13.c: Ditto.
>         *gcc.target/i386/sse-14.c: Ditto.
>         *gcc.target/i386/sse-22.c: Ditto.
>         *gcc.target/i386/sse-23.c: Ditto.
>         *gcc.target/i386/testimm-10.c: Ditto.
>         *gcc.target/i386/testround-1.c: Ditto.


-- 
───────────────────────────────────────────────────────────────────
 Dr. Matthias Kretz                        phone:  +49 6159 713084
 Senior Software Engineer                  e-mail:  m.kr...@gsi.de
 Experiment Systems                 http://web-docs.gsi.de/~mkretz
───────────────────────────────────────────────────────────────────

GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.de

Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528
Managing Directors / Geschäftsführung:
Professor Dr. Paolo Giubellino, Ursula Weyrich, Jörg Blaurock
Chairman of the Supervisory Board / Vorsitzender des GSI-Aufsichtsrats:
State Secretary / Staatssekretär Dr. Georg Schütte


Reply via email to