https://codereview.chromium.org/169533002/diff/1/src/a64/macro-assembler-a64.cc
File src/a64/macro-assembler-a64.cc (right):
https://codereview.chromium.org/169533002/diff/1/src/a64/macro-assembler-a64.cc#newcode651
src/a64/macro-assembler-a64.cc:651: void
MacroAssembler::PushPopQueue::PopQueued() {
On 2014/02/17 12:31:06, rmcilroy wrote:
If I read this right, doing the following would not work:
PushPopQueue queue;
queue.Queue(x0);
queue.Queue(x1);
queue.PushQueued();
... Call function
queue.PopQueued();
That's correct. At the moment, PopQueued() isn't used (other than in the
tests), but I implemented it for completeness anyway.
Both because PushQueued() and PopQueued clear the queued_ field, and
because the
arguments to Pop would need to be given in the reverse order as given
to Push.
Would it be worth enabling this - it could save a load of boilerplate.
(Note: I
found it quite confusing that on arm you do Push(r0, r1), Pop(r0, r1),
but on
a64 the Pop is reversed, e.g.,: Push(x0, x1), Pop(x1, x0) - could we
unify this
to be the same as Arm?)
We made a conscious decision to do things that way. On ARM, the
registers are pushed such that the lowest-indexed register gets the
lowest address. Pop(r0, r1) and Pop(r1, r0) do the same thing (though
there may be a warning in V8). On A64, that isn't the case, and we
wanted the following sequences to be equivalent:
Push(xa);
Push(xb);
Push(xa, xb);
That is, Push and Pop can be split into several calls, but the order of
operations always agrees with reading order. With this scheme, Pop has
to work in the opposite order. It would be easy to make PopQueued()
reverse the list automatically, but it would then operate differently
from Pop(), as you noted.
Does that argument make sense? We spent some time thinking about it when
we started the port but that doesn't mean we can't change things.
https://codereview.chromium.org/169533002/
--
--
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/groups/opt_out.