-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The following example code does not compile with g++ 14.2.0 (No specific -march parameter):
#include <simd>
#include <vector>
int main()
{
std::vector<double> data(std::datapar::simd<double>::size(), 0.05);
std::datapar::simd<double> x = std::datapar::unchecked_load(data);
auto xSqrt = std::datapar::sqrt(x);
return 0;
}The error message:
bits/simd_x86.h:2424:42: error: cannot convert ‘__vector(2) double’ to ‘__vector(4) float’
[build] 2424 | return __builtin_ia32_sqrtps(__x);
[build] | ^~~
[build] | |
[build] | __vector(2) double
[build] <built-in>: note: initializing argument 1 of ‘__vector(4) float __builtin_ia32_sqrtps(__vector(4) float)’
The wrong builtin function for sqrt is called and should be replaced with __builtin_ia32_sqrtpd for packed doubles:
Line 2424 in 91a4477
| return __builtin_ia32_sqrtps(__x); |
Metadata
Metadata
Assignees
Labels
No labels