Commit graph

11 commits

Author SHA1 Message Date
Cyrill Gorcunov
d578b511c9 iflag: Don't use c99 array initialization
It's sad but not all compilers support c99 features, so drop
off IFLAG_INIT helper.

Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-10 11:10:19 +04:00
Cyrill Gorcunov
a32e79c658 iflag: \Tabs -> \Space
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-07 16:14:00 +04:00
Cyrill Gorcunov
71f71c0dbe iflag: Introduce IFLAG_INIT helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-12-07 16:12:07 +04:00
Jin Kyu Song
0873ef5626 pfmask: Limit the preferred mask to the vendor specific flags
In ndisasm, the priority follows the order of instructions in insns.dat.
Other iflags could affect this mechanism when a proper instruction form
had a higher iflag bit set.
The preferred mask bits are now limited to vendor flags (Cyrix and AMD)
and other flags do not affect disassembler any more.

Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-12-02 18:42:19 -08:00
H. Peter Anvin
afcb66f412 iflag: Do the equality test in iflag_cmp() first
The equality test indicates how long we spin, so do that first.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-11-27 13:41:50 -08:00
H. Peter Anvin
80d18b5555 iflag: In iflag_cmp() scan from the most significant word down
In order for iflag_cmp() to return an ordering that makes sense, we
need to scan from the most significant word downward.  That way the
bits with the higher index consistently are the more significant.

This fixes the disassembler vendor selection algorithm.  While we are
doing that, make that dependency more explicit in the comments.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-26 15:21:15 -08:00
H. Peter Anvin
4b47c77d89 iflag: Drop the use of double underscores
Double underscores are reserved for the implementation, i.e. the C
compiler and its libraries.  NASM is an application and should not use
this namespace.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 17:14:34 -08:00
H. Peter Anvin
af90d3520f iflag: Make the insns_flags array const
Make the insns_flags array const, and change the helper functions to
match.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 17:13:20 -08:00
H. Peter Anvin
9a1db45895 iflag: Move instruction flag comment
Move the instruction flag comment to the Perl file where they are
defined.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 11:53:38 -08:00
H. Peter Anvin
8b0e5a34fc iflag: remove C99 constructs, don't hardcode the number of words
Avoid using C99 constructs when not necessary.  Don't hardcode the
number of words when we can autodiscover them.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 11:49:24 -08:00
H. Peter Anvin
45a22d9a61 iflag: Fix dependencies, factor out static components of iflag.h
Multi-dependencies don't work as expected, especially not across Make
versions, this is why we don't use them and read the instructions list
multiple times.

iflag.h has a lot of static content, so factor out the static content.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-24 11:13:10 -08:00