-
- Downloads
rs6000: Fix __builtin_altivec_vcmpne{b,h,w} implementation
The current built-in definitions for vcmpneb, vcmpneh, vcmpnew are defined under the Power 9 section of r66000-builtins. This implies they are only supported on Power 9 and above when in fact they are defined and work with Altivec as well with the appropriate Altivec instruction generation. The vec_cmpne builtin should generate the vcmpequ{b,h,w} instruction with Altivec enabled and generate the vcmpne{b,h,w} on Power 9 and newer processors. This patch moves the definitions to the Altivec stanza to make it clear the built-ins are supported for all Altivec processors. The patch removes the confusion as to which processors support the vcmpequ{b,h,w} instructions. There is existing test coverage for the vec_cmpne built-in for vector bool char, vector bool short, vector bool int, vector bool long long in builtins-3-p9.c and p8vector-builtin-2.c. Coverage for vector signed int, vector unsigned int is in p8vector-builtin-2.c. Test vec-cmpne.c is updated to check the generation of the vcmpequ{b,h,w} instructions for Altivec. A new test vec-cmpne-runnable.c is added to verify the built-ins work as expected. Patch has been tested on Power 8 LE/BE, Power 9 LE/BE and Power 10 LE with no regressions. gcc/ChangeLog: * config/rs6000/rs6000-builtins.def (vcmpneb, vcmpneh, vcmpnew): Move definitions to Altivec stanza. * config/rs6000/altivec.md (vcmpneb, vcmpneh, vcmpnew): New define_expand. gcc/testsuite/ChangeLog: * gcc.target/powerpc/vec-cmpne-runnable.c: New execution test. * gcc.target/powerpc/vec-cmpne.c (define_test_functions, execute_test_functions): Move to vec-cmpne.h. Add scan-assembler-times for vcmpequb, vcmpequh, vcmpequw. * gcc.target/powerpc/vec-cmpne.h: New include file for vec-cmpne.c and vec-cmpne-runnable.c. Split define_test_functions definition into define_test_functions and define_init_verify_functions.
Showing
- gcc/config/rs6000/altivec.md 12 additions, 0 deletionsgcc/config/rs6000/altivec.md
- gcc/config/rs6000/rs6000-builtins.def 9 additions, 9 deletionsgcc/config/rs6000/rs6000-builtins.def
- gcc/testsuite/gcc.target/powerpc/vec-cmpne-runnable.c 36 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-cmpne-runnable.c
- gcc/testsuite/gcc.target/powerpc/vec-cmpne.c 9 additions, 103 deletionsgcc/testsuite/gcc.target/powerpc/vec-cmpne.c
- gcc/testsuite/gcc.target/powerpc/vec-cmpne.h 90 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/vec-cmpne.h
Loading
Please register or sign in to comment