• alexandre.rames@arm.com's avatar
    A64: Let the MacroAssembler resolve branches to distant targets. · 62116e2c
    alexandre.rames@arm.com authored
    Code generation would fail when assembling a branch to a label that is bound
    outside the immediate range of the instruction. A64 is sensitive to this, as the
    various branching instructions have different ranges, going down to +-32KB for
    TBZ/TBNZ.  The MacroAssembler is augmented to handle branches to targets that
    may exceed the immediate range of instructions.
    
    When branching backward to a label exceeding the instruction range, the
    MacroAssembler can simply tweak the generated code to use an unconditional
    branch with a longer range. For example instead of
        B(cond, &label);
    the MacroAssembler can generate:
        b(InvertCondition(cond), &done);
        b(&label);
        bind(&done);
    
    Since the target is not known when the branch is emitted, forward branches uses
    a different mechanism. The MacroAssembler keeps track of forward branches to
    unbound labels. When the code generation approaches the end of the range of a
    branch, a veneer is generated for the branch.
    
    BUG=v8:3148
    LOG=Y
    R=ulan@chromium.org
    
    Review URL: https://codereview.chromium.org/169893002
    
    git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19444 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
    62116e2c
Name
Last commit
Last update
benchmarks Loading commit data...
build Loading commit data...
include Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
Makefile.nacl Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...