// 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)