Skip to content

Commit e78a7b6

Browse files
karel-msjaeckel
authored andcommitted
Use standard __asm__ blocks instead of asm (from CryptX PR)
1 parent 7d4a646 commit e78a7b6

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/ciphers/aes/aes_desc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static LTC_INLINE int s_aesni_is_supported(void)
6363
a = 1;
6464
c = 0;
6565

66-
asm volatile ("cpuid"
66+
__asm__ volatile ("cpuid"
6767
:"=a"(a), "=b"(b), "=c"(c), "=d"(d)
6868
:"a"(a), "c"(c)
6969
);

src/encauth/gcm/gcm_mult_h.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ void gcm_mult_h(const gcm_state *gcm, unsigned char *I)
1919
#ifdef LTC_GCM_TABLES
2020
int x;
2121
#ifdef LTC_GCM_TABLES_SSE2
22-
asm("movdqa (%0),%%xmm0"::"r"(&gcm->PC[0][I[0]][0]));
22+
__asm__("movdqa (%0),%%xmm0"::"r"(&gcm->PC[0][I[0]][0]));
2323
for (x = 1; x < 16; x++) {
24-
asm("pxor (%0),%%xmm0"::"r"(&gcm->PC[x][I[x]][0]));
24+
__asm__("pxor (%0),%%xmm0"::"r"(&gcm->PC[x][I[x]][0]));
2525
}
26-
asm("movdqa %%xmm0,(%0)"::"r"(&T));
26+
__asm__("movdqa %%xmm0,(%0)"::"r"(&T));
2727
#else
2828
int y;
2929
XMEMCPY(T, &gcm->PC[0][I[0]][0], 16);

src/headers/tomcrypt_macros.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ do { XMEMCPY (&(x), (y), 4); \
6969
#elif !defined(LTC_NO_BSWAP) && (defined(INTEL_CC) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__) || defined(__x86_64__))))
7070

7171
#define STORE32H(x, y) \
72-
asm __volatile__ ( \
72+
__asm__ volatile ( \
7373
"bswapl %0 \n\t" \
7474
"movl %0,(%1)\n\t" \
7575
"bswapl %0 \n\t" \
7676
::"r"(x), "r"(y): "memory");
7777

7878
#define LOAD32H(x, y) \
79-
asm __volatile__ ( \
79+
__asm__ volatile ( \
8080
"movl (%1),%0\n\t" \
8181
"bswapl %0\n\t" \
8282
:"=r"(x): "r"(y): "memory");
@@ -109,14 +109,14 @@ do { XMEMCPY (&(x), (y), 8); \
109109
#elif !defined(LTC_NO_BSWAP) && (defined(__GNUC__) && defined(__x86_64__))
110110

111111
#define STORE64H(x, y) \
112-
asm __volatile__ ( \
112+
__asm__ volatile ( \
113113
"bswapq %0 \n\t" \
114114
"movq %0,(%1)\n\t" \
115115
"bswapq %0 \n\t" \
116116
::"r"(x), "r"(y): "memory");
117117

118118
#define LOAD64H(x, y) \
119-
asm __volatile__ ( \
119+
__asm__ volatile ( \
120120
"movq (%1),%0\n\t" \
121121
"bswapq %0\n\t" \
122122
:"=r"(x): "r"(y): "memory");
@@ -263,15 +263,15 @@ do { x = (((ulong64)((y)[7] & 255))<<56)|(((ulong64)((y)[6] & 255))<<48) | \
263263

264264
static inline ulong32 ROL(ulong32 word, int i)
265265
{
266-
asm ("roll %%cl,%0"
266+
__asm__ ("roll %%cl,%0"
267267
:"=r" (word)
268268
:"0" (word),"c" (i));
269269
return word;
270270
}
271271

272272
static inline ulong32 ROR(ulong32 word, int i)
273273
{
274-
asm ("rorl %%cl,%0"
274+
__asm__ ("rorl %%cl,%0"
275275
:"=r" (word)
276276
:"0" (word),"c" (i));
277277
return word;
@@ -308,15 +308,15 @@ static inline ulong32 ROR(ulong32 word, int i)
308308

309309
static inline ulong32 ROL(ulong32 word, int i)
310310
{
311-
asm ("rotlw %0,%0,%2"
311+
__asm__ ("rotlw %0,%0,%2"
312312
:"=r" (word)
313313
:"0" (word),"r" (i));
314314
return word;
315315
}
316316

317317
static inline ulong32 ROR(ulong32 word, int i)
318318
{
319-
asm ("rotlw %0,%0,%2"
319+
__asm__ ("rotlw %0,%0,%2"
320320
:"=r" (word)
321321
:"0" (word),"r" (32-i));
322322
return word;
@@ -326,15 +326,15 @@ static inline ulong32 ROR(ulong32 word, int i)
326326

327327
static inline ulong32 ROLc(ulong32 word, const int i)
328328
{
329-
asm ("rotlwi %0,%0,%2"
329+
__asm__ ("rotlwi %0,%0,%2"
330330
:"=r" (word)
331331
:"0" (word),"I" (i));
332332
return word;
333333
}
334334

335335
static inline ulong32 RORc(ulong32 word, const int i)
336336
{
337-
asm ("rotrwi %0,%0,%2"
337+
__asm__ ("rotrwi %0,%0,%2"
338338
:"=r" (word)
339339
:"0" (word),"I" (i));
340340
return word;
@@ -381,15 +381,15 @@ static inline ulong32 RORc(ulong32 word, const int i)
381381

382382
static inline ulong64 ROL64(ulong64 word, int i)
383383
{
384-
asm("rolq %%cl,%0"
384+
__asm__("rolq %%cl,%0"
385385
:"=r" (word)
386386
:"0" (word),"c" (i));
387387
return word;
388388
}
389389

390390
static inline ulong64 ROR64(ulong64 word, int i)
391391
{
392-
asm("rorq %%cl,%0"
392+
__asm__("rorq %%cl,%0"
393393
:"=r" (word)
394394
:"0" (word),"c" (i));
395395
return word;

0 commit comments

Comments
 (0)