cgen: narrow 2-byte deref stores in the wwstage assign arm
The plain `*p = v` arm's storeop map handled 1- and 4-byte pointees but let a 2-byte one fall to MOVQ, an 8-byte over-store that clobbers six adjacent bytes (masked in the pinned fixture by the lone frame slot; loud with `&a[0]` of a [4]i16). cstage fldstoreop maps 2 to MOVW. Graduates r660_i16_out_param_negative.
This commit is contained in:
@@ -8955,7 +8955,8 @@ fn cgassign(c: *cgen, n: *syntax.node) void = {
|
||||
typenodeprimresolved(c, pe, &ps, &uns);
|
||||
};
|
||||
if (ps == 1) { storeop = "MOVB"; }
|
||||
else { if (ps == 4) { storeop = "MOVL"; }; };
|
||||
else { if (ps == 2) { storeop = "MOVW"; }
|
||||
else { if (ps == 4) { storeop = "MOVL"; }; }; };
|
||||
}; }; };
|
||||
};
|
||||
// A slice IS the same 3-word {ptr,len,cap}
|
||||
|
||||
Reference in New Issue
Block a user