From bd6d65e32b835551677456bf286d09ced6859882 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 19 Jul 2020 20:13:57 +0100 Subject: [PATCH] math/mpx-mul4-*.S: Use more portable type syntax for ambiguous instructions. 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 | 2 +- math/mpx-mul4-amd64-sse2.S | 6 +++--- math/mpx-mul4-x86-sse2.S | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index e5bf8d88..4e8f4899 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/math/mpx-mul4-amd64-sse2.S b/math/mpx-mul4-amd64-sse2.S index 1c344f40..5a748c60 100644 --- a/math/mpx-mul4-amd64-sse2.S +++ b/math/mpx-mul4-amd64-sse2.S @@ -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 diff --git a/math/mpx-mul4-x86-sse2.S b/math/mpx-mul4-x86-sse2.S index cdbdfaf7..916adef9 100644 --- a/math/mpx-mul4-x86-sse2.S +++ b/math/mpx-mul4-x86-sse2.S @@ -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 -- 2.11.0