diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2017-02-25 14:48:15 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2017-02-25 15:14:12 -0500 |
commit | 2c2db15995ce6c0f362d65e174d5a1b933057b80 (patch) | |
tree | c6faa1a0bbe472420be1372c9762f11be4403d8f /simpl.c | |
parent | e46b4e31e83f2f9d638ddffc5575795565f15e88 (diff) | |
download | roux-2c2db15995ce6c0f362d65e174d5a1b933057b80.tar.gz |
do sign/zero extensions removal in copy.c
Diffstat (limited to 'simpl.c')
-rw-r--r-- | simpl.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/simpl.c b/simpl.c deleted file mode 100644 index 384a8da..0000000 --- a/simpl.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "all.h" - -static void -elimext(Ins *i, int ext, Fn *fn) -{ - Tmp *t; - Use *u; - - assert(rtype(i->to) == RTmp); - t = &fn->tmp[i->to.val]; - for (u=t->use; u<&t->use[t->nuse]; u++) - if (u->type == UIns - && u->u.ins->op == ext - && (u->u.ins->cls == i->cls || i->cls == Kl)) { - u->u.ins->op = Ocopy; - elimext(u->u.ins, ext, fn); - } -} - -/* requires & preserves uses */ -void -simpl(Fn *fn) -{ - Blk *b; - Ins *i; - int ext; - - for (b=fn->start; b; b=b->link) - for (i=b->ins; i<&b->ins[b->nins]; i++) - switch (i->op) { - case Oloadsb: - case Oloadub: - case Oloadsh: - case Oloaduh: - ext = Oextsb + (i->op - Oloadsb); - goto Elimext; - case Oextsb: - case Oextub: - case Oextsh: - case Oextuh: - ext = i->op; - Elimext: - elimext(i, ext, fn); - break; - } -} |