diff options
author | fanzha02 <fannie.zhang@arm.com> | 2020-05-14 17:01:11 +0800 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2020-08-24 14:38:38 +0000 |
commit | 85902b6786bbe40b297cbbf823f489b07c654bbd (patch) | |
tree | 6b7eabd4cdffc97c1af52a680e42b5cd1f100294 /src/cmd/compile/internal/ssa/value.go | |
parent | 0e031676288ddd56fb410b6b27807a180a585db3 (diff) | |
download | go-85902b6786bbe40b297cbbf823f489b07c654bbd.tar.gz go-85902b6786bbe40b297cbbf823f489b07c654bbd.zip |
cmd/compile: convert rest ARM64.rules lines to typed aux mode
This patch adds the ARM6464Bitfield auxInt to auxIntType() and
returns its Go type as "arm64Bitfield" type, which is defined
as int16 type.
And the Go type of SymOff auxInt is int32, but some functions
(such as min(), areAdjacentOffsets() and read16/32/64(),etc.)
use SymOff as an input parameter and treat its type as int64,
this patch adds the type conversion for these rules.
Passes toolstash-check -all.
Change-Id: Ib234b48d0a97ef244dd37878e06b5825316dd782
Reviewed-on: https://go-review.googlesource.com/c/go/+/234378
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/value.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/value.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go index 63c8f3decf..7ead0ff300 100644 --- a/src/cmd/compile/internal/ssa/value.go +++ b/src/cmd/compile/internal/ssa/value.go @@ -126,6 +126,13 @@ func (v *Value) AuxValAndOff() ValAndOff { return ValAndOff(v.AuxInt) } +func (v *Value) AuxArm64BitField() arm64BitField { + if opcodeTable[v.Op].auxType != auxARM64BitField { + v.Fatalf("op %s doesn't have a ValAndOff aux field", v.Op) + } + return arm64BitField(v.AuxInt) +} + // long form print. v# = opcode <type> [aux] args [: reg] (names) func (v *Value) LongString() string { s := fmt.Sprintf("v%d = %s", v.ID, v.Op) @@ -176,8 +183,8 @@ func (v *Value) auxString() string { case auxInt64, auxInt128: return fmt.Sprintf(" [%d]", v.AuxInt) case auxARM64BitField: - lsb := getARM64BFlsb(v.AuxInt) - width := getARM64BFwidth(v.AuxInt) + lsb := v.AuxArm64BitField().getARM64BFlsb() + width := v.AuxArm64BitField().getARM64BFwidth() return fmt.Sprintf(" [lsb=%d,width=%d]", lsb, width) case auxFloat32, auxFloat64: return fmt.Sprintf(" [%g]", v.AuxFloat()) |