w6c+selfhost: principled sub-word signedness (closes #5/#10)
type_isunsigned recurses TY_ENUM and includes TY_RUNE on both stages. 13 LOAD + 6 STORE ladder sites (cstage) plus 4 more wwstage stragglers in cgindex/cgforrange collapsed to fldloadop/fldstoreop helpers. N_CAST narrow gate symmetrised; task #1's literal-kind workaround retired. bool kept out of type_isunsigned, special-cased in field helpers. Retroactively fixes a u32 mis-sign-extend in deref-compound (sz=4 hardcoded MOVSXD), pinned by new 660_field_signed row.
This commit is contained in:
@@ -170,8 +170,10 @@ type_isunsigned(Type *t)
|
||||
switch (t->kind) {
|
||||
case TY_U8: case TY_U16: case TY_U32: case TY_U64:
|
||||
case TY_UINT: case TY_UINTPTR:
|
||||
case TY_RUNE:
|
||||
return 1;
|
||||
case TY_NAMED: return type_isunsigned(t->under);
|
||||
case TY_NAMED: return type_isunsigned(t->under);
|
||||
case TY_ENUM: return type_isunsigned(t->sub);
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user