]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: updated multiple tests to verify on ppc64,ppc64le
authorArchana R <aravind5@in.ibm.com>
Tue, 14 Jun 2022 14:24:32 +0000 (09:24 -0500)
committerLynn Boger <laboger@linux.vnet.ibm.com>
Wed, 17 Aug 2022 13:56:55 +0000 (13:56 +0000)
Updated multiple tests in test/codegen: math.go, mathbits.go, shift.go
and slices.go to verify on ppc64/ppc64le as well

Change-Id: Id88dd41569b7097819fb4d451b615f69cf7f7a94
Reviewed-on: https://go-review.googlesource.com/c/go/+/412115
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Archana Ravindar <aravind5@in.ibm.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Paul Murphy <murp@ibm.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
test/codegen/math.go
test/codegen/mathbits.go
test/codegen/shift.go
test/codegen/slices.go

index ad154e0c40917f2b6a2501e913991c257496dfdf..7c76d26b386d8c6d1b55b06c42024b37a8d381d1 100644 (file)
@@ -60,6 +60,8 @@ func sqrt(x float64) float64 {
        // mips/hardfloat:"SQRTD" mips/softfloat:-"SQRTD"
        // mips64/hardfloat:"SQRTD" mips64/softfloat:-"SQRTD"
        // wasm:"F64Sqrt"
+       // ppc64le:"FSQRT"
+       // ppc64:"FSQRT"
        return math.Sqrt(x)
 }
 
@@ -71,6 +73,8 @@ func sqrt32(x float32) float32 {
        // mips/hardfloat:"SQRTF" mips/softfloat:-"SQRTF"
        // mips64/hardfloat:"SQRTF" mips64/softfloat:-"SQRTF"
        // wasm:"F32Sqrt"
+       // ppc64le:"FSQRTS"
+       // ppc64:"FSQRTS"
        return float32(math.Sqrt(float64(x)))
 }
 
index 1ddb5c75cc6f4bc29e5669d64ffdb647611f3c00..fe9c4eceb58c10d0f302210db00eb064bc085403 100644 (file)
@@ -19,6 +19,8 @@ func LeadingZeros(n uint) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"CNTLZD"
+       // ppc64:"CNTLZD"
        return bits.LeadingZeros(n)
 }
 
@@ -29,6 +31,8 @@ func LeadingZeros64(n uint64) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"CNTLZD"
+       // ppc64:"CNTLZD"
        return bits.LeadingZeros64(n)
 }
 
@@ -39,6 +43,8 @@ func LeadingZeros32(n uint32) int {
        // arm:"CLZ" arm64:"CLZW"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"CNTLZW"
+       // ppc64:"CNTLZW"
        return bits.LeadingZeros32(n)
 }
 
@@ -49,6 +55,8 @@ func LeadingZeros16(n uint16) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"CNTLZD"
+       // ppc64:"CNTLZD"
        return bits.LeadingZeros16(n)
 }
 
@@ -59,6 +67,8 @@ func LeadingZeros8(n uint8) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"CNTLZD"
+       // ppc64:"CNTLZD"
        return bits.LeadingZeros8(n)
 }
 
@@ -73,6 +83,8 @@ func Len(n uint) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"SUBC","CNTLZD"
+       // ppc64:"SUBC","CNTLZD"
        return bits.Len(n)
 }
 
@@ -113,6 +125,8 @@ func Len16(n uint16) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"SUBC","CNTLZD"
+       // ppc64:"SUBC","CNTLZD"
        return bits.Len16(n)
 }
 
@@ -123,6 +137,8 @@ func Len8(n uint8) int {
        // arm:"CLZ" arm64:"CLZ"
        // mips:"CLZ"
        // wasm:"I64Clz"
+       // ppc64le:"SUBC","CNTLZD"
+       // ppc64:"SUBC","CNTLZD"
        return bits.Len8(n)
 }
 
index b3ed69d9e343015e12541b08656cc515a53326ff..66a5c623915b280a3645356e890f55ed8f55dc03 100644 (file)
@@ -12,46 +12,64 @@ package codegen
 
 func lshConst64x64(v int64) int64 {
        // riscv64:"SLLI",-"AND",-"SLTIU"
+       // ppc64le:"SLD"
+       // ppc64:"SLD"
        return v << uint64(33)
 }
 
 func rshConst64Ux64(v uint64) uint64 {
        // riscv64:"SRLI",-"AND",-"SLTIU"
+       // ppc64le:"SRD"
+       // ppc64:"SRD"
        return v >> uint64(33)
 }
 
 func rshConst64x64(v int64) int64 {
        // riscv64:"SRAI",-"OR",-"SLTIU"
+       // ppc64le:"SRAD"
+       // ppc64:"SRAD"
        return v >> uint64(33)
 }
 
 func lshConst32x64(v int32) int32 {
        // riscv64:"SLLI",-"AND",-"SLTIU"
+       // ppc64le:"SLW"
+       // ppc64:"SLW"
        return v << uint64(29)
 }
 
 func rshConst32Ux64(v uint32) uint32 {
        // riscv64:"SRLI",-"AND",-"SLTIU"
+       // ppc64le:"SRW"
+       // ppc64:"SRW"
        return v >> uint64(29)
 }
 
 func rshConst32x64(v int32) int32 {
        // riscv64:"SRAI",-"OR",-"SLTIU"
+       // ppc64le:"SRAW"
+       // ppc64:"SRAW"
        return v >> uint64(29)
 }
 
 func lshConst64x32(v int64) int64 {
        // riscv64:"SLLI",-"AND",-"SLTIU"
+       // ppc64le:"SLD"
+       // ppc64:"SLD"
        return v << uint32(33)
 }
 
 func rshConst64Ux32(v uint64) uint64 {
        // riscv64:"SRLI",-"AND",-"SLTIU"
+       // ppc64le:"SRD"
+       // ppc64:"SRD"
        return v >> uint32(33)
 }
 
 func rshConst64x32(v int64) int64 {
        // riscv64:"SRAI",-"OR",-"SLTIU"
+       // ppc64le:"SRAD"
+       // ppc64:"SRAD"
        return v >> uint32(33)
 }
 
index 99bdd50e5234e4b46e68b5481944bca1cd38e31a..fa4142d76770ba906ad586bfa8e6f6d3176caa17 100644 (file)
@@ -19,6 +19,8 @@ import "unsafe"
 
 func SliceClear(s []int) []int {
        // amd64:`.*memclrNoHeapPointers`
+       // ppc64le:`.*memclrNoHeapPointers`
+       // ppc64:`.*memclrNoHeapPointers`
        for i := range s {
                s[i] = 0
        }
@@ -27,6 +29,8 @@ func SliceClear(s []int) []int {
 
 func SliceClearPointers(s []*int) []*int {
        // amd64:`.*memclrHasPointers`
+       // ppc64le:`.*memclrHasPointers`
+       // ppc64:`.*memclrHasPointers`
        for i := range s {
                s[i] = nil
        }
@@ -43,6 +47,12 @@ func SliceExtensionConst(s []int) []int {
        // amd64:`.*runtime\.memclrNoHeapPointers`
        // amd64:-`.*runtime\.makeslice`
        // amd64:-`.*runtime\.panicmakeslicelen`
+       // ppc64le:`.*runtime\.memclrNoHeapPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64le:-`.*runtime\.panicmakeslicelen`
+       // ppc64:`.*runtime\.memclrNoHeapPointers`
+       // ppc64:-`.*runtime\.makeslice`
+       // ppc64:-`.*runtime\.panicmakeslicelen`
        return append(s, make([]int, 1<<2)...)
 }
 
@@ -50,6 +60,12 @@ func SliceExtensionConstInt64(s []int) []int {
        // amd64:`.*runtime\.memclrNoHeapPointers`
        // amd64:-`.*runtime\.makeslice`
        // amd64:-`.*runtime\.panicmakeslicelen`
+       // ppc64le:`.*runtime\.memclrNoHeapPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64le:-`.*runtime\.panicmakeslicelen`
+       // ppc64:`.*runtime\.memclrNoHeapPointers`
+       // ppc64:-`.*runtime\.makeslice`
+       // ppc64:-`.*runtime\.panicmakeslicelen`
        return append(s, make([]int, int64(1<<2))...)
 }
 
@@ -57,6 +73,12 @@ func SliceExtensionConstUint64(s []int) []int {
        // amd64:`.*runtime\.memclrNoHeapPointers`
        // amd64:-`.*runtime\.makeslice`
        // amd64:-`.*runtime\.panicmakeslicelen`
+       // ppc64le:`.*runtime\.memclrNoHeapPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64le:-`.*runtime\.panicmakeslicelen`
+       // ppc64:`.*runtime\.memclrNoHeapPointers`
+       // ppc64:-`.*runtime\.makeslice`
+       // ppc64:-`.*runtime\.panicmakeslicelen`
        return append(s, make([]int, uint64(1<<2))...)
 }
 
@@ -64,18 +86,32 @@ func SliceExtensionConstUint(s []int) []int {
        // amd64:`.*runtime\.memclrNoHeapPointers`
        // amd64:-`.*runtime\.makeslice`
        // amd64:-`.*runtime\.panicmakeslicelen`
+       // ppc64le:`.*runtime\.memclrNoHeapPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64le:-`.*runtime\.panicmakeslicelen`
+       // ppc64:`.*runtime\.memclrNoHeapPointers`
+       // ppc64:-`.*runtime\.makeslice`
+       // ppc64:-`.*runtime\.panicmakeslicelen`
        return append(s, make([]int, uint(1<<2))...)
 }
 
 func SliceExtensionPointer(s []*int, l int) []*int {
        // amd64:`.*runtime\.memclrHasPointers`
        // amd64:-`.*runtime\.makeslice`
+       // ppc64le:`.*runtime\.memclrHasPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64:`.*runtime\.memclrHasPointers`
+       // ppc64:-`.*runtime\.makeslice`
        return append(s, make([]*int, l)...)
 }
 
 func SliceExtensionVar(s []byte, l int) []byte {
        // amd64:`.*runtime\.memclrNoHeapPointers`
        // amd64:-`.*runtime\.makeslice`
+       // ppc64le:`.*runtime\.memclrNoHeapPointers`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64:`.*runtime\.memclrNoHeapPointers`
+       // ppc64:-`.*runtime\.makeslice`
        return append(s, make([]byte, l)...)
 }
 
@@ -116,6 +152,12 @@ func SliceMakeCopyLen(s []int) []int {
        // amd64:`.*runtime\.mallocgc`
        // amd64:`.*runtime\.memmove`
        // amd64:-`.*runtime\.makeslice`
+       // ppc64le:`.*runtime\.mallocgc`
+       // ppc64le:`.*runtime\.memmove`
+       // ppc64le:-`.*runtime\.makeslice`
+       // ppc64:`.*runtime\.mallocgc`
+       // ppc64:`.*runtime\.memmove`
+       // ppc64:-`.*runtime\.makeslice`
        a := make([]int, len(s))
        copy(a, s)
        return a
@@ -125,6 +167,12 @@ func SliceMakeCopyLenPtr(s []*int) []*int {
        // amd64:`.*runtime\.makeslicecopy`
        // amd64:-`.*runtime\.makeslice\(`
        // amd64:-`.*runtime\.typedslicecopy
+       // ppc64le:`.*runtime\.makeslicecopy`
+       // ppc64le:-`.*runtime\.makeslice\(`
+       // ppc64le:-`.*runtime\.typedslicecopy
+       // ppc64:`.*runtime\.makeslicecopy`
+       // ppc64:-`.*runtime\.makeslice\(`
+       // ppc64:-`.*runtime\.typedslicecopy
        a := make([]*int, len(s))
        copy(a, s)
        return a