@@ -368,7 +368,7 @@ void test_lea(void)
asm("movl $0, %0\n\t"\
"cmpl %2, %1\n\t"\
"set" JCC " %b0\n\t"\
- : "=r" (res)\
+ : "=q" (res)\
: "r" (v1), "r" (v2));\
printf("%-10s %d\n", "set" JCC, res);\
if (TEST_CMOV) {\
@@ -490,15 +490,23 @@ void test_loop(void)
#if !defined(__x86_64__)
TEST_LOOP("jcxz");
+#if !defined(__clang__)
TEST_LOOP("loopw");
TEST_LOOP("loopzw");
TEST_LOOP("loopnzw");
+#endif
#endif
TEST_LOOP("jecxz");
+#if !defined(__clang__)
TEST_LOOP("loopl");
TEST_LOOP("loopzl");
TEST_LOOP("loopnzl");
+#else
+ TEST_LOOP("loop");
+ TEST_LOOP("loopz");
+ TEST_LOOP("loopnz");
+#endif
}
#undef CC_MASK
@@ -866,7 +874,7 @@ void test_fcvt(double a)
uint16_t val16;
val16 = (fpuc & ~0x0c00) | (i << 10);
asm volatile ("fldcw %0" : : "m" (val16));
- asm volatile ("fist %0" : "=m" (wa) : "t" (a));
+ asm volatile ("fists %0" : "=m" (wa) : "t" (a));
asm volatile ("fistl %0" : "=m" (ia) : "t" (a));
asm volatile ("fistpll %0" : "=m" (lla) : "t" (a) : "st");
asm volatile ("frndint ; fstl %0" : "=m" (ra) : "t" (a));
@@ -1317,12 +1325,12 @@ void test_segs(void)
seg_data1[1] = 0xaa;
seg_data2[1] = 0x55;
- asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
+ asm volatile ("movzbl %%fs:0x1, %0" : "=r" (res));
printf("FS[1] = %02x\n", res);
asm volatile ("pushl %%gs\n"
"movl %1, %%gs\n"
- "gs movzbl 0x1, %0\n"
+ "movzbl %%gs:0x1, %0\n"
"popl %%gs\n"
: "=r" (res)
: "r" (MK_SEL(2)));
@@ -1763,7 +1771,11 @@ void test_exceptions(void)
/* bound exception */
tab[0] = 1;
tab[1] = 10;
+#if defined(__clang__)
+ asm volatile ("bound %1, %0" : : "r" (11), "m" (tab[0]));
+#else
asm volatile ("bound %0, %1" : : "r" (11), "m" (tab[0]));
+#endif
}
#endif