The MASM Forum

64 bit assembler => 64 bit assembler. Conceptual Issues => Topic started by: mineiro on April 12, 2021, 06:14:32 AM

Title: Re: X64 ABI, REAL8 passed in xmmreg?
Post by: mineiro on April 12, 2021, 06:14:32 AM
Quote from: jj2007 on April 11, 2021, 10:41:16 AM
From my tests it seems that xmm2 and xmm3 are ignored by printf().
In linux it's necessary to set rax register with how many xmm registers are being used with printf. Maybe a try in windows.
Title: Re: X64 ABI, REAL8 passed in xmmreg?
Post by: jj2007 on April 12, 2021, 09:10:23 AM
Quote from: mineiro on April 12, 2021, 06:14:32 AM
Quote from: jj2007 on April 11, 2021, 10:41:16 AM
From my tests it seems that xmm2 and xmm3 are ignored by printf().
In linux it's necessary to set rax register with how many xmm registers are being used with printf. Maybe a try in windows.

Further tests show that compilers set (in compliance with the Windows ABI) the reg64 args, e.g. movsd rdx, xmm1. CRT printf uses rdx, r8, r9 internally but ignores the xmm regs.