Commit 758c2f65 authored by Serban Constantinescu's avatar Serban Constantinescu
Browse files

Opt Compiler: Materialise constants that cannot be encoded



The VIXL MacroAssembler deals gracefully with any immediate. However
when the constant has multiple uses and cannot be encoded in the
instruction's immediate field we are better off using a register for
the constant and thus sharing the constant generation between multiple
uses.

Eg:
  var += #Const;    // #Const cannot be encoded.
  var += #Const;

Before:                 After:
  mov wip0, #Const        mov w4, #Const
  add w0, w0, wip0        add w0, w0, w4
  mov wip0, #Const        add w0, w0, w4
  add w0, w0, wip0

Change-Id: I8d1f620872d1241cf582fb4f3b45b5091b790146
Signed-off-by: default avatarSerban Constantinescu <serban.constantinescu@arm.com>
parent 63745578
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment