# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

.class public LSmaliTests;
.super Ljava/lang/Object;

# static fields
.field public static booleanField:Z

.method static constructor <clinit>()V
    .registers 1

    .prologue
    const/4 v0, 0x1

    # booleanField = true
    sput-boolean v0, LSmaliTests;->booleanField:Z

    return-void
.end method

##  CHECK-START: byte SmaliTests.booleanToByte(boolean) builder (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Cond:z\d+>>          Equal [<<Arg>>,<<Zero>>]
##  CHECK-DAG:                            If [<<Cond>>]
##  CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
##  CHECK-DAG:     <<IToS:b\d+>>          TypeConversion [<<Phi>>]
##  CHECK-DAG:                            Return [<<IToS>>]

##  CHECK-START: byte SmaliTests.booleanToByte(boolean) select_generator (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
##  CHECK-DAG:     <<IToS:b\d+>>          TypeConversion [<<Sel>>]
##  CHECK-DAG:                            Return [<<IToS>>]

##  CHECK-START: byte SmaliTests.booleanToByte(boolean) instruction_simplifier$before_codegen (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:                            Return [<<Arg>>]
.method static booleanToByte(Z)B
    .registers 2
    if-eqz p0, :cond_5
    const/4 v0, 0x1

    :goto_3
    int-to-byte v0, v0
    return v0

    :cond_5
    const/4 v0, 0x0
    goto :goto_3
.end method

##  CHECK-START: short SmaliTests.booleanToShort(boolean) builder (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Cond:z\d+>>          Equal [<<Arg>>,<<Zero>>]
##  CHECK-DAG:                            If [<<Cond>>]
##  CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
##  CHECK-DAG:     <<IToS:s\d+>>          TypeConversion [<<Phi>>]
##  CHECK-DAG:                            Return [<<IToS>>]

##  CHECK-START: short SmaliTests.booleanToShort(boolean) select_generator (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
##  CHECK-DAG:     <<IToS:s\d+>>          TypeConversion [<<Sel>>]
##  CHECK-DAG:                            Return [<<IToS>>]

##  CHECK-START: short SmaliTests.booleanToShort(boolean) instruction_simplifier$before_codegen (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:                            Return [<<Arg>>]
.method static booleanToShort(Z)S
    .registers 2
    if-eqz p0, :cond_5
    const/4 v0, 0x1

    :goto_3
    int-to-short v0, v0
    return v0

    :cond_5
    const/4 v0, 0x0
    goto :goto_3
.end method

##  CHECK-START: char SmaliTests.booleanToChar(boolean) builder (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Cond:z\d+>>          Equal [<<Arg>>,<<Zero>>]
##  CHECK-DAG:                            If [<<Cond>>]
##  CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
##  CHECK-DAG:     <<IToC:c\d+>>          TypeConversion [<<Phi>>]
##  CHECK-DAG:                            Return [<<IToC>>]

##  CHECK-START: char SmaliTests.booleanToChar(boolean) select_generator (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
##  CHECK-DAG:     <<IToC:c\d+>>          TypeConversion [<<Sel>>]
##  CHECK-DAG:                            Return [<<IToC>>]

##  CHECK-START: char SmaliTests.booleanToChar(boolean) instruction_simplifier$before_codegen (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:                            Return [<<Arg>>]
.method static booleanToChar(Z)C
    .registers 2
    if-eqz p0, :cond_5
    const/4 v0, 0x1

    :goto_3
    int-to-char v0, v0
    return v0

    :cond_5
    const/4 v0, 0x0
    goto :goto_3
.end method

##  CHECK-START: int SmaliTests.booleanToInt(boolean) builder (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Cond:z\d+>>          Equal [<<Arg>>,<<Zero>>]
##  CHECK-DAG:                            If [<<Cond>>]
##  CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
##  CHECK-DAG:                            Return [<<Phi>>]

##  CHECK-START: int SmaliTests.booleanToInt(boolean) select_generator (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
##  CHECK-DAG:     <<One:i\d+>>           IntConstant 1
##  CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
##  CHECK-DAG:                            Return [<<Sel>>]

##  CHECK-START: int SmaliTests.booleanToInt(boolean) instruction_simplifier$before_codegen (after)
##  CHECK:         <<Arg:z\d+>>           ParameterValue
##  CHECK-DAG:                            Return [<<Arg>>]
.method static booleanToInt(Z)I
    .registers 2
    if-eqz p0, :cond_4
    const/4 v0, 0x1

    :goto_3
    return v0

    :cond_4
    const/4 v0, 0x0
    goto :goto_3
.end method

## CHECK-START: long SmaliTests.booleanToLong(boolean) builder (after)
## CHECK-DAG:     <<Arg:z\d+>>           ParameterValue
## CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
## CHECK-DAG:     <<One:i\d+>>           IntConstant 1
## CHECK-DAG:     <<Cond:z\d+>>          Equal [<<Arg>>,<<Zero>>]
## CHECK-DAG:                            If [<<Cond>>]
## CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
## CHECK-DAG:     <<IToJ:j\d+>>          TypeConversion [<<Phi>>]
## CHECK-DAG:                            Return [<<IToJ>>]

## CHECK-START: long SmaliTests.booleanToLong(boolean) select_generator (after)
## CHECK-DAG:     <<Arg:z\d+>>           ParameterValue
## CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
## CHECK-DAG:     <<One:i\d+>>           IntConstant 1
## CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
## CHECK-DAG:     <<IToJ:j\d+>>          TypeConversion [<<Sel>>]
## CHECK-DAG:                            Return [<<IToJ>>]

## CHECK-START: long SmaliTests.booleanToLong(boolean) instruction_simplifier$before_codegen (after)
## CHECK-DAG:     <<Arg:z\d+>>           ParameterValue
## CHECK-DAG:     <<Zero:j\d+>>          LongConstant 0
## CHECK-DAG:     <<One:j\d+>>           LongConstant 1
## CHECK-DAG:     <<Sel:j\d+>>           Select [<<Zero>>,<<One>>,<<Arg>>]
## CHECK-DAG:                            Return [<<Sel>>]
.method public static booleanToLong(Z)J
    .registers 3
    .param p0, "b"    # Z
    .prologue

    # return b ? 1 : 0;
    if-eqz p0, :b_is_zero

# :b_is_one
    const/4 v0, 0x1

  :l_return
    int-to-long v0, v0
    return-wide v0

  :b_is_zero
    const/4 v0, 0x0
    goto :l_return
.end method

## CHECK-START: int SmaliTests.longToIntOfBoolean() builder (after)
## CHECK-DAG:     <<Sget:z\d+>>          StaticFieldGet
## CHECK-DAG:     <<ZToJ:j\d+>>          InvokeStaticOrDirect [<<Sget>>{{(,[ij]\d+)?}}]
## CHECK-DAG:     <<JToI:i\d+>>          TypeConversion [<<ZToJ>>]
## CHECK-DAG:                            Return [<<JToI>>]

## CHECK-START: int SmaliTests.longToIntOfBoolean() inliner (after)
## CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
## CHECK-DAG:     <<One:i\d+>>           IntConstant 1
## CHECK-DAG:     <<Sget:z\d+>>          StaticFieldGet
## CHECK-DAG:                            If [<<Sget>>]
## CHECK-DAG:     <<Phi:i\d+>>           Phi [<<One>>,<<Zero>>]
## CHECK-DAG:     <<IToJ:j\d+>>          TypeConversion [<<Phi>>]
## CHECK-DAG:     <<JToI:i\d+>>          TypeConversion [<<IToJ>>]
## CHECK-DAG:                            Return [<<JToI>>]

## CHECK-START: int SmaliTests.longToIntOfBoolean() select_generator (after)
## CHECK-DAG:     <<Zero:i\d+>>          IntConstant 0
## CHECK-DAG:     <<One:i\d+>>           IntConstant 1
## CHECK-DAG:     <<Sget:z\d+>>          StaticFieldGet
## CHECK-DAG:     <<Sel:i\d+>>           Select [<<Zero>>,<<One>>,<<Sget>>]
## CHECK-DAG:                            Return [<<Sel>>]

## CHECK-START: int SmaliTests.longToIntOfBoolean() instruction_simplifier$before_codegen (after)
## CHECK-DAG:     <<Sget:z\d+>>          StaticFieldGet
## CHECK-DAG:                            Return [<<Sget>>]
.method public static longToIntOfBoolean()I
    .registers 3
    .prologue

    # long l = booleanToLong(booleanField);
    sget-boolean v2, LSmaliTests;->booleanField:Z
    invoke-static {v2}, LSmaliTests;->booleanToLong(Z)J
    move-result-wide v0

    # return (int) l;
    long-to-int v2, v0
    return v2
.end method
