mirror of
https://github.com/golang/go
synced 2025-06-15 17:41:45 +00:00
cmd/asm,cmd/compile: support 5 operand RLWNM/RLWMI on ppc64
These instructions are actually 5 argument opcodes as specified by the ISA. Prior to this patch, the MB and ME arguments were merged into a single bitmask operand to workaround the limitations of the ppc64 assembler backend. This limitation no longer exists. Thus, we can pass operands for these opcodes without having to merge the MB and ME arguments in the assembler frontend or compiler backend. Likewise, support for 4 operand variants is unchanged. Change-Id: Ib086774f3581edeaadfd2190d652aaaa8a90daeb Reviewed-on: https://go-review.googlesource.com/c/go/+/298750 Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Carlos Eduardo Seo <carlos.seo@linaro.org> Trust: Carlos Eduardo Seo <carlos.seo@linaro.org>
This commit is contained in:
committed by
Lynn Boger
parent
18510ae88f
commit
48ddf70128
@ -240,12 +240,12 @@ func checkWidenAfterShift(v int64, u uint64) (int64, uint64) {
|
||||
func checkShiftAndMask32(v []uint32) {
|
||||
i := 0
|
||||
|
||||
// ppc64le: "RLWNM\t[$]24, R[0-9]+, [$]1044480, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]24, R[0-9]+, [$]1044480, R[0-9]+"
|
||||
// ppc64le: "RLWNM\t[$]24, R[0-9]+, [$]12, [$]19, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]24, R[0-9]+, [$]12, [$]19, R[0-9]+"
|
||||
v[i] = (v[i] & 0xFF00000) >> 8
|
||||
i++
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]1020, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]1020, R[0-9]+"
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]22, [$]29, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]22, [$]29, R[0-9]+"
|
||||
v[i] = (v[i] & 0xFF00) >> 6
|
||||
i++
|
||||
// ppc64le: "MOVW\tR0"
|
||||
@ -256,12 +256,12 @@ func checkShiftAndMask32(v []uint32) {
|
||||
// ppc64: "MOVW\tR0"
|
||||
v[i] = (v[i] & 0xF000000) >> 28
|
||||
i++
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]255, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]255, R[0-9]+"
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]24, [$]31, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]24, [$]31, R[0-9]+"
|
||||
v[i] = (v[i] >> 6) & 0xFF
|
||||
i++
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]1044480, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]1044480, R[0-9]+"
|
||||
// ppc64le: "RLWNM\t[$]26, R[0-9]+, [$]12, [$]19, R[0-9]+"
|
||||
// ppc64: "RLWNM\t[$]26, R[0-9]+, [$]12, [$]19, R[0-9]+"
|
||||
v[i] = (v[i] >> 6) & 0xFF000
|
||||
i++
|
||||
// ppc64le: "MOVW\tR0"
|
||||
@ -275,16 +275,16 @@ func checkShiftAndMask32(v []uint32) {
|
||||
}
|
||||
|
||||
func checkMergedShifts32(a [256]uint32, b [256]uint64, u uint32, v uint32) {
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]10, R[0-9]+, [$]1020, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]10, R[0-9]+, [$]1020, R[0-9]+"
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]10, R[0-9]+, [$]22, [$]29, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]10, R[0-9]+, [$]22, [$]29, R[0-9]+"
|
||||
a[0] = a[uint8(v>>24)]
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]11, R[0-9]+, [$]2040, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]11, R[0-9]+, [$]2040, R[0-9]+"
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]11, R[0-9]+, [$]21, [$]28, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]11, R[0-9]+, [$]21, [$]28, R[0-9]+"
|
||||
b[0] = b[uint8(v>>24)]
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]15, R[0-9]+, [$]2040, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]15, R[0-9]+, [$]2040, R[0-9]+"
|
||||
//ppc64le: -"CLRLSLDI", "RLWNM\t[$]15, R[0-9]+, [$]21, [$]28, R[0-9]+"
|
||||
//ppc64: -"CLRLSLDI", "RLWNM\t[$]15, R[0-9]+, [$]21, [$]28, R[0-9]+"
|
||||
b[1] = b[(v>>20)&0xFF]
|
||||
//ppc64le: -"SLD", "RLWNM\t[$]10, R[0-9]+, [$]1016, R[0-9]+"
|
||||
//ppc64: -"SLD", "RLWNM\t[$]10, R[0-9]+, [$]1016, R[0-9]+"
|
||||
//ppc64le: -"SLD", "RLWNM\t[$]10, R[0-9]+, [$]22, [$]28, R[0-9]+"
|
||||
//ppc64: -"SLD", "RLWNM\t[$]10, R[0-9]+, [$]22, [$]28, R[0-9]+"
|
||||
b[2] = b[v>>25]
|
||||
}
|
||||
|
Reference in New Issue
Block a user