32 |
|
|
33 |
#define TEST_CMOV 0 |
#define TEST_CMOV 0 |
34 |
#define TEST_FCOMI 0 |
#define TEST_FCOMI 0 |
35 |
|
#define TEST_VM86 |
36 |
//#define LINUX_VM86_IOPL_FIX |
//#define LINUX_VM86_IOPL_FIX |
37 |
//#define TEST_P4_FLAGS |
//#define TEST_P4_FLAGS |
38 |
|
|
373 |
s1 = op1; |
s1 = op1; |
374 |
res = s0; |
res = s0; |
375 |
flags = 0; |
flags = 0; |
376 |
asm ("push %4\n\t" |
asm volatile ("push %4\n\t" |
377 |
"popf\n\t" |
"popf\n\t" |
378 |
"imulw %w2, %w0\n\t" |
"imulw %w2, %w0\n\t" |
379 |
"pushf\n\t" |
"pushf\n\t" |
391 |
s1 = op1; |
s1 = op1; |
392 |
res = s0; |
res = s0; |
393 |
flags = 0; |
flags = 0; |
394 |
asm ("push %4\n\t" |
asm volatile ("push %4\n\t" |
395 |
"popf\n\t" |
"popf\n\t" |
396 |
"imull %2, %0\n\t" |
"imull %2, %0\n\t" |
397 |
"pushf\n\t" |
"pushf\n\t" |
407 |
int res, flags;\ |
int res, flags;\ |
408 |
flags = 0;\ |
flags = 0;\ |
409 |
res = 0;\ |
res = 0;\ |
410 |
asm ("push %3\n\t"\ |
asm volatile ("push %3\n\t"\ |
411 |
"popf\n\t"\ |
"popf\n\t"\ |
412 |
"imul" size " $" #op0 ", %" size1 "2, %" size1 "0\n\t" \ |
"imul" size " $" #op0 ", %" size1 "2, %" size1 "0\n\t" \ |
413 |
"pushf\n\t"\ |
"pushf\n\t"\ |
415 |
: "=r" (res), "=g" (flags)\ |
: "=r" (res), "=g" (flags)\ |
416 |
: "r" (op1), "1" (flags), "0" (res));\ |
: "r" (op1), "1" (flags), "0" (res));\ |
417 |
printf("%-10s A=%08x B=%08x R=%08x CC=%04x\n",\ |
printf("%-10s A=%08x B=%08x R=%08x CC=%04x\n",\ |
418 |
"imul" size, op0, op1, res, flags & CC_MASK);\ |
"imul" size " im", op0, op1, res, flags & CC_MASK);\ |
419 |
} |
} |
420 |
|
|
421 |
|
|
1674 |
TEST_ENTER("w", uint16_t, 31); |
TEST_ENTER("w", uint16_t, 31); |
1675 |
} |
} |
1676 |
|
|
|
|
|
1677 |
static void *call_end __init_call = NULL; |
static void *call_end __init_call = NULL; |
1678 |
|
|
1679 |
int main(int argc, char **argv) |
int main(int argc, char **argv) |
1697 |
test_lea(); |
test_lea(); |
1698 |
test_segs(); |
test_segs(); |
1699 |
test_code16(); |
test_code16(); |
1700 |
|
#ifdef TEST_VM86 |
1701 |
test_vm86(); |
test_vm86(); |
1702 |
|
#endif |
1703 |
test_exceptions(); |
test_exceptions(); |
1704 |
test_self_modifying_code(); |
test_self_modifying_code(); |
1705 |
test_single_step(); |
test_single_step(); |