Author Topic: Re: X64 ABI, REAL8 passed in xmmreg?  (Read 2134 times)

jj2007

  • Member
  • *****
  • Posts: 11552
  • Assembler is fun ;-)
    • MasmBasic
Re: X64 ABI, REAL8 passed in xmmreg?
« Reply #30 on: April 12, 2021, 08:08:29 PM »
it kicks in at the :VARARG position.

Good point, thanks :thumbsup:

Is there any "mixed" WinAPI call that you know of? There are more than 1,000 VARARG API calls in \Masm32\include...

Just for fun, I checked it (source & exe attached):
Code: [Select]
include \masm32\MasmBasic\MasmBasic.inc
  SetGlobals ctVar, ctMixed
  Init
  GetFiles "\Masm32\include\*.inc"
  PrintLine Str$("%i files found\n", eax)
  For_ fcount=0 To Files$(?)-1
Recall Files$(fcount), L$()
For_ ct=0 To eax-1
mov esi, L$(ct)
.if Instr_(esi, ":VARARG")
inc ctVar
lea ecx, [edx+6] ; +6 for len(":VARARG")
.if Len(esi)!=ecx
inc ctMixed
Print Str$("\n%___i", ct), esi
.endif
.endif
Next
  Next
  Inkey Str$("\n%i vararg calls found", ctVar), Str$(", of which %i are mixed", ctMixed)
EndOfCode
« Last Edit: April 12, 2021, 09:25:19 PM by jj2007 »

nidud

  • Member
  • *****
  • Posts: 2218
    • https://github.com/nidud/asmc
Re: X64 ABI, REAL8 passed in xmmreg?
« Reply #31 on: April 12, 2021, 11:22:17 PM »
It's common in graphic code to use long arrays of floats and VARARG, at least in inline and HLL constructs, but for regular API calls I don't know.

Programmers do however write their own code according to these rules.

jj2007

  • Member
  • *****
  • Posts: 11552
  • Assembler is fun ;-)
    • MasmBasic
Re: X64 ABI, REAL8 passed in xmmreg?
« Reply #32 on: April 12, 2021, 11:43:13 PM »
It's common in graphic code to use long arrays of floats and VARARG

There are some other candidates, too:
Code: [Select]
frequency of VARARG:
184  \Masm32\include\wldap32.inc
150  \Masm32\include\wdmsec.inc
102  \Masm32\include\psxdll.inc
076  \Masm32\include\wdm.inc
065  \Masm32\include\ntoskrnl.inc
063  \Masm32\include\netlib.inc
056  \Masm32\include\miglib.inc
050  \Masm32\include\parser.inc
049  \Masm32\include\npptools.inc
042  \Masm32\include\thunk32.inc
026  \Masm32\include\dnslib.inc
025  \Masm32\include\mapi32.inc
021  \Masm32\include\dnsrpc.inc
013  \Masm32\include\vfw32.inc
013  \Masm32\include\rpcrt4.inc
010  \Masm32\include\cabinet.inc
008  \Masm32\include\rxapi.inc
008  \Masm32\include\odbc32.inc
008  \Masm32\include\ntdll.inc
007  \Masm32\include\ntvdm.inc

With GetFiles "\Masm32\include\g*.inc":
Code: [Select]
frequency of VARARG:
000  \Masm32\include\gpedit.inc
000  \Masm32\include\glu32.inc
000  \Masm32\include\glmf32.inc
000  \Masm32\include\glaux.inc
000  \Masm32\include\gdiplus.inc
000  \Masm32\include\gdi32.inc
000  \Masm32\include\gapi32.inc