amdgcn: Enable SIMD vectorization of math functions
authorKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 2 Mar 2023 20:56:53 +0000 (20:56 +0000)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Thu, 2 Mar 2023 20:56:53 +0000 (20:56 +0000)
commitce9cd7258d0b2d34e14663f8d91be8d6a4731204
tree2e06521f898b5c5412865a24b35688b207e14e34
parent5425159d176a7a92afc932cbb22d8822667099c4
amdgcn: Enable SIMD vectorization of math functions

Calls to vectorized versions of routines in the math library will now
be inserted when vectorizing code containing supported math functions.

2023-03-02  Kwok Cheung Yeung  <kcy@codesourcery.com>
    Paul-Antoine Arras  <pa@codesourcery.com>

gcc/
* builtins.cc (mathfn_built_in_explicit): New.
* config/gcn/gcn.cc: Include case-cfn-macros.h.
(mathfn_built_in_explicit): Add prototype.
(gcn_vectorize_builtin_vectorized_function): New.
(gcn_libc_has_function): New.
(TARGET_LIBC_HAS_FUNCTION): Define.
(TARGET_VECTORIZE_BUILTIN_VECTORIZED_FUNCTION): Define.

gcc/testsuite/
* gcc.target/gcn/simd-math-1.c: New testcase.
* gcc.target/gcn/simd-math-2.c: New testcase.

libgomp/
* testsuite/libgomp.c/simd-math-1.c: New testcase.
gcc/builtins.cc
gcc/config/gcn/gcn.cc
gcc/testsuite/gcc.target/gcn/simd-math-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/gcn/simd-math-2.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/simd-math-1.c [new file with mode: 0644]