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:
parent
1dd22a9b47
commit
620277c004
1 changed files with 3 additions and 1 deletions
4
ssa.c
4
ssa.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue