Skip to content

Commit dc2588b

Browse files
committed
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
2 parents 7649bfb + 544d93b commit dc2588b

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

block-sha1/sha1.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,10 @@
1111

1212
#include "sha1.h"
1313

14-
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
15-
16-
/*
17-
* Force usage of rol or ror by selecting the one with the smaller constant.
18-
* It _can_ generate slightly smaller code (a constant of 1 is special), but
19-
* perhaps more importantly it's possibly faster on any uarch that does a
20-
* rotate with a loop.
21-
*/
22-
23-
#define SHA_ASM(op, x, n) ({ unsigned int __res; __asm__(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })
24-
#define SHA_ROL(x,n) SHA_ASM("rol", x, n)
25-
#define SHA_ROR(x,n) SHA_ASM("ror", x, n)
26-
27-
#else
28-
2914
#define SHA_ROT(X,l,r) (((X) << (l)) | ((X) >> (r)))
3015
#define SHA_ROL(X,n) SHA_ROT(X,n,32-(n))
3116
#define SHA_ROR(X,n) SHA_ROT(X,32-(n),n)
3217

33-
#endif
34-
3518
/*
3619
* If you have 32 registers or more, the compiler can (and should)
3720
* try to change the array[] accesses into registers. However, on

0 commit comments

Comments
 (0)