[PATCH] longlong.h on mips with clang

Vladimir 'φ-coder/phcoder' Serbinenko phcoder at gmail.com
Fri Nov 22 05:24:44 CET 2013


clang doesn't recognise =l / =h assembly operand specifiers but apparently handles C version well. Hence following patch:

diff --git a/grub-core/lib/libgcrypt/mpi/longlong.h b/grub-core/lib/libgcrypt/mpi/longlong.h
index 8c8260e..6f8dda7 100644
--- a/grub-core/lib/libgcrypt/mpi/longlong.h
+++ b/grub-core/lib/libgcrypt/mpi/longlong.h
@@ -749,7 +749,7 @@ extern USItype __udiv_qrnnd ();
  **************  MIPS  *****************
  ***************************************/
 #if defined (__mips__) && W_TYPE_SIZE == 32
-#if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#if defined (__clang__) || (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
 #define umul_ppmm(w1, w0, u, v) \
   do {                                                                  \
     UDItype _r;

Resulting assembly is
     afc:       01a20019        multu   t5,v0
     b00:       00006012        mflo    t4
     b04:       00000810        mfhi    at
which matches the intent.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 291 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20131122/6a2bac4b/attachment.sig>


More information about the Gcrypt-devel mailing list