You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stack is bigger; first we MOVUPS a bunch of zeros to 48/64/80(SP), then we call DUFFCOPY to move them again to (SP). This seems wasteful. Even if we cross the multiple-MOVs/DUFF threshold, it seems it would be possible to just DUFFZERO at (SP), essentially the thing the first snippet does.
This also happen when there's no zeroing going on. For example, for struct { a, b, c, d int64}, when initialized as t = {1, 2, 3, 4}, the values are moved directly to (SP), but for struct { a, b, c, d, e int64}, which is bigger than 32bytes, they aren't. There are 5 moves high into the stack and then a DUFFCOPY call moves them to (SP).
The text was updated successfully, but these errors were encountered:
This is a special case of the more general problem that large structs (> 4 words) aren't handled efficiently.
It is on my radar, and I've even attempted a CL. But I don't like my solution yet.
@randall77 thanks. I'll let you decide if it's worth keeping this open to track the issue or it's not really necessary, since the general problem is known, and we can close this.
generates
but when
The stack is bigger; first we
MOVUPS
a bunch of zeros to48/64/80(SP)
, then we callDUFFCOPY
to move them again to (SP). This seems wasteful. Even if we cross the multiple-MOVs/DUFF threshold, it seems it would be possible to justDUFFZERO
at(SP)
, essentially the thing the first snippet does.This also happen when there's no zeroing going on. For example, for
struct { a, b, c, d int64}
, when initialized ast = {1, 2, 3, 4}
, the values are moved directly to(SP)
, but forstruct { a, b, c, d, e int64}
, which is bigger than 32bytes, they aren't. There are 5 moves high into the stack and then aDUFFCOPY
call moves them to(SP)
.The text was updated successfully, but these errors were encountered: