Commit e30aa166 authored by Lynn Boger's avatar Lynn Boger

test: enable more memcombine tests for ppc64le

This enables more of the testcases in memcombine for ppc64le,
and adds more detail to some existing.

Change-Id: Ic522a1175bed682b546909c96f9ea758f8db247c
Reviewed-on: https://go-review.googlesource.com/c/go/+/174737Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b39daa7a
...@@ -40,7 +40,7 @@ func load_le32(b []byte) { ...@@ -40,7 +40,7 @@ func load_le32(b []byte) {
// 386:`MOVL\s\(.*\),`,-`MOV[BW]`,-`OR` // 386:`MOVL\s\(.*\),`,-`MOV[BW]`,-`OR`
// s390x:`MOVWBR\s\(.*\),` // s390x:`MOVWBR\s\(.*\),`
// arm64:`MOVWU\s\(R[0-9]+\),`,-`MOV[BH]` // arm64:`MOVWU\s\(R[0-9]+\),`,-`MOV[BH]`
// ppc64le:`MOVWZ\s` // ppc64le:`MOVWZ\s`,-`MOV[BH]Z\s`
sink32 = binary.LittleEndian.Uint32(b) sink32 = binary.LittleEndian.Uint32(b)
} }
...@@ -49,20 +49,20 @@ func load_le32_idx(b []byte, idx int) { ...@@ -49,20 +49,20 @@ func load_le32_idx(b []byte, idx int) {
// 386:`MOVL\s\(.*\)\(.*\*1\),`,-`MOV[BW]`,-`OR` // 386:`MOVL\s\(.*\)\(.*\*1\),`,-`MOV[BW]`,-`OR`
// s390x:`MOVWBR\s\(.*\)\(.*\*1\),` // s390x:`MOVWBR\s\(.*\)\(.*\*1\),`
// arm64:`MOVWU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[BH]` // arm64:`MOVWU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[BH]`
// ppc64le:`MOVWZ\s` // ppc64le:`MOVWZ\s`,-`MOV[BH]Z\s`
sink32 = binary.LittleEndian.Uint32(b[idx:]) sink32 = binary.LittleEndian.Uint32(b[idx:])
} }
func load_le16(b []byte) { func load_le16(b []byte) {
// amd64:`MOVWLZX\s\(.*\),`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\(.*\),`,-`MOVB`,-`OR`
// ppc64le:`MOVHZ\s` // ppc64le:`MOVHZ\s`,-`MOVBZ`
// arm64:`MOVHU\s\(R[0-9]+\),`,-`MOVB` // arm64:`MOVHU\s\(R[0-9]+\),`,-`MOVB`
sink16 = binary.LittleEndian.Uint16(b) sink16 = binary.LittleEndian.Uint16(b)
} }
func load_le16_idx(b []byte, idx int) { func load_le16_idx(b []byte, idx int) {
// amd64:`MOVWLZX\s\(.*\),`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\(.*\),`,-`MOVB`,-`OR`
// ppc64le:`MOVHZ\s` // ppc64le:`MOVHZ\s`,-`MOVBZ`
// arm64:`MOVHU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOVB` // arm64:`MOVHU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOVB`
sink16 = binary.LittleEndian.Uint16(b[idx:]) sink16 = binary.LittleEndian.Uint16(b[idx:])
} }
...@@ -71,7 +71,7 @@ func load_be64(b []byte) { ...@@ -71,7 +71,7 @@ func load_be64(b []byte) {
// amd64:`BSWAPQ`,-`MOV[BWL]\t[^$]`,-`OR` // amd64:`BSWAPQ`,-`MOV[BWL]\t[^$]`,-`OR`
// s390x:`MOVD\s\(.*\),` // s390x:`MOVD\s\(.*\),`
// arm64:`REV`,`MOVD\s\(R[0-9]+\),`,-`MOV[BHW]`,-`REVW`,-`REV16W` // arm64:`REV`,`MOVD\s\(R[0-9]+\),`,-`MOV[BHW]`,-`REVW`,-`REV16W`
// ppc64le:`MOVDBR` // ppc64le:`MOVDBR`,-`MOV[BHW]Z`
sink64 = binary.BigEndian.Uint64(b) sink64 = binary.BigEndian.Uint64(b)
} }
...@@ -79,7 +79,7 @@ func load_be64_idx(b []byte, idx int) { ...@@ -79,7 +79,7 @@ func load_be64_idx(b []byte, idx int) {
// amd64:`BSWAPQ`,-`MOV[BWL]\t[^$]`,-`OR` // amd64:`BSWAPQ`,-`MOV[BWL]\t[^$]`,-`OR`
// s390x:`MOVD\s\(.*\)\(.*\*1\),` // s390x:`MOVD\s\(.*\)\(.*\*1\),`
// arm64:`REV`,`MOVD\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[WHB]`,-`REVW`,-`REV16W` // arm64:`REV`,`MOVD\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[WHB]`,-`REVW`,-`REV16W`
// ppc64le:`MOVDBR` // ppc64le:`MOVDBR`,-`MOV[BHW]Z`
sink64 = binary.BigEndian.Uint64(b[idx:]) sink64 = binary.BigEndian.Uint64(b[idx:])
} }
...@@ -87,7 +87,7 @@ func load_be32(b []byte) { ...@@ -87,7 +87,7 @@ func load_be32(b []byte) {
// amd64:`BSWAPL`,-`MOV[BW]`,-`OR` // amd64:`BSWAPL`,-`MOV[BW]`,-`OR`
// s390x:`MOVWZ\s\(.*\),` // s390x:`MOVWZ\s\(.*\),`
// arm64:`REVW`,`MOVWU\s\(R[0-9]+\),`,-`MOV[BH]`,-`REV16W` // arm64:`REVW`,`MOVWU\s\(R[0-9]+\),`,-`MOV[BH]`,-`REV16W`
// ppc64le:`MOVWBR` // ppc64le:`MOVWBR`,-`MOV[BH]Z`
sink32 = binary.BigEndian.Uint32(b) sink32 = binary.BigEndian.Uint32(b)
} }
...@@ -95,7 +95,7 @@ func load_be32_idx(b []byte, idx int) { ...@@ -95,7 +95,7 @@ func load_be32_idx(b []byte, idx int) {
// amd64:`BSWAPL`,-`MOV[BW]`,-`OR` // amd64:`BSWAPL`,-`MOV[BW]`,-`OR`
// s390x:`MOVWZ\s\(.*\)\(.*\*1\),` // s390x:`MOVWZ\s\(.*\)\(.*\*1\),`
// arm64:`REVW`,`MOVWU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[HB]`,-`REV16W` // arm64:`REVW`,`MOVWU\s\(R[0-9]+\)\(R[0-9]+\),`,-`MOV[HB]`,-`REV16W`
// ppc64le:`MOVWBR` // ppc64le:`MOVWBR`,-`MOV[BH]Z`
sink32 = binary.BigEndian.Uint32(b[idx:]) sink32 = binary.BigEndian.Uint32(b[idx:])
} }
...@@ -117,6 +117,7 @@ func load_le_byte2_uint16(s []byte) uint16 { ...@@ -117,6 +117,7 @@ func load_le_byte2_uint16(s []byte) uint16 {
// arm64:`MOVHU\t\(R[0-9]+\)`,-`ORR`,-`MOVB` // arm64:`MOVHU\t\(R[0-9]+\)`,-`ORR`,-`MOVB`
// 386:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // 386:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// ppc64le:`MOVHZ\t\(R[0-9]+\)`,-`MOVBZ`
return uint16(s[0]) | uint16(s[1])<<8 return uint16(s[0]) | uint16(s[1])<<8
} }
...@@ -124,6 +125,7 @@ func load_le_byte2_uint16_inv(s []byte) uint16 { ...@@ -124,6 +125,7 @@ func load_le_byte2_uint16_inv(s []byte) uint16 {
// arm64:`MOVHU\t\(R[0-9]+\)`,-`ORR`,-`MOVB` // arm64:`MOVHU\t\(R[0-9]+\)`,-`ORR`,-`MOVB`
// 386:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // 386:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// ppc64le:`MOVHZ\t\(R[0-9]+\)`,-`MOVDZ`
return uint16(s[1])<<8 | uint16(s[0]) return uint16(s[1])<<8 | uint16(s[0])
} }
...@@ -131,6 +133,7 @@ func load_le_byte4_uint32(s []byte) uint32 { ...@@ -131,6 +133,7 @@ func load_le_byte4_uint32(s []byte) uint32 {
// arm64:`MOVWU\t\(R[0-9]+\)`,-`ORR`,-`MOV[BH]` // arm64:`MOVWU\t\(R[0-9]+\)`,-`ORR`,-`MOV[BH]`
// 386:`MOVL\s\([A-Z]+\)`,-`MOV[BW]`,-`OR` // 386:`MOVL\s\([A-Z]+\)`,-`MOV[BW]`,-`OR`
// amd64:`MOVL\s\([A-Z]+\)`,-`MOV[BW]`,-`OR` // amd64:`MOVL\s\([A-Z]+\)`,-`MOV[BW]`,-`OR`
// ppc64le:`MOVWZ\t\(R[0-9]+\)`,-`MOV[BH]Z`
return uint32(s[0]) | uint32(s[1])<<8 | uint32(s[2])<<16 | uint32(s[3])<<24 return uint32(s[0]) | uint32(s[1])<<8 | uint32(s[2])<<16 | uint32(s[3])<<24
} }
...@@ -142,6 +145,7 @@ func load_le_byte4_uint32_inv(s []byte) uint32 { ...@@ -142,6 +145,7 @@ func load_le_byte4_uint32_inv(s []byte) uint32 {
func load_le_byte8_uint64(s []byte) uint64 { func load_le_byte8_uint64(s []byte) uint64 {
// arm64:`MOVD\t\(R[0-9]+\)`,-`ORR`,-`MOV[BHW]` // arm64:`MOVD\t\(R[0-9]+\)`,-`ORR`,-`MOV[BHW]`
// amd64:`MOVQ\s\([A-Z]+\),\s[A-Z]+`,-`MOV[BWL]\t[^$]`,-`OR` // amd64:`MOVQ\s\([A-Z]+\),\s[A-Z]+`,-`MOV[BWL]\t[^$]`,-`OR`
// ppc64le:`MOVD\t\(R[0-9]+\)`,-`MOV[BHW]Z`
return uint64(s[0]) | uint64(s[1])<<8 | uint64(s[2])<<16 | uint64(s[3])<<24 | uint64(s[4])<<32 | uint64(s[5])<<40 | uint64(s[6])<<48 | uint64(s[7])<<56 return uint64(s[0]) | uint64(s[1])<<8 | uint64(s[2])<<16 | uint64(s[3])<<24 | uint64(s[4])<<32 | uint64(s[5])<<40 | uint64(s[6])<<48 | uint64(s[7])<<56
} }
...@@ -153,12 +157,14 @@ func load_le_byte8_uint64_inv(s []byte) uint64 { ...@@ -153,12 +157,14 @@ func load_le_byte8_uint64_inv(s []byte) uint64 {
func load_be_byte2_uint16(s []byte) uint16 { func load_be_byte2_uint16(s []byte) uint16 {
// arm64:`MOVHU\t\(R[0-9]+\)`,`REV16W`,-`ORR`,-`MOVB` // arm64:`MOVHU\t\(R[0-9]+\)`,`REV16W`,-`ORR`,-`MOVB`
// amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// ppc64le:`MOVHBR\t\(R[0-9]+\)`,-`MOVBZ`
return uint16(s[0])<<8 | uint16(s[1]) return uint16(s[0])<<8 | uint16(s[1])
} }
func load_be_byte2_uint16_inv(s []byte) uint16 { func load_be_byte2_uint16_inv(s []byte) uint16 {
// arm64:`MOVHU\t\(R[0-9]+\)`,`REV16W`,-`ORR`,-`MOVB` // arm64:`MOVHU\t\(R[0-9]+\)`,`REV16W`,-`ORR`,-`MOVB`
// amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR` // amd64:`MOVWLZX\s\([A-Z]+\)`,-`MOVB`,-`OR`
// ppc64le:`MOVHBR\t\(R[0-9]+\)`,-`MOVBZ`
return uint16(s[1]) | uint16(s[0])<<8 return uint16(s[1]) | uint16(s[0])<<8
} }
...@@ -175,12 +181,14 @@ func load_be_byte4_uint32_inv(s []byte) uint32 { ...@@ -175,12 +181,14 @@ func load_be_byte4_uint32_inv(s []byte) uint32 {
func load_be_byte8_uint64(s []byte) uint64 { func load_be_byte8_uint64(s []byte) uint64 {
// arm64:`MOVD\t\(R[0-9]+\)`,`REV`,-`ORR`,-`REVW`,-`REV16W`,-`MOV[BHW]` // arm64:`MOVD\t\(R[0-9]+\)`,`REV`,-`ORR`,-`REVW`,-`REV16W`,-`MOV[BHW]`
// ppc64le:`MOVDBR\t\(R[0-9]+\)`,-`MOV[BHW]Z`
return uint64(s[0])<<56 | uint64(s[1])<<48 | uint64(s[2])<<40 | uint64(s[3])<<32 | uint64(s[4])<<24 | uint64(s[5])<<16 | uint64(s[6])<<8 | uint64(s[7]) return uint64(s[0])<<56 | uint64(s[1])<<48 | uint64(s[2])<<40 | uint64(s[3])<<32 | uint64(s[4])<<24 | uint64(s[5])<<16 | uint64(s[6])<<8 | uint64(s[7])
} }
func load_be_byte8_uint64_inv(s []byte) uint64 { func load_be_byte8_uint64_inv(s []byte) uint64 {
// arm64:`MOVD\t\(R[0-9]+\)`,`REV`,-`ORR`,-`REVW`,-`REV16W`,-`MOV[BHW]` // arm64:`MOVD\t\(R[0-9]+\)`,`REV`,-`ORR`,-`REVW`,-`REV16W`,-`MOV[BHW]`
// amd64:`MOVQ\s\([A-Z]+\),\s[A-Z]+`,-`MOV[BWL]\t[^$]`,-`OR` // amd64:`MOVQ\s\([A-Z]+\),\s[A-Z]+`,-`MOV[BWL]\t[^$]`,-`OR`
// ppc64le:`MOVDBR\t\(R[0-9]+\)`,-`MOV[BHW]Z`
return uint64(s[7]) | uint64(s[6])<<8 | uint64(s[5])<<16 | uint64(s[4])<<24 | uint64(s[3])<<32 | uint64(s[2])<<40 | uint64(s[1])<<48 | uint64(s[0])<<56 return uint64(s[7]) | uint64(s[6])<<8 | uint64(s[5])<<16 | uint64(s[4])<<24 | uint64(s[3])<<32 | uint64(s[2])<<40 | uint64(s[1])<<48 | uint64(s[0])<<56
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment