base/dispatch-x86ish.S: Lift register allocation definitions.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 10 Mar 2024 16:08:11 +0000 (16:08 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 10 Mar 2024 16:08:11 +0000 (16:08 +0000)
... and use the logical names during setup.  This seems to be the
convention I've followed elsewhere and it makes some sense as
(a) establishing a target for the following setup code to aim for,
and (b) giving a visual indication of how well we're getting there.

base/dispatch-x86ish.S

index e5a1740..67ec05e 100644 (file)
@@ -44,25 +44,25 @@ FUNC(dispatch_x86ish_cpuid)
        // return zero if we can; otherwise fill with zero and return -1.
 
 #if CPUFAM_X86
+#  define OUT edi
        pushreg ebx
        pushreg edi
-       mov     edi, [SP + 12]
+       mov     OUT, [SP + 12]
        mov     eax, [SP + 16]
        mov     ecx, [SP + 20]
-#  define OUT edi
 #endif
 #if CPUFAM_AMD64 && ABI_SYSV
+#  define OUT rdi
        pushreg rbx
        mov     eax, esi
        mov     ecx, edx
-#  define OUT rdi
 #endif
 #if CPUFAM_AMD64 && ABI_WIN
+#  define OUT r9
        pushreg rbx
-       mov     r9, rcx
+       mov     OUT, rcx
        mov     eax, edx
        mov     ecx, r8d
-#  define OUT r9
 #endif
   endprologue
 
@@ -172,7 +172,7 @@ FUNC(dispatch_x86ish_xgetbv)
 #if CPUFAM_X86
 #  define Z_OUT edi
        pushreg edi
-       mov     edi, [esp + 8]
+       mov     Z_OUT, [esp + 8]
        mov     ecx, [esp + 12]
 #endif
 #if CPUFAM_AMD64 && ABI_SYSV