From: Cyrill Gorcunov Date: Sat, 15 Sep 2012 15:58:36 +0000 (+0400) Subject: opflags: Introduce opflags generating macros X-Git-Tag: nasm-2.10.06~11 X-Git-Url: https://repo.or.cz/w/nasm.git/commitdiff_plain/220ac6544c857f37be9b54f44e6805494493136c opflags: Introduce opflags generating macros This patch introduces two macros - OP_GENMASK, to generate masks in opflags - OP_GENBIT, to generate bit at specified position we will use them with extended 64 bits opflags. Signed-off-by: Cyrill Gorcunov --- diff --git a/opflags.h b/opflags.h index d3da5b38..904a53a2 100644 --- a/opflags.h +++ b/opflags.h @@ -134,6 +134,10 @@ typedef uint64_t opflags_t; +#define OP_GENMASK(bits, shift) (((UINT64_C(1) << (bits)) - 1) << (shift)) +#define OP_GENBIT(bit, shift) (UINT64_C(1) << ((shift) + (bit))) + + /* Size, and other attributes, of the operand */ #define BITS8 UINT64_C(0x00000001) #define BITS16 UINT64_C(0x00000002)