vec_sqrtADD TO COMPARE ADDED TO COMPARE
IBM Power 9 64-bit (64 bits)/ VSX
View official documentation
Location:
Math Functions
>
Vector Square Root
Purpose:
Purpose: Returns a vector containing the square root of each element in the source vector.
Result value: Each element of output is the square root of the corresponding element of a.
Endian considerations: None.
Result:
vector double
Prototypes
Assembly Instruction:
xvsqrtdp
Usage:
vector double result =
vec_sqrt(
vector double a
)
Performance Metrics:
📊 Unlock Performance Insights
Get access to detailed performance metrics including latency, throughput, and CPU-specific benchmarks for this intrinsic.
Example:
#include <altivec.h>
#include <stdio.h>
int main() {
vector double a = {
16.0, 9.0
};
vector double result = vec_sqrt(a);
double res[2];
vec_st(result, 0, res);
printf("%lf %lf\n", res[0], res[1]);
return 0;
}
Assembly Instruction:
xvsqrtsp
Usage:
vector float result =
vec_sqrt(
vector float a
)
Performance Metrics:
Login required
Example:
#include <altivec.h>
#include <stdio.h>
int main() {
vector float a = {
16.0f, 9.0f, 4.0f, 1.0f
};
vector float result = vec_sqrt(a);
float res[4];
vec_st(result, 0, res);
printf("%f %f %f %f\n", res[0], res[1], res[2], res[3]);
return 0;
}
SIMD Intrinsics Summary
| SIMD Engines: | 6 |
| C Intrinsics: | 10444 |
| NEON: | 4353 |
| AVX2: | 405 |
| AVX512: | 4717 |
| SSE4.2: | 598 |
| VSX: | 192 |
| IBM-Z: | 179 |