'Returning two AVX/AVX2 __m256d types in C++ function calls via registers
I am new to programming with the AVX/AVX2 instructions and am trying to optimize the speed of my code. Following the older expectation that passing by reference is faster I wrote my code to do that but recently updated the code to pass by value to make use of fact that __m256d arguments would be passed into the function via the vector registers. When the function only passes out one result, the process below seems clear:
__m256d myfunc(const __m256d v1, const __m256d v2);
The latest System V ABI for AMD64 alludes to the possibility that %xmm0 AND %xmm1 can be used for returning values.
So I assume %ymm0 and %ymm1 can be returned with AVX.
What is the calling method to pass back out two __m256d return values? What C++ types will compile that way?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
