On 2014/03/31 17:33:38, Fritz wrote:
I agree that passing register size around is not ideal. But I disagree that changing that will solve this problem. There is one register file that is 64 bits. This can be accessed by both 32 bit op codes and 64 bit op codes. The register access for those 32 bit operations are going to need to read/write to the 64 bit register file because it's shared. So there needs to be some sort
of
memcpy/type pun to accomplish this. [...]

Nope, that's exactly the fallacy behind all our problems: If you are *explicit*
about what you're doing, there is *no need at all* to do some funky casts or
memcpy. Making the register size explicit as a template parameter is achieving
exactly this: The backing store is of course always 64bit, so the 64bit
operations have to do nothing special, while the 32bit operations have to do
some zero/sign-extension. But via template specialization one can easily make
the distinction a compile-time decision. You can even get away without this
template magic by providing 2 operations Foo32 and Foo64 instead of a Foo<size>
template, this is essentially the same as using template specialization for
exactly 2 parameter values.


https://codereview.chromium.org/213943002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to