mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
51 lines
3.4 KiB
C
51 lines
3.4 KiB
C
// The OS/K Team licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
/*
|
|
#define _IMPL_IF_COND(name, suf, cond) \
|
|
IMPL_START_0(name##$##suf) \
|
|
{ \
|
|
if (cond) { \
|
|
i_##name(ctx, p1, p2); \
|
|
} \
|
|
} \
|
|
IMPL_END \
|
|
|
|
#define IMPL_COND(name) \
|
|
\
|
|
_IMPL_IF_COND(name, cxz, rcx == 0); \
|
|
_IMPL_IF_COND(name, cxnz, rcx != 0); \
|
|
\
|
|
_IMPL_IF_COND(name, c, flg&CF); \
|
|
_IMPL_IF_COND(name, o, flg&OF); \
|
|
\
|
|
_IMPL_IF_COND(name, nc, !(flg&CF)); \
|
|
_IMPL_IF_COND(name, no, !(flg&OF)); \
|
|
\
|
|
_IMPL_IF_COND(name, z, flg&ZF); \
|
|
_IMPL_IF_COND(name, s, flg&SF); \
|
|
_IMPL_IF_COND(name, p, flg&PF); \
|
|
\
|
|
_IMPL_IF_COND(name, nz, !(flg&ZF)); \
|
|
_IMPL_IF_COND(name, ns, !(flg&SF)); \
|
|
_IMPL_IF_COND(name, np, !(flg&PF)); \
|
|
\
|
|
_IMPL_IF_COND(name, e, flg&ZF); \
|
|
_IMPL_IF_COND(name, eq, flg&ZF); \
|
|
_IMPL_IF_COND(name, ne, !(flg&ZF)); \
|
|
\
|
|
_IMPL_IF_COND(name, b, flg&CF); \
|
|
_IMPL_IF_COND(name, be, flg&ZF || flg&CF); \
|
|
\
|
|
_IMPL_IF_COND(name, a, !(flg&CF || flg&ZF)); \
|
|
_IMPL_IF_COND(name, ae, !(flg&CF)); \
|
|
\
|
|
_IMPL_IF_COND(name, l, !!(flg&SF) != !!(flg&OF)); \
|
|
_IMPL_IF_COND(name, le, flg&ZF || (!!(flg&SF) != !!(flg&OF))); \
|
|
\
|
|
_IMPL_IF_COND(name, g, !(flg&ZF) && (!!(flg&SF) == !!(flg&OF))); \
|
|
_IMPL_IF_COND(name, ge, !!(flg&SF) == !!(flg&OF)); \
|
|
*/
|
|
|
|
#define IMPL_COND(name)
|