Ignore:
Timestamp:
Sep 3, 2014, 7:15:09 AM (11 years ago)
Author:
[email protected]
Message:

Don't generate superfluous mov instructions for move immediate on ARM64.
https://bugs.webkit.org/show_bug.cgi?id=136435

Patch by Akos Kiss <[email protected]> on 2014-09-03
Reviewed by Michael Saboff.

On ARM64, the size of an immediate operand for a mov instruction is 16
bits. Thus, a move immediate offlineasm instruction may potentially be
split up to several machine level instructions. The current
implementation always emits a mov for the least significant 16 bits of
the value. However, if any of the bits 63:16 are significant then the
first emitted mov already filled bits 15:0 with zeroes (or ones, for
negative values). So, if bits 15:0 of the value are all zeroes (or ones)
then the last mov does not need to be emitted.

  • offlineasm/arm64.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/arm64.rb

    r172429 r173205  
    370370        | shift |
    371371        currentValue = (value >> shift) & 0xffff
    372         next if currentValue == (isNegative ? 0xffff : 0) and shift != 0
     372        next if currentValue == (isNegative ? 0xffff : 0) and (shift != 0 or !first)
    373373        if first
    374374            if isNegative
Note: See TracChangeset for help on using the changeset viewer.