diff options
| author | Quentin Carbonneaux <[email protected]> | 2024-05-03 21:48:02 +0200 |
|---|---|---|
| committer | Quentin Carbonneaux <[email protected]> | 2024-05-03 21:51:30 +0200 |
| commit | 620277c004b247559d53e4d6ef8053705be9b110 (patch) | |
| tree | 7ff2c50b850dd363083b007fa9caf0737011decb | |
| parent | 1dd22a9b4741b668e9d63a98c95a102dc456634b (diff) | |
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.
| -rw-r--r-- | ssa.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |
