提交 281066cb 编写于 作者: A Andy Polyakov

Compensate inline assembler in sha512.c for gcc 2.7.2 compiler bug.

PR: 1667
上级 830b8877
...@@ -364,19 +364,19 @@ static const SHA_LONG64 K512[80] = { ...@@ -364,19 +364,19 @@ static const SHA_LONG64 K512[80] = {
# elif (defined(__i386) || defined(__i386__)) && !defined(B_ENDIAN) # elif (defined(__i386) || defined(__i386__)) && !defined(B_ENDIAN)
# if defined(I386_ONLY) # if defined(I386_ONLY)
# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ # define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\
unsigned int hi,lo; \ unsigned int hi=p[0],lo=p[1]; \
asm("xchgb %%ah,%%al;xchgb %%dh,%%dl;"\ asm("xchgb %%ah,%%al;xchgb %%dh,%%dl;"\
"roll $16,%%eax; roll $16,%%edx; "\ "roll $16,%%eax; roll $16,%%edx; "\
"xchgb %%ah,%%al;xchgb %%dh,%%dl;" \ "xchgb %%ah,%%al;xchgb %%dh,%%dl;" \
: "=a"(lo),"=d"(hi) \ : "=a"(lo),"=d"(hi) \
: "0"(p[1]),"1"(p[0]) : "cc"); \ : "0"(lo),"1"(hi) : "cc"); \
((SHA_LONG64)hi)<<32|lo; }) ((SHA_LONG64)hi)<<32|lo; })
# else # else
# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ # define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\
unsigned int hi,lo; \ unsigned int hi=p[0],lo=p[1]; \
asm ("bswapl %0; bswapl %1;" \ asm ("bswapl %0; bswapl %1;" \
: "=r"(lo),"=r"(hi) \ : "=r"(lo),"=r"(hi) \
: "0"(p[1]),"1"(p[0])); \ : "0"(lo),"1"(hi)); \
((SHA_LONG64)hi)<<32|lo; }) ((SHA_LONG64)hi)<<32|lo; })
# endif # endif
# elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) # elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册