diff options
author | 2005-01-22 18:21:24 -0700 | |
---|---|---|
committer | 2005-04-07 21:06:16 -0700 | |
commit | 741bbde940215dd3c9d9d4ea011af4e3764c4a31 (patch) | |
tree | 3c6c3422a6aa00547adadf1cbcf57ad0951694ac /example.c | |
parent | Make linearizer able to handle assignment ops where the (diff) | |
download | sparse-741bbde940215dd3c9d9d4ea011af4e3764c4a31.tar.gz sparse-741bbde940215dd3c9d9d4ea011af4e3764c4a31.tar.bz2 sparse-741bbde940215dd3c9d9d4ea011af4e3764c4a31.zip |
Split the binops where signedness matters into unsigned and signed.
This is OP_MUL/OP_DIV/OP_MOD/OP_SHR.
We actually do the constant simplifications still wrong, but
now the information is all there.
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -31,11 +31,15 @@ static const char* opcodes[] = { /* Binary */ [OP_ADD] = "add", [OP_SUB] = "sub", - [OP_MUL] = "mul", - [OP_DIV] = "div", - [OP_MOD] = "mod", + [OP_MULU] = "mulu", + [OP_MULS] = "muls", + [OP_DIVU] = "divu", + [OP_DIVS] = "divs", + [OP_MODU] = "modu", + [OP_MODS] = "mods", [OP_SHL] = "shl", - [OP_SHR] = "shr", + [OP_LSR] = "lsr", + [OP_ASR] = "asr", /* Logical */ [OP_AND] = "and", @@ -1366,14 +1370,15 @@ static void generate_one_insn(struct instruction *insn, struct bb_state *state) mark_pseudo_dead(state, insn->target); return; - case OP_ADD: case OP_MUL: + case OP_ADD: case OP_MULU: case OP_MULS: case OP_AND: case OP_OR: case OP_XOR: case OP_AND_BOOL: case OP_OR_BOOL: generate_commutative_binop(state, insn); break; - case OP_SUB: case OP_DIV: case OP_MOD: - case OP_SHL: case OP_SHR: + case OP_SUB: case OP_DIVU: case OP_DIVS: + case OP_MODU: case OP_MODS: + case OP_SHL: case OP_LSR: case OP_ASR: generate_binop(state, insn); break; |