Title: [173205] trunk/Source/_javascript_Core
Revision
173205
Author
[email protected]
Date
2014-09-03 07:15:09 -0700 (Wed, 03 Sep 2014)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (173204 => 173205)


--- trunk/Source/_javascript_Core/ChangeLog	2014-09-03 12:45:12 UTC (rev 173204)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-09-03 14:15:09 UTC (rev 173205)
@@ -1,3 +1,21 @@
+2014-09-03  Akos Kiss  <[email protected]>
+
+        Don't generate superfluous mov instructions for move immediate on ARM64.
+        https://bugs.webkit.org/show_bug.cgi?id=136435
+
+        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:
+
 2014-09-02  Brian J. Burg  <[email protected]>
 
         LegacyProfiler: remove redundant ProfileNode members and other cleanup

Modified: trunk/Source/_javascript_Core/offlineasm/arm64.rb (173204 => 173205)


--- trunk/Source/_javascript_Core/offlineasm/arm64.rb	2014-09-03 12:45:12 UTC (rev 173204)
+++ trunk/Source/_javascript_Core/offlineasm/arm64.rb	2014-09-03 14:15:09 UTC (rev 173205)
@@ -369,7 +369,7 @@
     [48, 32, 16, 0].each {
         | shift |
         currentValue = (value >> shift) & 0xffff
-        next if currentValue == (isNegative ? 0xffff : 0) and shift != 0
+        next if currentValue == (isNegative ? 0xffff : 0) and (shift != 0 or !first)
         if first
             if isNegative
                 $asm.puts "movn #{target.arm64Operand(:ptr)}, \##{(~currentValue) & 0xffff}, lsl \##{shift}"
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to