Commit 2d35d9d7 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: Ied8577c879845777e52867aced16b2b45e06ac6c
Signed-off-by: default avatarSerban Constantinescu <serban.constantinescu@arm.com>
parent 8fff8c66
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment