mirror of
https://github.com/golang/go
synced 2024-11-11 21:50:21 -07:00
test/codegen: add more combined store tests for arm64
Some combined store optimization was already implemented in go-1.11, but there is no corresponding test cases. Change-Id: Iebdad186e92047942e53a74f2c20b390922e1e9c Reviewed-on: https://go-review.googlesource.com/122915 Run-TryBot: Ben Shi <powerman1st@163.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
a7df7b9cdb
commit
de0e72610b
@ -402,12 +402,66 @@ func store_be16_idx(b []byte, idx int) {
|
||||
binary.BigEndian.PutUint16(b[idx:], sink16)
|
||||
}
|
||||
|
||||
func store_le_byte_2(b []byte, val uint16) {
|
||||
_ = b[2]
|
||||
// arm64:`MOVH\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`
|
||||
b[1], b[2] = byte(val), byte(val>>8)
|
||||
}
|
||||
|
||||
func store_le_byte_4(b []byte, val uint32) {
|
||||
_ = b[4]
|
||||
// arm64:`MOVW\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`,-`MOVH`
|
||||
b[1], b[2], b[3], b[4] = byte(val), byte(val>>8), byte(val>>16), byte(val>>24)
|
||||
}
|
||||
|
||||
func store_le_byte_8(b []byte, val uint64) {
|
||||
_ = b[8]
|
||||
// arm64:`MOVD\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`,-`MOVH`,-`MOVW`
|
||||
b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8] = byte(val), byte(val>>8), byte(val>>16), byte(val>>24), byte(val>>32), byte(val>>40), byte(val>>48), byte(val>>56)
|
||||
}
|
||||
|
||||
func store_be_byte_2(b []byte, val uint16) {
|
||||
_ = b[2]
|
||||
// arm64:`REV16W`,`MOVH\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`
|
||||
b[1], b[2] = byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_be_byte_4(b []byte, val uint32) {
|
||||
_ = b[4]
|
||||
// arm64:`REVW`,`MOVW\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`,-`MOVH`,-`REV16W`
|
||||
b[1], b[2], b[3], b[4] = byte(val>>24), byte(val>>16), byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_be_byte_8(b []byte, val uint64) {
|
||||
_ = b[8]
|
||||
// arm64:`REV`,`MOVD\sR[0-9]+,\s1\(R[0-9]+\)`,-`MOVB`,-`MOVH`,-`MOVW`,-`REV16W`,-`REVW`
|
||||
b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8] = byte(val>>56), byte(val>>48), byte(val>>40), byte(val>>32), byte(val>>24), byte(val>>16), byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_le_byte_2_idx(b []byte, idx int, val uint16) {
|
||||
_, _ = b[idx+0], b[idx+1]
|
||||
// arm64:`MOVH\sR[0-9]+,\s\(R[0-9]+\)\(R[0-9]+\)`,-`MOVB`
|
||||
b[idx+1], b[idx+0] = byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_le_byte_4_idx(b []byte, idx int, val uint32) {
|
||||
_, _, _, _ = b[idx+0], b[idx+1], b[idx+2], b[idx+3]
|
||||
// arm64:`MOVW\sR[0-9]+,\s\(R[0-9]+\)\(R[0-9]+\)`,-`MOVB`,-`MOVH`
|
||||
b[idx+3], b[idx+2], b[idx+1], b[idx+0] = byte(val>>24), byte(val>>16), byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_be_byte_2_idx(b []byte, idx int, val uint16) {
|
||||
_, _ = b[idx+0], b[idx+1]
|
||||
// arm64:`REV16W`,`MOVH\sR[0-9]+,\s\(R[0-9]+\)\(R[0-9]+\)`,-`MOVB`
|
||||
b[idx+0], b[idx+1] = byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_be_byte_4_idx(b []byte, idx int, val uint32) {
|
||||
_, _, _, _ = b[idx+0], b[idx+1], b[idx+2], b[idx+3]
|
||||
// arm64:`REVW`,`MOVW\sR[0-9]+,\s\(R[0-9]+\)\(R[0-9]+\)`,-`MOVB`,-`MOVH`,-`REV16W`
|
||||
b[idx+0], b[idx+1], b[idx+2], b[idx+3] = byte(val>>24), byte(val>>16), byte(val>>8), byte(val)
|
||||
}
|
||||
|
||||
func store_be_byte_2_idx2(b []byte, idx int, val uint16) {
|
||||
_, _ = b[(idx<<1)+0], b[(idx<<1)+1]
|
||||
// arm64:`REV16W`,`MOVH\sR[0-9]+,\s\(R[0-9]+\)\(R[0-9]+<<1\)`,-`MOVB`
|
||||
|
Loading…
Reference in New Issue
Block a user