<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>171387</bug_id>
          
          <creation_ts>2017-04-27 12:47:05 -0700</creation_ts>
          <short_desc>AirLowerStackArgs: generate less code for large offsets</short_desc>
          <delta_ts>2017-04-27 12:47:05 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>170215</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="JF Bastien">jfbastien</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fpizlo</cc>
    
    <cc>jfbastien</cc>
    
    <cc>keith_miller</cc>
    
    <cc>mark.lam</cc>
    
    <cc>msaboff</cc>
    
    <cc>saam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1302241</commentid>
    <comment_count>0</comment_count>
    <who name="JF Bastien">jfbastien</who>
    <bug_when>2017-04-27 12:47:05 -0700</bug_when>
    <thetext>As part of bug #170215 I&apos;m teaching AirowerStackArgs to handle large offsets from FP / SP on ARM, because it used to just assert.

We&apos;ll turn code such as:
    Move (spill337), (spill201), %r0, @8735

Into:
    Move $1404, %r16, @8736
    Add64 %sp, %r16, @8736
    Move (%r16), 2032(%sp), %r0, @8736

The code I&apos;m writing for now will be silly and won&apos;t re-use r16 for large offsets even if it could.

This could be generated:
    Move 1416(%sp), 2016(%sp), %r0, @8735
    Move $1404, %r16, @8736
    Add64 %sp, %r16, @8736
    Move (%r16), 2032(%sp), %r0, @8736
    Move 1400(%sp), 2024(%sp), %r0, @8737
    Move 16(%r16), 2160(%sp), %r0, @8738
    Move 360(%r16), 2280(%sp), %r0, @8739
    Move 1376(%sp), 2080(%sp), %r0, @8740
    Move 24(%r16), 2104(%sp), %r0, @8741
    Move 1040(%sp), -208(%fp), %r0, @8742
    Move 1360(%sp), 2200(%sp), %r0, @8743
    Move 8(%r16), 2048(%sp), %r0, @8744
    Move 1048(%sp), -248(%fp), %r0, @8745
    Move 1328(%sp), -200(%fp), %r0, @8746
    Move 1392(%sp), 2176(%sp), %r0, @8747
    Move 1384(%sp), 2088(%sp), %r0, @8748
    Move 32(%r16), 2096(%sp), %r0, @8749
    Move 1344(%sp), 2328(%sp), %r0, @8750
    Move 40(%r16), 2120(%sp), %r0, @8751
    Move 56(%r16), 2240(%sp), %r0, @8752
    Move 1312(%sp), -216(%fp), %r0, @8753
    Move 1320(%sp), -232(%fp), %r0, @8754
    Move 1336(%sp), 2248(%sp), %r0, @8755
    Move 64(%r16), 2224(%sp), %r0, @8756
    Move32 1356(%sp), %r1, @8757

The code simply needs to, per basic block:
 - Track the last offset value generated in r16
 - Invalidate on clobber (dest==r16 or writesPinned calls)
 - If a new offset doesn&apos;t fit in addr, update the tracking value

This isn&apos;t super risky but also isn&apos;t worth doing in #170215.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>