kvisc/vm/in/flags.h

24 lines
972 B
C
Raw Normal View History

2019-06-06 22:07:34 +02:00
// The OS/K Team licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
2019-06-07 13:38:34 +02:00
#define PARITY(v) __builtin_parity(v)
2019-06-06 22:07:34 +02:00
#define SET_ZF(v) \
flg = ((v) == 0 ? (flg|ZF) : (flg&~ZF))
#define SET_SF(v) \
flg = ((long)(v) < 0 ? (flg|SF) : (flg&~SF))
#define SET_PF(v) \
2019-06-07 13:38:34 +02:00
flg = (PARITY(v) == 1 ? (flg|PF) : (flg&~PF))
2019-06-06 22:07:34 +02:00
#define SET_ZSF(v) \
SET_ZF(v); \
SET_SF(v)
2019-06-12 15:30:35 +02:00
#define SET_ZSPF(v) \
2019-06-06 22:07:34 +02:00
SET_ZF(v); \
SET_SF(v); \
SET_PF(v)