diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-23 14:09:29 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-23 14:09:29 -0700 |
commit | dc2588b2ba2b265e74c10efcfe20a78b291dfad4 (patch) | |
tree | 49de70ab057efe981f2d58e6a388caea1538cfd8 | |
parent | Merge branch 'gc/submodule-update-part1' (diff) | |
parent | block-sha1: remove use of obsolete x86 assembly (diff) | |
download | tgif-dc2588b2ba2b265e74c10efcfe20a78b291dfad4.tar.xz |
Merge branch 'bc/block-sha1-without-gcc-asm-extension'
Get rid of one use of __asm__() GCC extension that does not help us
much these days, which has an added advantage of not having to
worry about -pedantic complaining.
* bc/block-sha1-without-gcc-asm-extension:
block-sha1: remove use of obsolete x86 assembly
-rw-r--r-- | block-sha1/sha1.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/block-sha1/sha1.c b/block-sha1/sha1.c index 1bb6e7c069..5974cd7dd3 100644 --- a/block-sha1/sha1.c +++ b/block-sha1/sha1.c @@ -11,27 +11,10 @@ #include "sha1.h" -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) - -/* - * Force usage of rol or ror by selecting the one with the smaller constant. - * It _can_ generate slightly smaller code (a constant of 1 is special), but - * perhaps more importantly it's possibly faster on any uarch that does a - * rotate with a loop. - */ - -#define SHA_ASM(op, x, n) ({ unsigned int __res; __asm__(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; }) -#define SHA_ROL(x,n) SHA_ASM("rol", x, n) -#define SHA_ROR(x,n) SHA_ASM("ror", x, n) - -#else - #define SHA_ROT(X,l,r) (((X) << (l)) | ((X) >> (r))) #define SHA_ROL(X,n) SHA_ROT(X,n,32-(n)) #define SHA_ROR(X,n) SHA_ROT(X,32-(n),n) -#endif - /* * If you have 32 registers or more, the compiler can (and should) * try to change the array[] accesses into registers. However, on |