]> Cypherpunks repositories - gostls13.git/commitdiff
test/codegen: port arm64 BIC/EON/ORN and masking tests
authorAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 10 Apr 2018 09:20:20 +0000 (11:20 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 10 Apr 2018 10:57:50 +0000 (10:57 +0000)
And delete them from asm_test.

Change-Id: I24f421b87e8cb4770c887a6dfd58eacd0088947d
Reviewed-on: https://go-review.googlesource.com/106056
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/asm_test.go
test/codegen/bits.go

index a23e958995b78071a7dcc47aadab9b796c917499..1b7c94837f48e875637b972ff8c8b45b2133b782 100644 (file)
@@ -283,49 +283,6 @@ var linuxARMTests = []*asmTest{
 }
 
 var linuxARM64Tests = []*asmTest{
-       {
-               fn: `
-               func $(x, y uint32) uint32 {
-                       return x &^ y
-               }
-               `,
-               pos: []string{"\tBIC\t"},
-               neg: []string{"\tAND\t"},
-       },
-       {
-               fn: `
-               func $(x, y uint32) uint32 {
-                       return x ^ ^y
-               }
-               `,
-               pos: []string{"\tEON\t"},
-               neg: []string{"\tXOR\t"},
-       },
-       {
-               fn: `
-               func $(x, y uint32) uint32 {
-                       return x | ^y
-               }
-               `,
-               pos: []string{"\tORN\t"},
-               neg: []string{"\tORR\t"},
-       },
-       {
-               fn: `
-               func f34(a uint64) uint64 {
-                       return a & ((1<<63)-1)
-               }
-               `,
-               pos: []string{"\tAND\t"},
-       },
-       {
-               fn: `
-               func f35(a uint64) uint64 {
-                       return a & (1<<63)
-               }
-               `,
-               pos: []string{"\tAND\t"},
-       },
        // Load-combining tests.
        {
                fn: `
index 53f03094d746dff4bfef050c7fef14779ffed974..9de2201cb1b2a4adf6a19ca85dbc34d2077c0617 100644 (file)
@@ -261,3 +261,32 @@ func bitcompl32(a, b uint32) (n uint32) {
 
        return n
 }
+
+// Check AND masking on arm64 (Issue #19857)
+
+func and_mask_1(a uint64) uint64 {
+       // arm64:`AND\t`
+       return a & ((1 << 63) - 1)
+}
+
+func and_mask_2(a uint64) uint64 {
+       // arm64:`AND\t`
+       return a & (1 << 63)
+}
+
+// Check generation of arm64 BIC/EON/ORN instructions
+
+func op_bic(x, y uint32) uint32 {
+       // arm64:`BIC\t`,-`AND`
+       return x &^ y
+}
+
+func op_eon(x, y uint32) uint32 {
+       // arm64:`EON\t`,-`XOR`
+       return x ^ ^y
+}
+
+func op_orn(x, y uint32) uint32 {
+       // arm64:`ORN\t`,-`ORR`
+       return x | ^y
+}