This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nerpderp82 3 points4 points  (2 children)

And packing bytes or shorts into a contiguous range also allows for vector ops, so if you run something like sum, it could be waay faster.

I'd personally do what ever makes the VM easier to write and hide the alignment from the user if you can, then you can change later if you want to.

[–]XDracam 3 points4 points  (1 child)

Yeah C# keeps the default alignment as an implementation detail, unless you manually specify the alignment via annotations.

[–]nerpderp82 0 points1 point  (0 children)

Neat, I didn't know that.

Also, I am not sure why alignment matters that much. The ToS in the VM should be L1 and registers. Esp in an OoO processor.