diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-10-27 01:49:27 +0100 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-08 02:11:55 +0100 |
| commit | bbcc6abac7af8ac614489b676064d4c3050fd882 (patch) | |
| tree | 4dfe5214f5f146e5a6c3c7369bf37a61eff3329c /opcode.h | |
| parent | 17c0dc05248364ea9b64aa4d997c49a516208d6d (diff) | |
| download | sparse-dev-bbcc6abac7af8ac614489b676064d4c3050fd882.tar.gz | |
cmp: add signed/unsigned to opcode table
The opcode table allows to efficiently store some properties of
the IR instructions and the correspondence between some of them.
One of these correspondences the 'signed' / 'unsigned' version
of otherwise identical instructions. This is useful for some
transformation of compare instructions but is not present yet
in the table. So, add this now.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'opcode.h')
| -rw-r--r-- | opcode.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -4,7 +4,7 @@ #include "symbol.h" enum opcode { -#define OPCODE(OP,NG,SW,TF,N,FL) OP_##OP, +#define OPCODE(OP,NG,SW,SG,TF,N,FL) OP_##OP, #define OPCODE_RANGE(OP,S,E) OP_##OP = OP_##S, OP_##OP##_END = OP_##E, #include "opcode.def" #undef OPCODE @@ -15,9 +15,11 @@ enum opcode { extern const struct opcode_table { int negate:8; int swap:8; + int sign:8; int to_float:8; unsigned int arity:2; - unsigned int flags:6; + unsigned int :6; + unsigned int flags:8; #define OPF_NONE 0 #define OPF_TARGET (1 << 0) #define OPF_COMMU (1 << 1) @@ -25,6 +27,8 @@ extern const struct opcode_table { #define OPF_UNOP (1 << 3) #define OPF_BINOP (1 << 4) #define OPF_COMPARE (1 << 5) +#define OPF_SIGNED (1 << 6) +#define OPF_UNSIGNED (1 << 7) } opcode_table[]; |
