From cebec4dd4739712530111c6211129ef2ee948c5c Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Mon, 7 Mar 2016 13:46:44 -0500 Subject: add new cast instruction --- lisc/isel.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lisc/isel.c') diff --git a/lisc/isel.c b/lisc/isel.c index 6834d17..2c05b22 100644 --- a/lisc/isel.c +++ b/lisc/isel.c @@ -129,6 +129,13 @@ argcls(Ins *i, int n) return KWIDE(i->cls) ? Kl : Kw; case OSitof: return KWIDE(i->cls) ? Kd : Ks; + case OCast: + switch (i->cls) { + case Kw: return Ks; + case Kl: return Kd; + case Ks: return Kw; + case Kd: return Kl; + } default: if (OCmpw <= i->op && i->op <= OCmpd1) diag("isel: invalid call to argcls"); @@ -295,6 +302,9 @@ sel(Ins i, ANum *an, Fn *fn) case OOr: case OXor: case OXTest: + case OFtosi: + case OSitof: + case OCast: case_OExt: Emit: emiti(i); @@ -373,6 +383,7 @@ flagi(Ins *i0, Ins *i) case OTruncd: case OFtosi: case OSitof: + case OCast: ; } return 0; -- cgit 1.4.1