... | ... | @@ -162,4 +162,24 @@ cf PROC ; COMDAT |
|
|
movss xmm2, DWORD PTR x$[rsp+4]
|
|
|
movss xmm1, DWORD PTR x$[rsp]
|
|
|
```
|
|
|
So in the `zf` (`double complex`) case, it reads the two doubles from `[rcx]` and `[rcx+8]`. So the `f({double, double}*)` calling convention. In the `cf` (`float complex`) case, it puts `rcx` to `[rsp]` and then reads the two numbers as `[rsp]` and `[rsp+4]`, so `rcx` contained both floats as a single `i64`. So the `f(i64)` calling convention. |
|
|
\ No newline at end of file |
|
|
So in the `zf` (`double complex`) case, it reads the two doubles from `[rcx]` and `[rcx+8]`. So the `f({double, double}*)` calling convention. In the `cf` (`float complex`) case, it puts `rcx` to `[rsp]` and then reads the two numbers as `[rsp]` and `[rsp+4]`, so `rcx` contained both floats as a single `i64`. So the `f(i64)` calling convention.
|
|
|
|
|
|
|
|
|
One can also test using `clang` which by default generates the correct MSVC ABI:
|
|
|
```yaml
|
|
|
image: Visual Studio 2017
|
|
|
|
|
|
build_script:
|
|
|
- set CONDA_INSTALL_LOCN=C:\\Miniconda37-x64
|
|
|
- call %CONDA_INSTALL_LOCN%\Scripts\activate.bat
|
|
|
- call conda config --set always_yes yes --set changeps1 no
|
|
|
- call conda info -a
|
|
|
- call conda update -q conda
|
|
|
- call conda install -c conda-forge clang
|
|
|
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd" -arch=x64
|
|
|
- cl /GR- /FS /FAs conv.c
|
|
|
- type conv.asm
|
|
|
- conv
|
|
|
- clang -S conv.c -o -
|
|
|
- clang -S -emit-llvm conv.c -o -
|
|
|
``` |
|
|
\ No newline at end of file |