mirror of
https://gitlab.os-k.eu/os-k-team/kvisc.git
synced 2023-08-25 14:05:46 +02:00
24 lines
972 B
C
24 lines
972 B
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 PARITY(v) __builtin_parity(v)
|
|
|
|
#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) \
|
|
flg = (PARITY(v) == 1 ? (flg|PF) : (flg&~PF))
|
|
|
|
#define SET_ZSF(v) \
|
|
SET_ZF(v); \
|
|
SET_SF(v)
|
|
|
|
#define SET_ZSPF(v) \
|
|
SET_ZF(v); \
|
|
SET_SF(v); \
|
|
SET_PF(v)
|
|
|