[PATCH] amdgcn: Add vectorized math routines

Kwok Cheung Yeung <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Hello

This patch implements a set of vectorized math routines for use by the 
auto-vectorizer in GCC for the AMD GCN architecture. The implementation 
is located in libm/machine/amdgcn, and is based on the current set of 
scalar math routines in Newlib, from libm/common, libm/math and 
libm/mathfp (where the level of accuracy was deemed sufficient for our 
purposes). I have ensured that the copyright notices from the original 
were retained.

The vectorized routines make extensive use of the GCC vector extensions 
for C, some GCN-specific builtins in GCC, and a SIMD abstraction library 
located in libm/machine/amdgcn/amdgcnmach.h. As the builtins are a 
recent addition to GCC, I have added #if statements to skip compilation 
of the routines that use them to ensure that Newlib will still build for 
older versions of GCC.

Versions for 2-lane vectors up to 64-lane vectors (in powers of 2) are 
provided for all public functions. Versions with <64 lanes (which is the 
'natural' vector width for AMD GCN) are shims that call the 64-lane 
version with the unused lanes masked out.

Okay for inclusion into Newlib?

Thanks

Kwok Yeung
0001-amdgcn-Add-vectorized-math-routines.patch (text/plain, 540.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.