Lines Matching +full:1 +full:a
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * You should have received a copy of the GNU General Public License
37 #define TEST_CMOV 1
38 #define TEST_FCOMI 1
189 : "a" (eax), "b" (ebx), "c" (ecx), "d" (edx), "S" (esi), "D" (edi));\
197 : "a" (eax), "b" (ebx), "c" (ecx), "d" (edx), "S" (esi), "D" (edi));\
205 : "a" (eax), "b" (ebx), "c" (ecx), "d" (edx), "S" (esi), "D" (edi));\
352 asm("movl $1, %0\n\t"\
353 "cmpl %2, %1\n\t"\
354 "j" JCC " 1f\n\t"\
356 "1:\n\t"\
362 "cmpl %2, %1\n\t"\
368 long val = i2l(1);\
371 asm("cmpl %2, %1\n\t"\
376 asm("cmpl %2, %1\n\t"\
381 asm("cmpl %2, %1\n\t"\
384 : "r" (v1), "r" (v2), "r" (1), "0" (res));\
392 TEST_JCC("ne", 1, 1); in test_jcc()
393 TEST_JCC("ne", 1, 0); in test_jcc()
395 TEST_JCC("e", 1, 1); in test_jcc()
396 TEST_JCC("e", 1, 0); in test_jcc()
398 TEST_JCC("l", 1, 1); in test_jcc()
399 TEST_JCC("l", 1, 0); in test_jcc()
400 TEST_JCC("l", 1, -1); in test_jcc()
402 TEST_JCC("le", 1, 1); in test_jcc()
403 TEST_JCC("le", 1, 0); in test_jcc()
404 TEST_JCC("le", 1, -1); in test_jcc()
406 TEST_JCC("ge", 1, 1); in test_jcc()
407 TEST_JCC("ge", 1, 0); in test_jcc()
408 TEST_JCC("ge", -1, 1); in test_jcc()
410 TEST_JCC("g", 1, 1); in test_jcc()
411 TEST_JCC("g", 1, 0); in test_jcc()
412 TEST_JCC("g", 1, -1); in test_jcc()
414 TEST_JCC("b", 1, 1); in test_jcc()
415 TEST_JCC("b", 1, 0); in test_jcc()
416 TEST_JCC("b", 1, -1); in test_jcc()
418 TEST_JCC("be", 1, 1); in test_jcc()
419 TEST_JCC("be", 1, 0); in test_jcc()
420 TEST_JCC("be", 1, -1); in test_jcc()
422 TEST_JCC("ae", 1, 1); in test_jcc()
423 TEST_JCC("ae", 1, 0); in test_jcc()
424 TEST_JCC("ae", 1, -1); in test_jcc()
426 TEST_JCC("a", 1, 1); in test_jcc()
427 TEST_JCC("a", 1, 0); in test_jcc()
428 TEST_JCC("a", 1, -1); in test_jcc()
431 TEST_JCC("p", 1, 1); in test_jcc()
432 TEST_JCC("p", 1, 0); in test_jcc()
434 TEST_JCC("np", 1, 1); in test_jcc()
435 TEST_JCC("np", 1, 0); in test_jcc()
438 TEST_JCC("o", 0x7fffffff, -1); in test_jcc()
441 TEST_JCC("no", 0x7fffffff, -1); in test_jcc()
443 TEST_JCC("s", 0, 1); in test_jcc()
444 TEST_JCC("s", 0, -1); in test_jcc()
447 TEST_JCC("ns", 0, 1); in test_jcc()
448 TEST_JCC("ns", 0, -1); in test_jcc()
458 "movl $1, %0\n\t"\
459 insn " 1f\n\t" \
461 "1:\n\t"\
462 : "=a" (res)\
474 1, in test_loop()
521 "pop %1\n\t" in test_imulw2()
523 : "q" (s1), "0" (res), "1" (flags)); in test_imulw2()
524 printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n", in test_imulw2()
539 "pop %1\n\t" in test_imull2()
541 : "q" (s1), "0" (res), "1" (flags)); in test_imull2()
542 printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n", in test_imull2()
558 "pop %1\n\t" in test_imulq2()
560 : "q" (s1), "0" (res), "1" (flags)); in test_imulq2()
561 printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n", in test_imulq2()
576 "pop %1\n\t"\
578 : "r" (s1), "1" (flags), "0" (res));\
579 printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n",\
647 test_idivb(0x12340004, -1); in test_mul()
651 test_idivw(0, 0x12348000, -1); in test_mul()
656 test_idivl(0, 0x80000000, -1); in test_mul()
661 test_divb(0x12340004, -1); in test_mul()
665 test_divw(0, 0x12348000, -1); in test_mul()
670 test_divl(0, 0x80000000, -1); in test_mul()
696 test_idivq(0, 0x8000000000000000, -1); in test_mul()
701 test_divq(0, 0x8000000000000000, -1); in test_mul()
710 asm("xor %1, %1\n"\
715 printf("%-10s A=" FMTLX " R=" FMTLX " %ld\n", #op, val, res, resz);\
770 void test_fops(double a, double b) in test_fops() argument
772 printf("a=%f b=%f a+b=%f\n", a, b, a + b); in test_fops()
773 printf("a=%f b=%f a-b=%f\n", a, b, a - b); in test_fops()
774 printf("a=%f b=%f a*b=%f\n", a, b, a * b); in test_fops()
775 printf("a=%f b=%f a/b=%f\n", a, b, a / b); in test_fops()
776 printf("a=%f b=%f fmod(a, b)=%f\n", a, b, fmod(a, b)); in test_fops()
777 printf("a=%f sqrt(a)=%f\n", a, sqrt(a)); in test_fops()
778 printf("a=%f sin(a)=%f\n", a, sin(a)); in test_fops()
779 printf("a=%f cos(a)=%f\n", a, cos(a)); in test_fops()
780 printf("a=%f tan(a)=%f\n", a, tan(a)); in test_fops()
781 printf("a=%f log(a)=%f\n", a, log(a)); in test_fops()
782 printf("a=%f exp(a)=%f\n", a, exp(a)); in test_fops()
783 printf("a=%f b=%f atan2(a, b)=%f\n", a, b, atan2(a, b)); in test_fops()
785 printf("a=%f asin(sin(a))=%f\n", a, asin(sin(a))); in test_fops()
786 printf("a=%f acos(cos(a))=%f\n", a, acos(cos(a))); in test_fops()
787 printf("a=%f atan(tan(a))=%f\n", a, atan(tan(a))); in test_fops()
813 void test_fcmp(double a, double b) in test_fcmp() argument
820 : "=a" (fpus) in test_fcmp()
821 : "t" (a), "u" (b)); in test_fcmp()
823 a, b, fpus & (0x4500 | FPUS_EMASK)); in test_fcmp()
827 : "=a" (fpus) in test_fcmp()
828 : "t" (a), "u" (b)); in test_fcmp()
830 a, b, fpus & (0x4500 | FPUS_EMASK)); in test_fcmp()
838 : "=r" (eflags), "=a" (fpus) in test_fcmp()
839 : "t" (a), "u" (b)); in test_fcmp()
841 a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C)); in test_fcmp()
847 : "=r" (eflags), "=a" (fpus) in test_fcmp()
848 : "t" (a), "u" (b)); in test_fcmp()
850 a, b, fpus & FPUS_EMASK, eflags & (CC_Z | CC_P | CC_C)); in test_fcmp()
855 : "=a" (fpus) in test_fcmp()
856 : "t" (a)); in test_fcmp()
857 printf("fxam(%f)=%04lx\n", a, fpus & 0x4700); in test_fcmp()
861 void test_fcvt(double a) in test_fcvt() argument
872 fa = a; in test_fcvt()
873 la = a; in test_fcvt()
874 printf("(float)%f = %f\n", a, fa); in test_fcvt()
875 printf("(long double)%f = %Lf\n", a, la); in test_fcvt()
876 printf("a=" FMT64X "\n", *(uint64_t *)&a); in test_fcvt()
886 asm volatile ("fists %0" : "=m" (wa) : "t" (a)); in test_fcvt()
887 asm volatile ("fistl %0" : "=m" (ia) : "t" (a)); in test_fcvt()
888 asm volatile ("fistpll %0" : "=m" (lla) : "t" (a) : "st"); in test_fcvt()
889 asm volatile ("frndint ; fstl %0" : "=m" (ra) : "t" (a)); in test_fcvt()
891 printf("(short)a = %d\n", wa); in test_fcvt()
892 printf("(int)a = %d\n", ia); in test_fcvt()
893 printf("(int64_t)a = " FMT64X "\n", lla); in test_fcvt()
894 printf("rint(a) = %f\n", ra); in test_fcvt()
899 asm("fld" #N : "=t" (a)); \
900 printf("fld" #N "= %f\n", a);
904 double a; in test_fconst() local
905 TEST(1); in test_fconst()
914 void test_fbcd(double a) in test_fbcd() argument
919 asm("fbstp %0" : "=m" (bcd[0]) : "t" (a) : "st"); in test_fbcd()
920 asm("fbld %1" : "=t" (b) : "m" (bcd[0])); in test_fbcd()
921 printf("a=%f bcd=%04x%04x%04x%04x%04x b=%f\n", in test_fbcd()
922 a, bcd[4], bcd[3], bcd[2], bcd[1], bcd[0], b); in test_fbcd()
966 dtab[i] = i + 1; in test_fenv()
983 #define TEST_FCMOV(a, b, eflags, CC)\ argument
990 : "0" (a), "u" (b), "g" (eflags));\
997 double a, b; in test_fcmov() local
1000 a = 1.0; in test_fcmov()
1004 if (i & 1) in test_fcmov()
1008 TEST_FCMOV(a, b, eflags, "b"); in test_fcmov()
1009 TEST_FCMOV(a, b, eflags, "e"); in test_fcmov()
1010 TEST_FCMOV(a, b, eflags, "be"); in test_fcmov()
1011 TEST_FCMOV(a, b, eflags, "nb"); in test_fcmov()
1012 TEST_FCMOV(a, b, eflags, "ne"); in test_fcmov()
1013 TEST_FCMOV(a, b, eflags, "nbe"); in test_fcmov()
1015 TEST_FCMOV(a, b, 0, "u"); in test_fcmov()
1016 TEST_FCMOV(a, b, CC_P, "u"); in test_fcmov()
1017 TEST_FCMOV(a, b, 0, "nu"); in test_fcmov()
1018 TEST_FCMOV(a, b, CC_P, "nu"); in test_fcmov()
1025 test_fcmp(2, -1); in test_floats()
1029 test_fcmp(q_nan.d, -1); in test_floats()
1030 test_fcmp(-1.0/0.0, -1); in test_floats()
1031 test_fcmp(1.0/0.0, -1); in test_floats()
1037 test_fcvt(-1e20); in test_floats()
1062 "pop %1\n\t"\
1063 : "=a" (res), "=g" (flags)\
1064 : "0" (res), "1" (flags));\
1065 printf("%-10s A=%08x R=%08x CCIN=%04x CC=%04x\n",\
1127 asm(#op " %" size "0, %" size "1" \
1130 printf("%-10s A=" FMTLX " B=" FMTLX "\n",\
1140 asm(#op " %" size "0, %" size "1" \
1142 : "0" (op0), "a" (op2));\
1143 printf("%-10s EAX=" FMTLX " A=" FMTLX " C=" FMTLX "\n",\
1173 asm("xaddl %1, %0" : "=r" (res) : "0" (res)); in test_xchg()
1229 : "=a" (eax), "=d" (edx), "=m" (op1), "=g" (eflags) in test_xchg()
1230 : "0" (eax), "1" (edx), "m" (op1), "b" ((int)op2), "c" ((int)(op2 >> 32))); in test_xchg()
1266 "movl $0, %1\n"\
1267 "jnz 1f\n"\
1268 "movl $1, %1\n"\
1269 "1:\n"\
1276 long a, b, c; \
1277 a = (op1); \
1280 "movl $0,%1\n"\
1281 "jnz 1f\n"\
1282 "movl $1,%1\n"\
1283 "1:\n"\
1284 : "=r" (a), "=r" (c) : "0" (a), "r" (b)); \
1285 printf(op size " A=" FMTLX " B=" FMTLX " R=" FMTLX " z=%ld\n",\
1286 (long)(op1), (long)(op2), a, c);\
1301 ldt.entry_number = 1; in test_segs()
1304 ldt.seg_32bit = 1; in test_segs()
1307 ldt.limit_in_pages = 1; in test_segs()
1309 ldt.useable = 1; in test_segs()
1310 modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */ in test_segs()
1315 ldt.seg_32bit = 1; in test_segs()
1318 ldt.limit_in_pages = 1; in test_segs()
1320 ldt.useable = 1; in test_segs()
1321 modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */ in test_segs()
1332 asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1))); in test_segs()
1334 seg_data1[1] = 0xaa; in test_segs()
1335 seg_data2[1] = 0x55; in test_segs()
1338 printf("FS[1] = %02x\n", res); in test_segs()
1341 "movl %1, %%gs\n" in test_segs()
1346 printf("GS[1] = %02x\n", res); in test_segs()
1355 "movzbl (%%ebp), %1\n\t" in test_segs()
1359 : "r" (MK_SEL(1)), "r" (&tmp)); in test_segs()
1360 printf("DS[1] = %02x\n", res); in test_segs()
1366 "movl %%fs, %1\n\t" in test_segs()
1381 TEST_ARPL("arpl", "w", 0x12345678 | 3, 0x762123c | 1); in test_segs()
1382 TEST_ARPL("arpl", "w", 0x12345678 | 1, 0x762123c | 3); in test_segs()
1383 TEST_ARPL("arpl", "w", 0x12345678 | 1, 0x762123c | 1); in test_segs()
1397 /* build a code segment */ in test_code16()
1398 ldt.entry_number = 1; in test_code16()
1406 ldt.useable = 1; in test_code16()
1407 modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */ in test_code16()
1410 asm volatile ("lcall %1, %2" in test_code16()
1411 : "=a" (res) in test_code16()
1412 : "i" (MK_SEL(1)), "i" (&code16_func1): "memory", "cc"); in test_code16()
1415 : "=a" (res), "=c" (res2) in test_code16()
1416 : "i" (MK_SEL(1)), "i" (&code16_func2): "memory", "cc"); in test_code16()
1418 asm volatile ("lcall %1, %2" in test_code16()
1419 : "=a" (res) in test_code16()
1420 : "i" (MK_SEL(1)), "i" (&code16_func3): "memory", "cc"); in test_code16()
1452 asm ("xlat" : "=a" (res) : "b" (table), "0" (res)); in test_misc()
1469 asm volatile ("push %1\n" in test_misc()
1471 : "=a" (res) in test_misc()
1480 : "=a" (res) in test_misc()
1486 "mov $ 1f, %%rax\n" in test_misc()
1489 "1:\n" in test_misc()
1490 : "=a" (res) in test_misc()
1497 asm volatile ("push %%cs ; call %1" in test_misc()
1498 : "=a" (res) in test_misc()
1502 asm volatile ("pushf ; push %%cs ; call %1" in test_misc()
1503 : "=a" (res) in test_misc()
1544 : "=S" (esi), "=D" (edi), "=a" (eax), "=c" (ecx), "=g" (eflags)\
1545 : "0" (esi), "1" (edi), "2" (eax), "3" (ecx));\
1586 static inline void set_bit(uint8_t *a, unsigned int bit) in set_bit() argument
1588 a[bit / 8] |= (1 << (bit % 8)); in set_bit()
1622 MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0); in test_vm86()
1642 /* move code to proper address. We use the same layout as a .com in test_vm86()
1698 /* a signal came, we just ignore that */ in test_vm86()
1752 longjmp(jmp_env, 1); in sig_handler()
1781 tab[0] = 1; in test_exceptions()
1782 tab[1] = 10; in test_exceptions()
1783 asm volatile ("bound %0, %1" : : "r" (11), "m" (tab[0])); in test_exceptions()
1791 asm volatile ("movl %0, %%fs" : : "r" ((0x1234 << 3) | 1)); in test_exceptions()
1802 ldt.entry_number = 1; in test_exceptions()
1805 ldt.seg_32bit = 1; in test_exceptions()
1808 ldt.limit_in_pages = 1; in test_exceptions()
1809 ldt.seg_not_present = 1; in test_exceptions()
1810 ldt.useable = 1; in test_exceptions()
1811 modify_ldt(1, &ldt, sizeof(ldt)); /* write ldt entry */ in test_exceptions()
1815 asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1))); in test_exceptions()
1823 val = 1; in test_exceptions()
1824 /* we add a nop to test a weird PC retrieval case */ in test_exceptions()
1827 *(char *)0x1234 = 1; in test_exceptions()
1833 val = 1; in test_exceptions()
1886 asm volatile ("addl $1, %0 ; into" : : "r" (0x7fffffff)); in test_exceptions()
1892 asm volatile ("outb %%al, %%dx" : : "d" (0x4321), "a" (0)); in test_exceptions()
1897 asm volatile ("inb %%dx, %%al" : "=a" (val) : "d" (0x4321)); in test_exceptions()
1902 asm volatile ("rep outsb" : : "d" (0x4321), "S" (tab), "c" (1)); in test_exceptions()
1907 asm volatile ("rep insb" : : "d" (0x4321), "D" (tab), "c" (1)); in test_exceptions()
1935 const uint8_t sstep_buf1[4] = { 1, 2, 3, 4};
1956 "1:\n" in test_single_step()
1957 "addl $1, %0\n" in test_single_step()
1959 "jnz 1b\n" in test_single_step()
1968 "movl $1, %%ecx\n" in test_single_step()
1989 "addl $1, %0\n" in test_single_step()
1990 "movl $1, %%eax\n" in test_single_step()
1992 "jmp 1f\n" in test_single_step()
1993 "addl $1, %0\n" in test_single_step()
1994 "1:\n" in test_single_step()
1995 "movl $1, %%eax\n" in test_single_step()
1998 "addl $1, %0\n" in test_single_step()
1999 "movl $1, %%eax\n" in test_single_step()
2014 0xb8, 0x1, 0x00, 0x00, 0x00, /* movl $1, %eax */
2021 "movl %eax, smc_patch_addr2 + 1\n"
2031 "movl $1, %eax\n"
2044 code[1] = i; in test_self_modifying_code()
2078 for(i=1;i<=32;i++)\
2108 TEST_ENTER("q", uint64_t, 1); in test_enter()
2113 TEST_ENTER("l", uint32_t, 1); in test_enter()
2119 TEST_ENTER("w", uint16_t, 1); in test_enter()
2126 unsigned long a, r;\
2127 a = i2l(0x8234a6f8);\
2128 r = a;\
2129 asm volatile(#op : "=a" (r) : "0" (r));\
2130 printf("%-10s A=" FMTLX " R=" FMTLX "\n", #op, a, r);\
2135 unsigned long a, d, r, rh; \
2136 a = i2l(0x8234a6f8);\
2138 r = a;\
2140 asm volatile(#op : "=a" (r), "=d" (rh) : "0" (r), "1" (rh)); \
2141 printf("%-10s A=" FMTLX " R=" FMTLX ":" FMTLX "\n", #op, a, r, rh); \
2159 unsigned long a, r; in test_conv() local
2160 a = i2l(0x12345678); in test_conv()
2161 asm volatile("bswapl %k0" : "=r" (r) : "0" (a)); in test_conv()
2162 printf("%-10s: A=" FMTLX " R=" FMTLX "\n", "bswapl", a, r); in test_conv()
2166 unsigned long a, r; in test_conv() local
2167 a = i2l(0x12345678); in test_conv()
2168 asm volatile("bswapq %0" : "=r" (r) : "0" (a)); in test_conv()
2169 printf("%-10s: A=" FMTLX " R=" FMTLX "\n", "bswapq", a, r); in test_conv()