2003-03-04 02:14:13 +01:00
|
|
|
|
2005-03-02 23:19:12 +01:00
|
|
|
void glue(glue(test_, OP), b)(long op0, long op1)
|
2003-03-04 02:14:13 +01:00
|
|
|
{
|
2005-03-02 23:19:12 +01:00
|
|
|
long res, s1, s0, flags;
|
2003-03-04 02:14:13 +01:00
|
|
|
s0 = op0;
|
|
|
|
s1 = op1;
|
|
|
|
res = s0;
|
|
|
|
flags = 0;
|
|
|
|
asm ("push %4\n\t"
|
|
|
|
"popf\n\t"
|
|
|
|
stringify(OP)"b %b2\n\t"
|
|
|
|
"pushf\n\t"
|
2005-03-02 23:19:12 +01:00
|
|
|
"pop %1\n\t"
|
2003-03-04 02:14:13 +01:00
|
|
|
: "=a" (res), "=g" (flags)
|
|
|
|
: "q" (s1), "0" (res), "1" (flags));
|
2005-03-02 23:19:12 +01:00
|
|
|
printf("%-10s A=" FMTLX " B=" FMTLX " R=" FMTLX " CC=%04lx\n",
|
2003-03-04 02:14:13 +01:00
|
|
|
stringify(OP) "b", s0, s1, res, flags & CC_MASK);
|
|
|
|
}
|
|
|
|
|
2005-03-02 23:19:12 +01:00
|
|
|
void glue(glue(test_, OP), w)(long op0h, long op0, long op1)
|
2003-03-04 02:14:13 +01:00
|
|
|
{
|
2005-03-02 23:19:12 +01:00
|
|
|
long res, s1, flags, resh;
|
2003-03-04 02:14:13 +01:00
|
|
|
s1 = op1;
|
|
|
|
resh = op0h;
|
|
|
|
res = op0;
|
|
|
|
flags = 0;
|
|
|
|
asm ("push %5\n\t"
|
|
|
|
"popf\n\t"
|
|
|
|
stringify(OP) "w %w3\n\t"
|
|
|
|
"pushf\n\t"
|
2005-03-02 23:19:12 +01:00
|
|
|
"pop %1\n\t"
|
2003-03-04 02:14:13 +01:00
|
|
|
: "=a" (res), "=g" (flags), "=d" (resh)
|
|
|
|
: "q" (s1), "0" (res), "1" (flags), "2" (resh));
|
2005-03-02 23:19:12 +01:00
|
|
|
printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
|
2003-03-04 02:14:13 +01:00
|
|
|
stringify(OP) "w", op0h, op0, s1, resh, res, flags & CC_MASK);
|
|
|
|
}
|
|
|
|
|
2005-03-02 23:19:12 +01:00
|
|
|
void glue(glue(test_, OP), l)(long op0h, long op0, long op1)
|
2003-03-04 02:14:13 +01:00
|
|
|
{
|
2005-03-02 23:19:12 +01:00
|
|
|
long res, s1, flags, resh;
|
2003-03-04 02:14:13 +01:00
|
|
|
s1 = op1;
|
|
|
|
resh = op0h;
|
|
|
|
res = op0;
|
|
|
|
flags = 0;
|
|
|
|
asm ("push %5\n\t"
|
|
|
|
"popf\n\t"
|
2005-03-02 23:19:12 +01:00
|
|
|
stringify(OP) "l %k3\n\t"
|
2003-03-04 02:14:13 +01:00
|
|
|
"pushf\n\t"
|
2005-03-02 23:19:12 +01:00
|
|
|
"pop %1\n\t"
|
2003-03-04 02:14:13 +01:00
|
|
|
: "=a" (res), "=g" (flags), "=d" (resh)
|
|
|
|
: "q" (s1), "0" (res), "1" (flags), "2" (resh));
|
2005-03-02 23:19:12 +01:00
|
|
|
printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
|
2003-03-04 02:14:13 +01:00
|
|
|
stringify(OP) "l", op0h, op0, s1, resh, res, flags & CC_MASK);
|
|
|
|
}
|
|
|
|
|
2005-03-02 23:19:12 +01:00
|
|
|
#if defined(__x86_64__)
|
|
|
|
void glue(glue(test_, OP), q)(long op0h, long op0, long op1)
|
|
|
|
{
|
|
|
|
long res, s1, flags, resh;
|
|
|
|
s1 = op1;
|
|
|
|
resh = op0h;
|
|
|
|
res = op0;
|
|
|
|
flags = 0;
|
|
|
|
asm ("push %5\n\t"
|
|
|
|
"popf\n\t"
|
|
|
|
stringify(OP) "q %3\n\t"
|
|
|
|
"pushf\n\t"
|
|
|
|
"pop %1\n\t"
|
|
|
|
: "=a" (res), "=g" (flags), "=d" (resh)
|
|
|
|
: "q" (s1), "0" (res), "1" (flags), "2" (resh));
|
|
|
|
printf("%-10s AH=" FMTLX " AL=" FMTLX " B=" FMTLX " RH=" FMTLX " RL=" FMTLX " CC=%04lx\n",
|
|
|
|
stringify(OP) "q", op0h, op0, s1, resh, res, flags & CC_MASK);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2003-03-04 02:14:13 +01:00
|
|
|
#undef OP
|