aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-22 18:21:24 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:06:16 -0700
commit741bbde940215dd3c9d9d4ea011af4e3764c4a31 (patch)
tree3c6c3422a6aa00547adadf1cbcf57ad0951694ac /example.c
parentMake linearizer able to handle assignment ops where the (diff)
downloadsparse-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.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/example.c b/example.c
index d4f4c32..819d98b 100644
--- a/example.c
+++ b/example.c
@@ -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;