math/mpx-mul4-*.S: Use more portable type syntax for ambiguous instructions.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 19 Jul 2020 19:13:57 +0000 (20:13 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 19 Jul 2020 19:13:57 +0000 (20:13 +0100)
Specifically, replace `adcd MEM, 0' by `adc dword ptr MEM, 0'.  This
removes one reason why Clang's defective assembler won't work, but there
are others.

This is not part of a concerted effort to improve Clang support.
Honestly, as far as I'm concerned, `CCASFLAGS=-fno-integrated-as
-Wno-unicode' is sufficient support for building Catacomb using
Clang.  (That said, I don't actively object to supporting Clang: it's
just not something I want to put much effort into.  I'm happy to accept
tasteful patches which improve Clang support.)  But in retrospect, using
`adcd' here was kind of bletcherous in its own right, and it should be
fixed.

configure.ac
math/mpx-mul4-amd64-sse2.S
math/mpx-mul4-x86-sse2.S

index e5bf8d8..4e8f489 100644 (file)
@@ -128,7 +128,7 @@ AC_CACHE_CHECK(
        .intel_syntax noprefix
        .globl  foo
 foo:
-       adcd    var, 0
+       adc     dword ptr var, 0
        ret
        .data
 var:   .long   1
index 1c344f4..5a748c6 100644 (file)
@@ -1251,9 +1251,9 @@ FUNC(mpxmont_redc4_amd64_sse2)
        // Continue carry propagation until the end of the buffer.
 0:     add     [rdi], C
        mov     C, 0                    // preserves flags
-       adcd    [rdi + 4], 0
-       adcd    [rdi + 8], 0
-       adcd    [rdi + 12], 0
+       adc     dword ptr [rdi + 4], 0
+       adc     dword ptr [rdi + 8], 0
+       adc     dword ptr [rdi + 12], 0
        adc     C, 0
        add     rdi, 16
        cmp     rdi, DVL4
index cdbdfaf..916adef 100644 (file)
@@ -1054,9 +1054,9 @@ FUNC(mpxmont_redc4_x86_sse2)
        // Continue carry propagation until the end of the buffer.
 0:     add     [edi], eax
        mov     eax, 0                  // preserves flags
-       adcd    [edi + 4], 0
-       adcd    [edi + 8], 0
-       adcd    [edi + 12], 0
+       adc     dword ptr [edi + 4], 0
+       adc     dword ptr [edi + 8], 0
+       adc     dword ptr [edi + 12], 0
        adc     eax, 0
        add     edi, 16
        cmp     edi, esi