]>
Commit | Line | Data |
---|---|---|
d57c4e01 | 1 | |
5fafdf24 | 2 | void glue(glue(test_, OP), b)(long op0, long op1) |
d57c4e01 | 3 | { |
776f2227 | 4 | long res, s1, s0, flags; |
d57c4e01 FB |
5 | s0 = op0; |
6 | s1 = op1; | |
7 | res = s0; | |
8 | flags = 0; | |
9 | asm ("push %4\n\t" | |
10 | "popf\n\t" | |
5fafdf24 | 11 | stringify(OP)"b %b2\n\t" |
d57c4e01 | 12 | "pushf\n\t" |
776f2227 | 13 | "pop %1\n\t" |
d57c4e01 FB |
14 | : "=a" (res), "=g" (flags) |
15 | : "q" (s1), "0" (res), "1" (flags)); | |
776f2227 | 16 | printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n", |
d57c4e01 FB |
17 | stringify(OP) "b", s0, s1, res, flags & CC_MASK); |
18 | } | |
19 | ||
5fafdf24 | 20 | void glue(glue(test_, OP), w)(long op0h, long op0, long op1) |
d57c4e01 | 21 | { |
776f2227 | 22 | long res, s1, flags, resh; |
d57c4e01 FB |
23 | s1 = op1; |
24 | resh = op0h; | |
25 | res = op0; | |
26 | flags = 0; | |
27 | asm ("push %5\n\t" | |
28 | "popf\n\t" | |
5fafdf24 | 29 | stringify(OP) "w %w3\n\t" |
d57c4e01 | 30 | "pushf\n\t" |
776f2227 | 31 | "pop %1\n\t" |
d57c4e01 FB |
32 | : "=a" (res), "=g" (flags), "=d" (resh) |
33 | : "q" (s1), "0" (res), "1" (flags), "2" (resh)); | |
776f2227 | 34 | printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n", |
d57c4e01 FB |
35 | stringify(OP) "w", op0h, op0, s1, resh, res, flags & CC_MASK); |
36 | } | |
37 | ||
5fafdf24 | 38 | void glue(glue(test_, OP), l)(long op0h, long op0, long op1) |
d57c4e01 | 39 | { |
776f2227 | 40 | long res, s1, flags, resh; |
d57c4e01 FB |
41 | s1 = op1; |
42 | resh = op0h; | |
43 | res = op0; | |
44 | flags = 0; | |
45 | asm ("push %5\n\t" | |
46 | "popf\n\t" | |
5fafdf24 | 47 | stringify(OP) "l %k3\n\t" |
d57c4e01 | 48 | "pushf\n\t" |
776f2227 | 49 | "pop %1\n\t" |
d57c4e01 FB |
50 | : "=a" (res), "=g" (flags), "=d" (resh) |
51 | : "q" (s1), "0" (res), "1" (flags), "2" (resh)); | |
776f2227 | 52 | printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n", |
d57c4e01 FB |
53 | stringify(OP) "l", op0h, op0, s1, resh, res, flags & CC_MASK); |
54 | } | |
55 | ||
776f2227 | 56 | #if defined(__x86_64__) |
5fafdf24 | 57 | void glue(glue(test_, OP), q)(long op0h, long op0, long op1) |
776f2227 FB |
58 | { |
59 | long res, s1, flags, resh; | |
60 | s1 = op1; | |
61 | resh = op0h; | |
62 | res = op0; | |
63 | flags = 0; | |
64 | asm ("push %5\n\t" | |
65 | "popf\n\t" | |
5fafdf24 | 66 | stringify(OP) "q %3\n\t" |
776f2227 FB |
67 | "pushf\n\t" |
68 | "pop %1\n\t" | |
69 | : "=a" (res), "=g" (flags), "=d" (resh) | |
70 | : "q" (s1), "0" (res), "1" (flags), "2" (resh)); | |
71 | printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n", | |
72 | stringify(OP) "q", op0h, op0, s1, resh, res, flags & CC_MASK); | |
73 | } | |
74 | #endif | |
75 | ||
d57c4e01 | 76 | #undef OP |