Bug 105339 - [x86] missing AVX-512F scalef functions when optimization is disabled
Summary: [x86] missing AVX-512F scalef functions when optimization is disabled
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: 9.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-22 00:46 UTC by Evan Nemerson
Modified: 2022-12-19 22:50 UTC (History)
3 users (show)

See Also:
Host:
Target: x86_64-*-* i?86-*-*
Build:
Known to work: 10.4.0, 11.3.1, 12.1.0, 9.5.0
Known to fail: 11.3.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Nemerson 2022-04-22 00:46:02 UTC
Several AVX-512F functions scalef functions are only declared when __OPTIMIZE__ is defined:

 * _mm_maskz_scalef_ss
 * _mm_mask_scalef_sd
 * _mm_maskz_scalef_sd

There may be others; I haven't done an exhaustive check.
Comment 1 Hongtao.liu 2022-04-22 03:07:52 UTC
Hmm

 3316#define _mm_mask_scalef_sd(W, U, A, B) \
 3317    _mm_mask_scalef_round_sd ((W), (U), (A), (B), _MM_FROUND_CUR_DIRECTION)
 3318
 3319#define _mm_maskz_scalef_sd(U, A, B) \
 3320    _mm_maskz_scalef_round_sd ((U), (A), (B), _MM_FROUND_CUR_DIRECTION)
 3321
 3322#define _mm_mask_scalef_ss(W, U, A, B) \
 3323    _mm_mask_scalef_round_ss ((W), (U), (A), (B), _MM_FROUND_CUR_DIRECTION)
 3324
 3325#define _mm_maskz_scalef_ss(U, A, B) \
 3326    _mm_maskz_scalef_round_ss ((U), (A), (B), _MM_FROUND_CUR_DIRECTION)

they're defined as macros, but _mm_maskz_scalef_round_ss is only available under __OPTIMIZE__.
Comment 2 Hongtao.liu 2022-04-22 03:14:08 UTC
We need to add macro for _mm_{mask,maskz}_scalef_round_{sd,ss} intriniscs for gcc-9/10/11/12
Comment 3 GCC Commits 2022-04-25 01:18:02 UTC
The master branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:3c940d42701707559fabe49be99296f60fbc43e7

commit r12-8238-g3c940d42701707559fabe49be99296f60fbc43e7
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Fri Apr 22 14:42:30 2022 +0800

    AVX512F: Add missing macro for mask(z?)_scalf_s[sd] [PR 105339]
    
    Add missing macro under O0 and adjust macro format for scalf
    intrinsics.
    
    gcc/ChangeLog:
    
            PR target/105339
            * config/i386/avx512fintrin.h (_mm512_scalef_round_pd):
            Add parentheses for parameters and djust format.
            (_mm512_mask_scalef_round_pd): Ditto.
            (_mm512_maskz_scalef_round_pd): Ditto.
            (_mm512_scalef_round_ps): Ditto.
            (_mm512_mask_scalef_round_ps): Ditto.
            (_mm512_maskz_scalef_round_ps): Ditto.
            (_mm_scalef_round_sd): Use _mm_undefined_pd.
            (_mm_scalef_round_ss): Use _mm_undefined_ps.
            (_mm_mask_scalef_round_sd): New macro.
            (_mm_mask_scalef_round_ss): Ditto.
            (_mm_maskz_scalef_round_sd): Ditto.
            (_mm_maskz_scalef_round_ss): Ditto.
    
    gcc/testsuite/ChangeLog:
    
            PR target/105339
            * gcc.target/i386/sse-14.c: Add tests for new macro.
Comment 4 GCC Commits 2022-04-27 07:15:15 UTC
The releases/gcc-11 branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:8a02dab2aac640186acca8b265a790153632786d

commit r11-9940-g8a02dab2aac640186acca8b265a790153632786d
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Fri Apr 22 14:42:30 2022 +0800

    AVX512F: Add missing macro for mask(z?)_scalf_s[sd] [PR 105339]
    
    Add missing macro under O0 and adjust macro format for scalf
    intrinsics.
    
    gcc/ChangeLog:
    
            PR target/105339
            * config/i386/avx512fintrin.h (_mm512_scalef_round_pd):
            Add parentheses for parameters and djust format.
            (_mm512_mask_scalef_round_pd): Ditto.
            (_mm512_maskz_scalef_round_pd): Ditto.
            (_mm512_scalef_round_ps): Ditto.
            (_mm512_mask_scalef_round_ps): Ditto.
            (_mm512_maskz_scalef_round_ps): Ditto.
            (_mm_scalef_round_sd): Use _mm_undefined_pd.
            (_mm_scalef_round_ss): Use _mm_undefined_ps.
            (_mm_mask_scalef_round_sd): New macro.
            (_mm_mask_scalef_round_ss): Ditto.
            (_mm_maskz_scalef_round_sd): Ditto.
            (_mm_maskz_scalef_round_ss): Ditto.
    
    gcc/testsuite/ChangeLog:
    
            PR target/105339
            * gcc.target/i386/sse-14.c: Add tests for new macro.
    
    (cherry picked from commit 3c940d42701707559fabe49be99296f60fbc43e7)
Comment 5 GCC Commits 2022-04-27 07:16:45 UTC
The releases/gcc-10 branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:5e53c8a04d182ead8b59682802478de3dfc0361b

commit r10-10584-g5e53c8a04d182ead8b59682802478de3dfc0361b
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Fri Apr 22 14:42:30 2022 +0800

    AVX512F: Add missing macro for mask(z?)_scalf_s[sd] [PR 105339]
    
    Add missing macro under O0 and adjust macro format for scalf
    intrinsics.
    
    gcc/ChangeLog:
    
            PR target/105339
            * config/i386/avx512fintrin.h (_mm512_scalef_round_pd):
            Add parentheses for parameters and djust format.
            (_mm512_mask_scalef_round_pd): Ditto.
            (_mm512_maskz_scalef_round_pd): Ditto.
            (_mm512_scalef_round_ps): Ditto.
            (_mm512_mask_scalef_round_ps): Ditto.
            (_mm512_maskz_scalef_round_ps): Ditto.
            (_mm_scalef_round_sd): Use _mm_undefined_pd.
            (_mm_scalef_round_ss): Use _mm_undefined_ps.
            (_mm_mask_scalef_round_sd): New macro.
            (_mm_mask_scalef_round_ss): Ditto.
            (_mm_maskz_scalef_round_sd): Ditto.
            (_mm_maskz_scalef_round_ss): Ditto.
    
    gcc/testsuite/ChangeLog:
    
            PR target/105339
            * gcc.target/i386/sse-14.c: Add tests for new macro.
    
    (cherry picked from commit 3c940d42701707559fabe49be99296f60fbc43e7)
Comment 6 GCC Commits 2022-04-27 07:20:22 UTC
The releases/gcc-9 branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:18bee83150e235ebd596443a0909a72d0c4d077f

commit r9-10031-g18bee83150e235ebd596443a0909a72d0c4d077f
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Fri Apr 22 14:42:30 2022 +0800

    AVX512F: Add missing macro for mask(z?)_scalf_s[sd] [PR 105339]
    
    Add missing macro under O0 and adjust macro format for scalf
    intrinsics.
    
    gcc/ChangeLog:
    
            PR target/105339
            * config/i386/avx512fintrin.h (_mm512_scalef_round_pd):
            Add parentheses for parameters and djust format.
            (_mm512_mask_scalef_round_pd): Ditto.
            (_mm512_maskz_scalef_round_pd): Ditto.
            (_mm512_scalef_round_ps): Ditto.
            (_mm512_mask_scalef_round_ps): Ditto.
            (_mm512_maskz_scalef_round_ps): Ditto.
            (_mm_scalef_round_sd): Use _mm_undefined_pd.
            (_mm_scalef_round_ss): Use _mm_undefined_ps.
            (_mm_mask_scalef_round_sd): New macro.
            (_mm_mask_scalef_round_ss): Ditto.
            (_mm_maskz_scalef_round_sd): Ditto.
            (_mm_maskz_scalef_round_ss): Ditto.
    
    gcc/testsuite/ChangeLog:
    
            PR target/105339
            * gcc.target/i386/sse-14.c: Add tests for new macro.
    
    (cherry picked from commit 3c940d42701707559fabe49be99296f60fbc43e7)
Comment 7 Hongyu Wang 2022-04-27 07:20:54 UTC
Fixed for gcc-9/10/11/12.
Comment 8 Andrew Pinski 2022-12-19 22:50:07 UTC
.