SIMD detection is non-portable

Bug #2000319 reported by Mark Glines
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
liberasurecode
New
Undecided
Unassigned

Bug Description

I am running on an arm64 CPU with the "asimd" (arm advanced simd) flag. I would like to take advantage of the features of my hardware.

However, when I try to configure liberasurecode on this platform, I see the following output:

```
<stdin>: In function 'main':
<stdin>:68:3: error: impossible constraint in 'asm'
configure: WARNING: Could not compile the CPUID detection program
Generating with SIMD flags:
```

I looked around the code a little more, and the simd feature detection seems very x86-specific. It also looks like it assumes the build machine and the target machine will be the same. It is detecting CPU features locally, rather than allowing the builder to specify the target on the configure command line.

On arm64, I think the `xor_bufs_and_store` function in src/builtin/xor_codes/xor_code.c could be improved by using the `veorq_s8` intrinsic. But it's not clear to me how to add the feature detection to enable this.

Is it possible to handle SIMD in a more portable way? What's the right way to do this?

Revision history for this message
Eli Schwartz (eschwartz) wrote :

In commit f3a99e81e997cf0d8db47056b36ca2c2e3beee8f the use of an autoconf macro -- https://www.gnu.org/software/autoconf-archive/ax_ext.html -- was deleted and replaced with an in-house solution.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.