From 2c2db15995ce6c0f362d65e174d5a1b933057b80 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 25 Feb 2017 14:48:15 -0500 Subject: do sign/zero extensions removal in copy.c --- simpl.c | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 simpl.c (limited to 'simpl.c') 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; - } -} -- cgit 1.4.1