diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-05-01 21:44:24 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-05-01 21:44:24 -0700 |
commit | af9fe8f5976d3bd36312514687de32f1f8a84cca (patch) | |
tree | a52d265e64bbf72074545428a0445e87395fedb2 /common | |
parent | d23066906c65b4a01aae562a57032c669788909e (diff) | |
download | nasm-af9fe8f5976d3bd36312514687de32f1f8a84cca.tar.gz |
Don't sort opcodes; move all pseudo-ops to the beginning
We don't need to sort opcodes anymore, since we are using an O(1) hash
and not binary search. Instead, sort them in the order they first
appear in insns.dat; this lets us move all the pseudo-ops to a
contiguous range at the start of the file, for more efficient
handling.
Change the functions that process pseudo-ops accordingly.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/common.c | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/common/common.c b/common/common.c index 5a546207..13237994 100644 --- a/common/common.c +++ b/common/common.c @@ -62,61 +62,3 @@ const char *prefix_name(int token) return prefix_names[prefix]; } - -/* - * initialized data bytes length from opcode - */ -int idata_bytes(int opcode) -{ - switch (opcode) { - case I_DB: - return 1; - case I_DW: - return 2; - case I_DD: - return 4; - case I_DQ: - return 8; - case I_DT: - return 10; - case I_DO: - return 16; - case I_DY: - return 32; - case I_DZ: - return 64; - case I_none: - return -1; - default: - return 0; - } -} - -/* - * Uninitialized data bytes length from opcode - */ -int resv_bytes(int opcode) -{ - switch (opcode) { - case I_RESB: - return 1; - case I_RESW: - return 2; - case I_RESD: - return 4; - case I_RESQ: - return 8; - case I_REST: - return 10; - case I_RESO: - return 16; - case I_RESY: - return 32; - case I_RESZ: - return 64; - case I_none: - return -1; - default: - return 0; - } -} |