[XviD-devel] [RFC] AMD64 support

Andrew Dunstan a_dunstan at hotmail.com
Mon Dec 13 03:28:07 CET 2004


>Firstly i'd say: why on earth would windows forbid the usage of 64 bit 
>instructions
>                on a 64bit processor ? ;-)
I'm not absolutely positive about this (meaning I haven't tested it myself), 
but I do know windows doesn't save the x87 stack between task switches. The 
compiler also doesn't support intrinsics which use the _m64 data type (not 
that any intrinsics are used here, but if their compiler doesn't support 64 
bits...). To be sure I'll assemble some MMXEXT code and see what happens.

>
>Secondly i'd add: That would be very bad for windows users, because the 
>port i merge
>                   is then only unix friendly.
Windows passing method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/kmarch/hh/kmarch/64bitAMD_b93fc900-b7fb-4dad-b8bd-1510ee99f62f.xml.asp

Maybe some "%if DEFINED" (where DEFINED is the target os) in the .asm files 
to move the parameters into known registers, or else maintain a new set of 
asm for windows?

Also on windows the following registers are non-volatile (must be preserved 
by called function):
r12:r15
rdi, rsi, rbx, rbp, rsp
the low 64-bits of xmm6:xmm15  <- would require changes to current assembly

>
>Thirdly i'd conclude by: Contributions will be welcomed if that's true.
I've already taken most of the 128-bit assembly and made it work under 
x86-64 windows. Apart from the parameter passing, it's nearly the same as 
the linux stuff. Having both in one source might get messy, but it's 
possible.




More information about the XviD-devel mailing list