]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/codegen/bool.go
cmd/compile: avoid ANDCCconst on PPC64 if condition not needed
[gostls13.git] / test / codegen / bool.go
index faf7033a2a4103324aa135087a37be794c682980..109c3aa0cd67734dac72d684a1b775a594102f10 100644 (file)
@@ -10,49 +10,49 @@ package codegen
 
 func convertNeq0B(x uint8, c bool) bool {
        // amd64:"ANDL\t[$]1",-"SETNE"
-       // ppc64x:"ANDCC",-"CMPW",-"ISEL"
+       // ppc64x:"RLDICL",-"CMPW",-"ISEL"
        b := x&1 != 0
        return c && b
 }
 
 func convertNeq0W(x uint16, c bool) bool {
        // amd64:"ANDL\t[$]1",-"SETNE"
-       // ppc64x:"ANDCC",-"CMPW",-"ISEL"
+       // ppc64x:"RLDICL",-"CMPW",-"ISEL"
        b := x&1 != 0
        return c && b
 }
 
 func convertNeq0L(x uint32, c bool) bool {
        // amd64:"ANDL\t[$]1",-"SETB"
-       // ppc64x:"ANDCC",-"CMPW",-"ISEL"
+       // ppc64x:"RLDICL",-"CMPW",-"ISEL"
        b := x&1 != 0
        return c && b
 }
 
 func convertNeq0Q(x uint64, c bool) bool {
        // amd64:"ANDL\t[$]1",-"SETB"
-       // ppc64x:"ANDCC",-"CMP",-"ISEL"
+       // ppc64x:"RLDICL",-"CMP",-"ISEL"
        b := x&1 != 0
        return c && b
 }
 
 func convertNeqBool32(x uint32) bool {
-       // ppc64x:"ANDCC",-"CMPW",-"ISEL"
+       // ppc64x:"RLDICL",-"CMPW",-"ISEL"
        return x&1 != 0
 }
 
 func convertEqBool32(x uint32) bool {
-       // ppc64x:"ANDCC",-"CMPW","XOR",-"ISEL"
+       // ppc64x:"RLDICL",-"CMPW","XOR",-"ISEL"
        return x&1 == 0
 }
 
 func convertNeqBool64(x uint64) bool {
-       // ppc64x:"ANDCC",-"CMP",-"ISEL"
+       // ppc64x:"RLDICL",-"CMP",-"ISEL"
        return x&1 != 0
 }
 
 func convertEqBool64(x uint64) bool {
-       // ppc64x:"ANDCC","XOR",-"CMP",-"ISEL"
+       // ppc64x:"RLDICL","XOR",-"CMP",-"ISEL"
        return x&1 == 0
 }
 
@@ -211,3 +211,11 @@ func TestSetInvGeFp64(x float64, y float64) bool {
        b := !(x >= y)
        return b
 }
+func TestAndCompareZero(x uint64, y uint64) uint64 {
+       // ppc64x:"ANDCC"
+       b := x&3
+       if b!=0 {
+               return b
+       }
+       return b+8
+}