add width info for comparisons

Comparisons return a 1-bit value, in theory
we could add a Wu1 width for them but I did
not bother and just used Wub. This simply
means that if a frontend generates an extsb
of a comparison result (silly), we will not
generate good code.
This commit is contained in:
Quentin Carbonneaux 2024-05-03 21:48:02 +02:00
parent 1dd22a9b47
commit 620277c004

4
ssa.c
View file

@ -40,7 +40,7 @@ filluse(Fn *fn)
Blk *b;
Phi *p;
Ins *i;
int m, t, tp, w;
int m, t, tp, w, x;
uint a;
Tmp *tmp;
@ -84,6 +84,8 @@ filluse(Fn *fn)
w = Wsb + (i->op - Oloadsb);
if (isext(i->op))
w = Wsb + (i->op - Oextsb);
if (iscmp(i->op, &x, &x))
w = Wub;
if (w == Wsw || w == Wuw)
if (i->cls == Kw)
w = WFull;