Home | History | Annotate | Download | only in smali
      1 # Copyright (C) 2016 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 .class public LIrreducibleLoop;
     16 
     17 .super Ljava/lang/Object;
     18 
     19 # Check that on x86 we don't crash because irreducible loops
     20 # disabled the constant pool optimization.
     21 .method public static test1(IF)F
     22    .registers 5
     23    const/16 v0, 1
     24    const/16 v1, 42
     25 
     26    if-nez p0, :loop_entry
     27    goto :other_loop_pre_entry
     28 
     29    # The then part: beginning of the irreducible loop.
     30    :loop_entry
     31    if-eqz p0, :exit
     32    add-float v2, p1, v1
     33    sub-float v2, v2, v1
     34    div-float v2, v2, v1
     35    mul-float v2, v2, v1
     36    :other_loop_entry
     37    sub-int p0, p0, v0
     38    goto :loop_entry
     39 
     40    # The other block branching to the irreducible loop.
     41    # In that block, v4 has no live range.
     42    :other_loop_pre_entry
     43    goto :other_loop_entry
     44 
     45    :exit
     46    return v1
     47 .end method
     48