From 8ada52228cac7ef265915cf95d8a0e515069fe9d Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 10 Mar 2017 15:03:25 -0800 Subject: [PATCH] cmd/compile: remove ProgInfo tables Change-Id: Id807c702ad71edddd23f2eb6f5e69e9a62e60bcd Reviewed-on: https://go-review.googlesource.com/38089 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/fmt_test.go | 1 - src/cmd/compile/internal/amd64/galign.go | 1 - src/cmd/compile/internal/amd64/prog.go | 287 ------------------- src/cmd/compile/internal/arm/galign.go | 1 - src/cmd/compile/internal/arm/prog.go | 157 ----------- src/cmd/compile/internal/arm64/galign.go | 1 - src/cmd/compile/internal/arm64/prog.go | 182 ------------ src/cmd/compile/internal/gc/go.go | 60 ---- src/cmd/compile/internal/gc/plive.go | 8 - src/cmd/compile/internal/mips/galign.go | 1 - src/cmd/compile/internal/mips/prog.go | 155 ----------- src/cmd/compile/internal/mips64/galign.go | 1 - src/cmd/compile/internal/mips64/prog.go | 152 ----------- src/cmd/compile/internal/ppc64/galign.go | 4 - src/cmd/compile/internal/ppc64/prog.go | 319 ---------------------- src/cmd/compile/internal/s390x/galign.go | 1 - src/cmd/compile/internal/s390x/prog.go | 198 -------------- src/cmd/compile/internal/x86/galign.go | 1 - src/cmd/compile/internal/x86/prog.go | 268 ------------------ 19 files changed, 1798 deletions(-) delete mode 100644 src/cmd/compile/internal/amd64/prog.go delete mode 100644 src/cmd/compile/internal/arm/prog.go delete mode 100644 src/cmd/compile/internal/arm64/prog.go delete mode 100644 src/cmd/compile/internal/mips/prog.go delete mode 100644 src/cmd/compile/internal/mips64/prog.go delete mode 100644 src/cmd/compile/internal/ppc64/prog.go delete mode 100644 src/cmd/compile/internal/s390x/prog.go delete mode 100644 src/cmd/compile/internal/x86/prog.go diff --git a/src/cmd/compile/fmt_test.go b/src/cmd/compile/fmt_test.go index c4bee55dca..fd6abc20fa 100644 --- a/src/cmd/compile/fmt_test.go +++ b/src/cmd/compile/fmt_test.go @@ -594,7 +594,6 @@ var knownFormats = map[string]string{ "*cmd/internal/obj.Addr %v": "", "*cmd/internal/obj.LSym %v": "", "*cmd/internal/obj.Prog %s": "", - "*cmd/internal/obj.Prog %v": "", "*math/big.Int %#x": "", "*math/big.Int %s": "", "[16]byte %x": "", diff --git a/src/cmd/compile/internal/amd64/galign.go b/src/cmd/compile/internal/amd64/galign.go index 68fd9ece82..90ee895364 100644 --- a/src/cmd/compile/internal/amd64/galign.go +++ b/src/cmd/compile/internal/amd64/galign.go @@ -23,7 +23,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = ssaMarkMoves arch.SSAGenValue = ssaGenValue diff --git a/src/cmd/compile/internal/amd64/prog.go b/src/cmd/compile/internal/amd64/prog.go deleted file mode 100644 index 372c1e6cb0..0000000000 --- a/src/cmd/compile/internal/amd64/prog.go +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package amd64 - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/x86" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -var progtable = [x86.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the Intel opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - x86.AADCL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.AADCQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.AADCW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.AADDB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.AADDSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.AANDB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AANDL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AANDQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AANDW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - - x86.ABSFL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSFQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSFW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSRQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSRW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.SetCarry}, - x86.ABSWAPL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.ABSWAPQ & obj.AMask: {Flags: gc.SizeQ | RightRdwr}, - - obj.ACALL & obj.AMask: {Flags: gc.RightAddr | gc.Call | gc.KillCarry}, - x86.ACDQ & obj.AMask: {Flags: gc.OK}, - x86.ACQO & obj.AMask: {Flags: gc.OK}, - x86.ACWD & obj.AMask: {Flags: gc.OK}, - x86.ACLD & obj.AMask: {Flags: gc.OK}, - x86.ASTD & obj.AMask: {Flags: gc.OK}, - - x86.ACMOVLEQ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.UseCarry}, - x86.ACMOVLNE & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.UseCarry}, - x86.ACMOVQEQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.UseCarry}, - x86.ACMOVQNE & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.UseCarry}, - x86.ACMOVWEQ & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.UseCarry}, - x86.ACMOVWNE & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.UseCarry}, - - x86.ABTL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ABTQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPXCHGL & obj.AMask: {Flags: gc.SizeL | LeftRdwr | RightRdwr | gc.SetCarry}, - x86.ACMPXCHGQ & obj.AMask: {Flags: gc.SizeQ | LeftRdwr | RightRdwr | gc.SetCarry}, - x86.ACOMISD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACOMISS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACVTSD2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSD2SQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSD2SS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSL2SD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSL2SS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSQ2SD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSQ2SS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSS2SD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSS2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSS2SQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSD2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSD2SQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSS2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSS2SQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ADECB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.ADECL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.ADECQ & obj.AMask: {Flags: gc.SizeQ | RightRdwr}, - x86.ADECW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.ADIVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.ADIVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.ADIVQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.SetCarry}, - x86.ADIVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.ADIVSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ADIVSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.AIDIVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AIDIVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.AIDIVQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.SetCarry}, - x86.AIDIVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.AIMULB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AIMULL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.ImulAXDX | gc.SetCarry}, - x86.AIMULQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.ImulAXDX | gc.SetCarry}, - x86.AIMULW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.ImulAXDX | gc.SetCarry}, - x86.AINCB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.AINCL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.AINCQ & obj.AMask: {Flags: gc.SizeQ | RightRdwr}, - x86.AINCW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.AJCC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJCS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJEQ & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJGE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJGT & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJHI & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLT & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJMI & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJNE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJOC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJOS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPL & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - obj.AJMP & obj.AMask: {Flags: gc.Jump | gc.Break | gc.KillCarry}, - x86.ALEAW & obj.AMask: {Flags: gc.LeftAddr | gc.RightWrite}, - x86.ALEAL & obj.AMask: {Flags: gc.LeftAddr | gc.RightWrite}, - x86.ALEAQ & obj.AMask: {Flags: gc.LeftAddr | gc.RightWrite}, - x86.ALOCK & obj.AMask: {Flags: gc.OK}, - x86.AMOVBLSX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBLZX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBQSX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBQZX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBWSX & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBWZX & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVLQSX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVLQZX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWLSX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWLZX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWQSX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWQZX & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVQL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVUPS & obj.AMask: {Flags: gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVSB & obj.AMask: {Flags: gc.OK}, - x86.AMOVSL & obj.AMask: {Flags: gc.OK}, - x86.AMOVSQ & obj.AMask: {Flags: gc.OK}, - x86.AMOVSW & obj.AMask: {Flags: gc.OK}, - obj.ADUFFCOPY & obj.AMask: {Flags: gc.OK}, - x86.AMOVSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move}, - - // We use&obj.AMask MOVAPD as a faster synonym for MOVSD. - x86.AMOVAPD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMULB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AMULL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.AMULQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.SetCarry}, - x86.AMULW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.AMULSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.AMULSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.ANEGB & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.SetCarry}, - x86.ANEGL & obj.AMask: {Flags: gc.SizeL | RightRdwr | gc.SetCarry}, - x86.ANEGQ & obj.AMask: {Flags: gc.SizeQ | RightRdwr | gc.SetCarry}, - x86.ANEGW & obj.AMask: {Flags: gc.SizeW | RightRdwr | gc.SetCarry}, - x86.ANOTB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.ANOTL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.ANOTQ & obj.AMask: {Flags: gc.SizeQ | RightRdwr}, - x86.ANOTW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.AORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AORQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.APOPQ & obj.AMask: {Flags: gc.SizeQ | gc.RightWrite}, - x86.APUSHQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead}, - x86.APXOR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ARCLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCLQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.AREP & obj.AMask: {Flags: gc.OK}, - x86.AREPN & obj.AMask: {Flags: gc.OK}, - obj.ARET & obj.AMask: {Flags: gc.Break | gc.KillCarry}, - x86.AROLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.AROLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.AROLQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.AROLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASBBB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASBBL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASBBQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASBBW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASETCC & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETCS & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETEQ & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETGE & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETGT & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETHI & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETLE & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETLS & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETLT & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETMI & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETNE & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETOC & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETOS & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETPC & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETPL & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASETPS & obj.AMask: {Flags: gc.SizeB | gc.RightWrite | gc.UseCarry}, - x86.ASHLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHLQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASQRTSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ASTOSB & obj.AMask: {Flags: gc.OK}, - x86.ASTOSL & obj.AMask: {Flags: gc.OK}, - x86.ASTOSQ & obj.AMask: {Flags: gc.OK}, - x86.ASTOSW & obj.AMask: {Flags: gc.OK}, - obj.ADUFFZERO & obj.AMask: {Flags: gc.OK}, - x86.ASUBB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ASUBSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.ATESTB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ATESTL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ATESTQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ATESTW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.AUCOMISD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - x86.AUCOMISS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead}, - x86.AXADDL & obj.AMask: {Flags: gc.SizeL | LeftRdwr | RightRdwr | gc.KillCarry}, - x86.AXADDQ & obj.AMask: {Flags: gc.SizeQ | LeftRdwr | RightRdwr | gc.KillCarry}, - x86.AXCHGB & obj.AMask: {Flags: gc.SizeB | LeftRdwr | RightRdwr}, - x86.AXCHGL & obj.AMask: {Flags: gc.SizeL | LeftRdwr | RightRdwr}, - x86.AXCHGQ & obj.AMask: {Flags: gc.SizeQ | LeftRdwr | RightRdwr}, - x86.AXCHGW & obj.AMask: {Flags: gc.SizeW | LeftRdwr | RightRdwr}, - x86.AXORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORPS & obj.AMask: {Flags: gc.LeftRead | RightRdwr}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("unknown instruction %v", p) - } - - if info.Flags&gc.ImulAXDX != 0 && p.To.Type != obj.TYPE_NONE { - info.Flags |= RightRdwr - } - - return info -} diff --git a/src/cmd/compile/internal/arm/galign.go b/src/cmd/compile/internal/arm/galign.go index 26f384363c..809a142262 100644 --- a/src/cmd/compile/internal/arm/galign.go +++ b/src/cmd/compile/internal/arm/galign.go @@ -17,7 +17,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = func(s *gc.SSAGenState, b *ssa.Block) {} arch.SSAGenValue = ssaGenValue diff --git a/src/cmd/compile/internal/arm/prog.go b/src/cmd/compile/internal/arm/prog.go deleted file mode 100644 index 6a50336c0e..0000000000 --- a/src/cmd/compile/internal/arm/prog.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package arm - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/arm" -) - -const ( - RightRdwr = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -var progtable = [arm.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the Intel opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - - // Integer. - arm.AADC & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AADD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AAND & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ABIC & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ACMN & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - arm.ACMP & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - arm.ADIVU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ADIV & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AEOR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMODU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMOD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMULALU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr}, - arm.AMULAL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr}, - arm.AMULA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr}, - arm.AMULU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMUL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMULL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMULLU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.AMVN & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - arm.AORR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ARSB & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ARSC & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ASBC & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ASLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ASRA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ASRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ASUB & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm.ACLZ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - arm.ATEQ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - arm.ATST & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - - // Floating point. - arm.AADDD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - arm.AADDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - arm.ACMPD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - arm.ACMPF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead}, - arm.ADIVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - arm.ADIVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - arm.AMULD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - arm.AMULF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - arm.ASUBD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - arm.ASUBF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - arm.ANEGD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - arm.ANEGF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - arm.ASQRTD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - - // Conversions. - arm.AMOVWD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVWF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVFD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVFW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // Moves. - arm.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - arm.AMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - arm.AMOVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move}, - arm.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move}, - arm.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - - // In addition, duffzero reads R0,R1 and writes R1. This fact is - // encoded in peep.c - obj.ADUFFZERO: {Flags: gc.Call}, - - // In addition, duffcopy reads R1,R2 and writes R0,R1,R2. This fact is - // encoded in peep.c - obj.ADUFFCOPY: {Flags: gc.Call}, - - // These should be split into the two different conversions instead - // of overloading the one. - arm.AMOVBS & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVBU & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVHS & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm.AMOVHU & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // Jumps. - arm.AB & obj.AMask: {Flags: gc.Jump | gc.Break}, - arm.ABL & obj.AMask: {Flags: gc.Call}, - arm.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - arm.ABNE & obj.AMask: {Flags: gc.Cjmp}, - arm.ABCS & obj.AMask: {Flags: gc.Cjmp}, - arm.ABHS & obj.AMask: {Flags: gc.Cjmp}, - arm.ABCC & obj.AMask: {Flags: gc.Cjmp}, - arm.ABLO & obj.AMask: {Flags: gc.Cjmp}, - arm.ABMI & obj.AMask: {Flags: gc.Cjmp}, - arm.ABPL & obj.AMask: {Flags: gc.Cjmp}, - arm.ABVS & obj.AMask: {Flags: gc.Cjmp}, - arm.ABVC & obj.AMask: {Flags: gc.Cjmp}, - arm.ABHI & obj.AMask: {Flags: gc.Cjmp}, - arm.ABLS & obj.AMask: {Flags: gc.Cjmp}, - arm.ABGE & obj.AMask: {Flags: gc.Cjmp}, - arm.ABLT & obj.AMask: {Flags: gc.Cjmp}, - arm.ABGT & obj.AMask: {Flags: gc.Cjmp}, - arm.ABLE & obj.AMask: {Flags: gc.Cjmp}, - obj.ARET: {Flags: gc.Break}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("unknown instruction %v", p) - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.CanRegRead | gc.RightRead - } - - if (p.Scond&arm.C_SCOND != arm.C_SCOND_NONE) && (info.Flags&gc.RightWrite != 0) { - info.Flags |= gc.RightRead - } - - return info -} diff --git a/src/cmd/compile/internal/arm64/galign.go b/src/cmd/compile/internal/arm64/galign.go index 6a93e1073e..31448c6c3a 100644 --- a/src/cmd/compile/internal/arm64/galign.go +++ b/src/cmd/compile/internal/arm64/galign.go @@ -17,7 +17,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = func(s *gc.SSAGenState, b *ssa.Block) {} arch.SSAGenValue = ssaGenValue diff --git a/src/cmd/compile/internal/arm64/prog.go b/src/cmd/compile/internal/arm64/prog.go deleted file mode 100644 index d3a86cb281..0000000000 --- a/src/cmd/compile/internal/arm64/prog.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package arm64 - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/arm64" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -// -// The table is formatted for 8-space tabs. -var progtable = [arm64.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the Power opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - arm64.AHINT & obj.AMask: {Flags: gc.OK}, - - // Integer - arm64.AADD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ASUB & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ANEG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, // why RegRead? revisit once the old backend gone - arm64.AAND & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AORR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AEOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ABIC & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AMVN & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite}, - arm64.AMUL & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AMULW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ASMULL & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUMULL & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ASMULH & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUMULH & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ASDIV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUDIV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ASDIVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUDIVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AREM & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUREM & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AREMW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AUREMW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ALSL & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ALSR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AASR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ACMP & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - arm64.ACMPW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - arm64.AADC & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite | gc.UseCarry}, - arm64.AROR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.ARORW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AADDS & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite | gc.SetCarry}, - arm64.ACSET & obj.AMask: {Flags: gc.SizeQ | gc.RightWrite}, - arm64.ACSEL & obj.AMask: {Flags: gc.SizeQ | gc.RegRead | gc.RightWrite}, - arm64.AREV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite}, - arm64.AREVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - arm64.AREV16W & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - arm64.ARBIT & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite}, - arm64.ARBITW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - arm64.ACLZ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite}, - arm64.ACLZW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - - // Floating point. - arm64.AFADDD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFADDS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFSUBD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFSUBS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFNEGD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - arm64.AFNEGS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - arm64.AFSQRTD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - arm64.AFMULD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFMULS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFDIVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFDIVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - arm64.AFCMPD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - arm64.AFCMPS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - - // float -> integer - arm64.AFCVTZSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZSDW & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZSSW & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZUD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZUS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZUDW & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTZUSW & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // float -> float - arm64.AFCVTSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AFCVTDS & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // integer -> float - arm64.ASCVTFD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.ASCVTFS & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.ASCVTFWD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.ASCVTFWS & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AUCVTFD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AUCVTFS & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AUCVTFWD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - arm64.AUCVTFWS & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // Moves - arm64.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVBU & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVHU & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AMOVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.AFMOVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - arm64.AFMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ALDARW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ALDAR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ALDAXRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ALDAXRW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ALDAXR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ASTLRW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ASTLR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ASTLXRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ASTLXRW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - arm64.ASTLXR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - - // Jumps - arm64.AB & obj.AMask: {Flags: gc.Jump | gc.Break}, - arm64.ABL & obj.AMask: {Flags: gc.Call}, - arm64.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABNE & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABGE & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABLT & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABGT & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABLE & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABLO & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABLS & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABHI & obj.AMask: {Flags: gc.Cjmp}, - arm64.ABHS & obj.AMask: {Flags: gc.Cjmp}, - arm64.ACBZ & obj.AMask: {Flags: gc.Cjmp}, - arm64.ACBNZ & obj.AMask: {Flags: gc.Cjmp}, - arm64.ACBZW & obj.AMask: {Flags: gc.Cjmp}, - arm64.ACBNZW & obj.AMask: {Flags: gc.Cjmp}, - obj.ARET: {Flags: gc.Break}, - obj.ADUFFZERO: {Flags: gc.Call}, - obj.ADUFFCOPY: {Flags: gc.Call}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("proginfo: unknown instruction %v", p) - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.RightRead /*CanRegRead |*/ - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - return info -} diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index 309b6553e1..a5eec792f4 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -293,65 +293,6 @@ var disable_checknil int // interface to back end -const ( - // Pseudo-op, like TEXT, GLOBL, TYPE, PCDATA, FUNCDATA. - Pseudo = 1 << 1 - - // There's nothing to say about the instruction, - // but it's still okay to see. - OK = 1 << 2 - - // Size of right-side write, or right-side read if no write. - SizeB = 1 << 3 - SizeW = 1 << 4 - SizeL = 1 << 5 - SizeQ = 1 << 6 - SizeF = 1 << 7 - SizeD = 1 << 8 - - // Left side (Prog.from): address taken, read, write. - LeftAddr = 1 << 9 - LeftRead = 1 << 10 - LeftWrite = 1 << 11 - - // Register in middle (Prog.reg); only ever read. (arm, ppc64) - RegRead = 1 << 12 - CanRegRead = 1 << 13 - - // Right side (Prog.to): address taken, read, write. - RightAddr = 1 << 14 - RightRead = 1 << 15 - RightWrite = 1 << 16 - - // Instruction kinds - Move = 1 << 17 // straight move - Conv = 1 << 18 // size conversion - Cjmp = 1 << 19 // conditional jump - Break = 1 << 20 // breaks control flow (no fallthrough) - Call = 1 << 21 // function call - Jump = 1 << 22 // jump - Skip = 1 << 23 // data instruction - - // Set, use, or kill of carry bit. - // Kill means we never look at the carry bit after this kind of instruction. - // Originally for understanding ADC, RCR, and so on, but now also - // tracks set, use, and kill of the zero and overflow bits as well. - // TODO rename to {Set,Use,Kill}Flags - SetCarry = 1 << 24 - UseCarry = 1 << 25 - KillCarry = 1 << 26 - - // Special cases for register use. (amd64, 386) - ShiftCX = 1 << 27 // possible shift by CX - ImulAXDX = 1 << 28 // possible multiply into DX:AX - - // Instruction updates whichever of from/to is type D_OREG. (ppc64) - PostInc = 1 << 29 - - // Optional 3rd input operand, only ever read. - From3Read = 1 << 30 -) - type Arch struct { LinkArch *obj.LinkArch @@ -361,7 +302,6 @@ type Arch struct { Defframe func(*obj.Prog, *Node, int64) Ginsnop func() - Proginfo func(*obj.Prog) ProgInfo // SSAMarkMoves marks any MOVXconst ops that need to avoid clobbering flags. SSAMarkMoves func(*SSAGenState, *ssa.Block) diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index ddd617f5fc..b3cecdf894 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -80,14 +80,6 @@ type progeffectscache struct { initialized bool } -// ProgInfo holds information about the instruction for use -// by clients such as the compiler. The exact meaning of this -// data is up to the client and is not interpreted by the cmd/internal/obj/... packages. -type ProgInfo struct { - _ struct{} // to prevent unkeyed literals. Trailing zero-sized field will take space. - Flags uint32 // flag bits -} - // livenessShouldTrack reports whether the liveness analysis // should track the variable n. // We don't care about variables that have no pointers, diff --git a/src/cmd/compile/internal/mips/galign.go b/src/cmd/compile/internal/mips/galign.go index 406ae99a2b..30e3e985eb 100644 --- a/src/cmd/compile/internal/mips/galign.go +++ b/src/cmd/compile/internal/mips/galign.go @@ -20,7 +20,6 @@ func Init(arch *gc.Arch) { arch.MAXWIDTH = (1 << 31) - 1 arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = func(s *gc.SSAGenState, b *ssa.Block) {} arch.SSAGenValue = ssaGenValue arch.SSAGenBlock = ssaGenBlock diff --git a/src/cmd/compile/internal/mips/prog.go b/src/cmd/compile/internal/mips/prog.go deleted file mode 100644 index 3061275f87..0000000000 --- a/src/cmd/compile/internal/mips/prog.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mips - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/mips" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -// -// The table is formatted for 8-space tabs. -var progtable = [mips.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the MIPS opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - - // Integer - mips.AADD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUB & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AAND & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AOR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AXOR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ANOR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMUL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.AMULU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.ADIV & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.ADIVU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.ASLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASGT & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASGTU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - - mips.ACLZ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - mips.ACLO & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - - // Floating point. - mips.AADDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMULF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMULD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ADIVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ADIVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AABSF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - mips.AABSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - mips.ANEGF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - mips.ANEGD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - mips.ACMPEQF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPEQD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.ACMPGTF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPGTD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.ACMPGEF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPGED & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.AMOVFD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVFW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVWF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVWD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCFW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - - mips.ASQRTF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - mips.ASQRTD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - - // Moves - mips.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVBU & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVHU & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - - // Conditional moves - mips.ACMOVN & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr}, - mips.ACMOVZ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | RightRdwr}, - mips.ACMOVT & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr}, - mips.ACMOVF & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr}, - - // Conditional trap - mips.ATEQ & obj.AMask: {Flags: gc.SizeL | gc.RegRead | gc.RightRead}, - mips.ATNE & obj.AMask: {Flags: gc.SizeL | gc.RegRead | gc.RightRead}, - - // Atomic - mips.ASYNC & obj.AMask: {Flags: gc.OK}, - mips.ALL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite}, - mips.ASC & obj.AMask: {Flags: gc.SizeL | LeftRdwr | gc.RightRead}, - - // Jumps - mips.AJMP & obj.AMask: {Flags: gc.Jump | gc.Break}, - mips.AJAL & obj.AMask: {Flags: gc.Call}, - mips.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABNE & obj.AMask: {Flags: gc.Cjmp}, - mips.ABGEZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABLTZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABGTZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABLEZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABFPF & obj.AMask: {Flags: gc.Cjmp}, - mips.ABFPT & obj.AMask: {Flags: gc.Cjmp}, - mips.ARET & obj.AMask: {Flags: gc.Break}, - obj.ADUFFZERO: {Flags: gc.Call}, - obj.ADUFFCOPY: {Flags: gc.Call}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - - if info.Flags == 0 { - gc.Fatalf("proginfo: unknown instruction %v", p) - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.RightRead - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - if p.As == mips.AMUL && p.To.Reg != 0 { - info.Flags |= gc.RightWrite - } - - return info -} diff --git a/src/cmd/compile/internal/mips64/galign.go b/src/cmd/compile/internal/mips64/galign.go index 657db028fd..cd17c62d61 100644 --- a/src/cmd/compile/internal/mips64/galign.go +++ b/src/cmd/compile/internal/mips64/galign.go @@ -21,7 +21,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = func(s *gc.SSAGenState, b *ssa.Block) {} arch.SSAGenValue = ssaGenValue diff --git a/src/cmd/compile/internal/mips64/prog.go b/src/cmd/compile/internal/mips64/prog.go deleted file mode 100644 index cc62d6a207..0000000000 --- a/src/cmd/compile/internal/mips64/prog.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mips64 - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/mips" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -// -// The table is formatted for 8-space tabs. -var progtable = [mips.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the MIPS opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - - // Integer - mips.AADD & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDVU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUB & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBVU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AAND & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AXOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ANOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMUL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.AMULU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.AMULV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.AMULVU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.ADIV & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.ADIVU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.ADIVV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.ADIVVU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.AREM & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.AREMU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead}, - mips.AREMV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.AREMVU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead}, - mips.ASLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASLLV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRAV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASRLV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASGT & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASGTU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - - // Floating point. - mips.AADDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AADDD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ASUBD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMULF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AMULD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ADIVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.ADIVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - mips.AABSF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - mips.AABSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - mips.ANEGF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - mips.ANEGD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - mips.ACMPEQF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPEQD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.ACMPGTF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPGTD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.ACMPGEF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead}, - mips.ACMPGED & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead}, - mips.AMOVFD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVDF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVFW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVWF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVWD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVFV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVDV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.AMOVVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCFW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCFV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - mips.ATRUNCDV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // Moves - mips.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVBU & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVHU & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - mips.AMOVF & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - mips.AMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - - // Jumps - mips.AJMP & obj.AMask: {Flags: gc.Jump | gc.Break}, - mips.AJAL & obj.AMask: {Flags: gc.Call}, - mips.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABNE & obj.AMask: {Flags: gc.Cjmp}, - mips.ABGEZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABLTZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABGTZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABLEZ & obj.AMask: {Flags: gc.Cjmp}, - mips.ABFPF & obj.AMask: {Flags: gc.Cjmp}, - mips.ABFPT & obj.AMask: {Flags: gc.Cjmp}, - mips.ARET & obj.AMask: {Flags: gc.Break}, - obj.ADUFFZERO: {Flags: gc.Call}, - obj.ADUFFCOPY: {Flags: gc.Call}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("proginfo: unknown instruction %v", p) - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.RightRead /*CanRegRead |*/ - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - return info -} diff --git a/src/cmd/compile/internal/ppc64/galign.go b/src/cmd/compile/internal/ppc64/galign.go index f31c993bb4..c8ce1e21ba 100644 --- a/src/cmd/compile/internal/ppc64/galign.go +++ b/src/cmd/compile/internal/ppc64/galign.go @@ -20,12 +20,8 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop2 - arch.Proginfo = proginfo arch.SSAMarkMoves = ssaMarkMoves arch.SSAGenValue = ssaGenValue arch.SSAGenBlock = ssaGenBlock - - initvariants() - initproginfo() } diff --git a/src/cmd/compile/internal/ppc64/prog.go b/src/cmd/compile/internal/ppc64/prog.go deleted file mode 100644 index 6f29f49867..0000000000 --- a/src/cmd/compile/internal/ppc64/prog.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ppc64 - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/ppc64" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -// -// The table is formatted for 8-space tabs. -var progtable = [ppc64.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the Power opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - - // Integer - ppc64.AADD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AADDC & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASUB & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AADDME & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ANEG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AAND & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AANDN & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AORN & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AXOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ANOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AEQV & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULLD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULLW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULHD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULHDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULHW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AMULHWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ADIVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ADIVDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ADIVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ADIVWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASLD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASRD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASRAD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASLW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASRW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ASRAW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.ACMP & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead}, - ppc64.ACMPU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead}, - ppc64.ACMPW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - ppc64.ACMPWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - ppc64.ATD & obj.AMask: {Flags: gc.SizeQ | gc.RightRead}, - - // Floating point. - ppc64.AFADD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFADDS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFSUB & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFSUBS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMUL & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMULS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFDIV & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFDIVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMADD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMADDS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMSUB & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFMSUBS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFCTIDZ & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFCTIWZ & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFCFID & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFCFIDU & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - ppc64.AFCMPU & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - ppc64.AFRSP & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - ppc64.AFSQRT & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - ppc64.AFNEG & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - - // Moves - ppc64.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AMOVBU & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc}, - ppc64.AMOVBZ & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AMOVHU & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc}, - ppc64.AMOVHZ & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.ALDAR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.ALWAR & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.ALBAR & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.ASTDCCC & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.ASTWCCC & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.ASTBCCC & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - - ppc64.AISEL & obj.AMask: {Flags: gc.SizeQ | gc.RegRead | gc.From3Read | gc.RightWrite}, - - // there is no AMOVWU. - ppc64.AMOVWZU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv | gc.PostInc}, - ppc64.AMOVWZ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AMOVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.AMOVDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move | gc.PostInc}, - ppc64.AFMOVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AFMOVSX & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AFMOVSZ & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - ppc64.AFMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.AMFVSRD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - ppc64.AMTVSRD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - - // Misc - ppc64.ASYNC & obj.AMask: {Flags: gc.OK}, - ppc64.AISYNC & obj.AMask: {Flags: gc.OK}, - - // Jumps - ppc64.ABR & obj.AMask: {Flags: gc.Jump | gc.Break}, - ppc64.ABL & obj.AMask: {Flags: gc.Call}, - ppc64.ABVS & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABVC & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABNE & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABGE & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABLT & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABGT & obj.AMask: {Flags: gc.Cjmp}, - ppc64.ABLE & obj.AMask: {Flags: gc.Cjmp}, - obj.ARET: {Flags: gc.Break}, - obj.ADUFFZERO: {Flags: gc.Call}, - obj.ADUFFCOPY: {Flags: gc.Call}, -} - -func initproginfo() { - var addvariant = []int{V_CC, V_V, V_CC | V_V} - - // Perform one-time expansion of instructions in progtable to - // their CC, V, and VCC variants - for i := range progtable { - as := obj.As(i) - if progtable[as].Flags == 0 { - continue - } - variant := as2variant(as) - for i := range addvariant { - as2 := variant2as(as, variant|addvariant[i]) - if as2 != 0 && progtable[as2&obj.AMask].Flags == 0 { - progtable[as2&obj.AMask] = progtable[as] - } - } - } -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("proginfo: unknown instruction %v", p) - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.RightRead /*CanRegRead |*/ - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - return info -} - -// Instruction variants table, populated by initvariants via Main. -// The index is the base form of the instruction, masked by obj.AMask. -// The 4 values are the unmasked base form, then the unmasked CC, V, -// and VCC variants, respectively. -var varianttable = [ppc64.ALAST & obj.AMask][4]obj.As{} - -func initvariant(as obj.As, variants ...obj.As) { - vv := &varianttable[as&obj.AMask] - vv[0] = as - for i, v := range variants { - vv[i+1] = v - } -} - -func initvariants() { - initvariant(ppc64.AADD, ppc64.AADDCC, ppc64.AADDV, ppc64.AADDVCC) - initvariant(ppc64.AADDC, ppc64.AADDCCC, ppc64.AADDCV, ppc64.AADDCVCC) - initvariant(ppc64.AADDE, ppc64.AADDECC, ppc64.AADDEV, ppc64.AADDEVCC) - initvariant(ppc64.AADDME, ppc64.AADDMECC, ppc64.AADDMEV, ppc64.AADDMEVCC) - initvariant(ppc64.AADDZE, ppc64.AADDZECC, ppc64.AADDZEV, ppc64.AADDZEVCC) - initvariant(ppc64.AAND, ppc64.AANDCC) - initvariant(ppc64.AANDN, ppc64.AANDNCC) - initvariant(ppc64.ACNTLZD, ppc64.ACNTLZDCC) - initvariant(ppc64.ACNTLZW, ppc64.ACNTLZWCC) - initvariant(ppc64.ADIVD, ppc64.ADIVDCC, ppc64.ADIVDV, ppc64.ADIVDVCC) - initvariant(ppc64.ADIVDU, ppc64.ADIVDUCC, ppc64.ADIVDUV, ppc64.ADIVDUVCC) - initvariant(ppc64.ADIVW, ppc64.ADIVWCC, ppc64.ADIVWV, ppc64.ADIVWVCC) - initvariant(ppc64.ADIVWU, ppc64.ADIVWUCC, ppc64.ADIVWUV, ppc64.ADIVWUVCC) - initvariant(ppc64.AEQV, ppc64.AEQVCC) - initvariant(ppc64.AEXTSB, ppc64.AEXTSBCC) - initvariant(ppc64.AEXTSH, ppc64.AEXTSHCC) - initvariant(ppc64.AEXTSW, ppc64.AEXTSWCC) - initvariant(ppc64.AFABS, ppc64.AFABSCC) - initvariant(ppc64.AFADD, ppc64.AFADDCC) - initvariant(ppc64.AFADDS, ppc64.AFADDSCC) - initvariant(ppc64.AFCFID, ppc64.AFCFIDCC) - initvariant(ppc64.AFCFIDU, ppc64.AFCFIDUCC) - initvariant(ppc64.AFCTID, ppc64.AFCTIDCC) - initvariant(ppc64.AFCTIDZ, ppc64.AFCTIDZCC) - initvariant(ppc64.AFCTIW, ppc64.AFCTIWCC) - initvariant(ppc64.AFCTIWZ, ppc64.AFCTIWZCC) - initvariant(ppc64.AFDIV, ppc64.AFDIVCC) - initvariant(ppc64.AFDIVS, ppc64.AFDIVSCC) - initvariant(ppc64.AFMADD, ppc64.AFMADDCC) - initvariant(ppc64.AFMADDS, ppc64.AFMADDSCC) - initvariant(ppc64.AFMOVD, ppc64.AFMOVDCC) - initvariant(ppc64.AFMSUB, ppc64.AFMSUBCC) - initvariant(ppc64.AFMSUBS, ppc64.AFMSUBSCC) - initvariant(ppc64.AFMUL, ppc64.AFMULCC) - initvariant(ppc64.AFMULS, ppc64.AFMULSCC) - initvariant(ppc64.AFNABS, ppc64.AFNABSCC) - initvariant(ppc64.AFNEG, ppc64.AFNEGCC) - initvariant(ppc64.AFNMADD, ppc64.AFNMADDCC) - initvariant(ppc64.AFNMADDS, ppc64.AFNMADDSCC) - initvariant(ppc64.AFNMSUB, ppc64.AFNMSUBCC) - initvariant(ppc64.AFNMSUBS, ppc64.AFNMSUBSCC) - initvariant(ppc64.AFRES, ppc64.AFRESCC) - initvariant(ppc64.AFRSP, ppc64.AFRSPCC) - initvariant(ppc64.AFRSQRTE, ppc64.AFRSQRTECC) - initvariant(ppc64.AFSEL, ppc64.AFSELCC) - initvariant(ppc64.AFSQRT, ppc64.AFSQRTCC) - initvariant(ppc64.AFSQRTS, ppc64.AFSQRTSCC) - initvariant(ppc64.AFSUB, ppc64.AFSUBCC) - initvariant(ppc64.AFSUBS, ppc64.AFSUBSCC) - initvariant(ppc64.AMTFSB0, ppc64.AMTFSB0CC) - initvariant(ppc64.AMTFSB1, ppc64.AMTFSB1CC) - initvariant(ppc64.AMULHD, ppc64.AMULHDCC) - initvariant(ppc64.AMULHDU, ppc64.AMULHDUCC) - initvariant(ppc64.AMULHW, ppc64.AMULHWCC) - initvariant(ppc64.AMULHWU, ppc64.AMULHWUCC) - initvariant(ppc64.AMULLD, ppc64.AMULLDCC, ppc64.AMULLDV, ppc64.AMULLDVCC) - initvariant(ppc64.AMULLW, ppc64.AMULLWCC, ppc64.AMULLWV, ppc64.AMULLWVCC) - initvariant(ppc64.ANAND, ppc64.ANANDCC) - initvariant(ppc64.ANEG, ppc64.ANEGCC, ppc64.ANEGV, ppc64.ANEGVCC) - initvariant(ppc64.ANOR, ppc64.ANORCC) - initvariant(ppc64.AOR, ppc64.AORCC) - initvariant(ppc64.AORN, ppc64.AORNCC) - initvariant(ppc64.AREM, ppc64.AREMCC, ppc64.AREMV, ppc64.AREMVCC) - initvariant(ppc64.AREMD, ppc64.AREMDCC, ppc64.AREMDV, ppc64.AREMDVCC) - initvariant(ppc64.AREMDU, ppc64.AREMDUCC, ppc64.AREMDUV, ppc64.AREMDUVCC) - initvariant(ppc64.AREMU, ppc64.AREMUCC, ppc64.AREMUV, ppc64.AREMUVCC) - initvariant(ppc64.ARLDC, ppc64.ARLDCCC) - initvariant(ppc64.ARLDCL, ppc64.ARLDCLCC) - initvariant(ppc64.ARLDCR, ppc64.ARLDCRCC) - initvariant(ppc64.ARLDMI, ppc64.ARLDMICC) - initvariant(ppc64.ARLWMI, ppc64.ARLWMICC) - initvariant(ppc64.ARLWNM, ppc64.ARLWNMCC) - initvariant(ppc64.ASLD, ppc64.ASLDCC) - initvariant(ppc64.ASLW, ppc64.ASLWCC) - initvariant(ppc64.ASRAD, ppc64.ASRADCC) - initvariant(ppc64.ASRAW, ppc64.ASRAWCC) - initvariant(ppc64.ASRD, ppc64.ASRDCC) - initvariant(ppc64.ASRW, ppc64.ASRWCC) - initvariant(ppc64.ASUB, ppc64.ASUBCC, ppc64.ASUBV, ppc64.ASUBVCC) - initvariant(ppc64.ASUBC, ppc64.ASUBCCC, ppc64.ASUBCV, ppc64.ASUBCVCC) - initvariant(ppc64.ASUBE, ppc64.ASUBECC, ppc64.ASUBEV, ppc64.ASUBEVCC) - initvariant(ppc64.ASUBME, ppc64.ASUBMECC, ppc64.ASUBMEV, ppc64.ASUBMEVCC) - initvariant(ppc64.ASUBZE, ppc64.ASUBZECC, ppc64.ASUBZEV, ppc64.ASUBZEVCC) - initvariant(ppc64.AXOR, ppc64.AXORCC) - - for i := range varianttable { - vv := &varianttable[i] - if vv[0] == 0 { - // Instruction has no variants - varianttable[i][0] = obj.As(i) - continue - } - - // Copy base form to other variants - if vv[0]&obj.AMask == obj.As(i) { - for _, v := range vv { - if v != 0 { - varianttable[v&obj.AMask] = varianttable[i] - } - } - } - } -} - -// as2variant returns the variant (V_*) flags of instruction as. -func as2variant(as obj.As) int { - for i, v := range varianttable[as&obj.AMask] { - if v&obj.AMask == as&obj.AMask { - return i - } - } - gc.Fatalf("as2variant: instruction %v is not a variant of itself", as&obj.AMask) - return 0 -} - -// variant2as returns the instruction as with the given variant (V_*) flags. -// If no such variant exists, this returns 0. -func variant2as(as obj.As, flags int) obj.As { - return varianttable[as&obj.AMask][flags] -} diff --git a/src/cmd/compile/internal/s390x/galign.go b/src/cmd/compile/internal/s390x/galign.go index 225fb69d6b..3d08de2cdd 100644 --- a/src/cmd/compile/internal/s390x/galign.go +++ b/src/cmd/compile/internal/s390x/galign.go @@ -16,7 +16,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = ssaMarkMoves arch.SSAGenValue = ssaGenValue diff --git a/src/cmd/compile/internal/s390x/prog.go b/src/cmd/compile/internal/s390x/prog.go deleted file mode 100644 index 42a85ead31..0000000000 --- a/src/cmd/compile/internal/s390x/prog.go +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package s390x - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/s390x" -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -var progtable = [s390x.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT & obj.AMask: {Flags: gc.Pseudo}, - obj.AFUNCDATA & obj.AMask: {Flags: gc.Pseudo}, - obj.APCDATA & obj.AMask: {Flags: gc.Pseudo}, - obj.AUNDEF & obj.AMask: {Flags: gc.Break}, - obj.AVARDEF & obj.AMask: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL & obj.AMask: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE & obj.AMask: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations. - obj.ANOP & obj.AMask: {Flags: gc.LeftRead | gc.RightWrite}, - - // Integer - s390x.AADD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASUB & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASUBE & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AADDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASUBW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ANEG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ANEGW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AAND & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AANDW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AORW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AXOR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AXORW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMULLD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMULLW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMULHD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMULHDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ADIVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ADIVDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ADIVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ADIVWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASLD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASLW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASRD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASRW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASRAD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ASRAW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ARLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ARLLG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.ACMP & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead}, - s390x.ACMPU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead}, - s390x.ACMPW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - s390x.ACMPWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead}, - s390x.AMODD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMODDU & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMODW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AMODWU & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFLOGR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite}, - - // Floating point. - s390x.AFADD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFADDS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFSUB & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFSUBS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFMUL & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFMULS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFDIV & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFDIVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightWrite}, - s390x.AFCMPU & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - s390x.ACEBR & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead}, - s390x.ALEDBR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ALDEBR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.AFSQRT & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - s390x.AFNEG & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite}, - s390x.AFNEGS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite}, - s390x.AFMADD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightRead | gc.RightWrite}, - s390x.AFMADDS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightRead | gc.RightWrite}, - s390x.AFMSUB & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RegRead | gc.RightRead | gc.RightWrite}, - s390x.AFMSUBS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RegRead | gc.RightRead | gc.RightWrite}, - - // Conversions - s390x.ACEFBRA & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACDFBRA & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACEGBRA & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACDGBRA & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACFEBRA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACFDBRA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACGEBRA & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACGDBRA & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACELFBR & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACDLFBR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACELGBR & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACDLGBR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACLFEBR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACLFDBR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACLGEBR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - s390x.ACLGDBR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Conv}, - - // Moves - s390x.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVBZ & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVH & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVHZ & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVW & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVWZ & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVD & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVHBR & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVWBR & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AMOVDBR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AFMOVS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move | gc.Conv}, - s390x.AFMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDEQ & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDGE & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDGT & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDLE & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDLT & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - s390x.AMOVDNE & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.Move}, - - // Storage operations - s390x.AMVC & obj.AMask: {Flags: gc.LeftRead | gc.LeftAddr | gc.RightWrite | gc.RightAddr}, - s390x.ACLC & obj.AMask: {Flags: gc.LeftRead | gc.LeftAddr | gc.RightRead | gc.RightAddr}, - s390x.AXC & obj.AMask: {Flags: gc.LeftRead | gc.LeftAddr | gc.RightWrite | gc.RightAddr}, - s390x.AOC & obj.AMask: {Flags: gc.LeftRead | gc.LeftAddr | gc.RightWrite | gc.RightAddr}, - s390x.ANC & obj.AMask: {Flags: gc.LeftRead | gc.LeftAddr | gc.RightWrite | gc.RightAddr}, - - // Jumps - s390x.ABR & obj.AMask: {Flags: gc.Jump | gc.Break}, - s390x.ABL & obj.AMask: {Flags: gc.Call}, - s390x.ABEQ & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABNE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABGE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABLT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABGT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABLE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABLEU & obj.AMask: {Flags: gc.Cjmp}, - s390x.ABLTU & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBEQ & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBNE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBGE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBLT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBGT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPBLE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBEQ & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBNE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBGE & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBLT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBGT & obj.AMask: {Flags: gc.Cjmp}, - s390x.ACMPUBLE & obj.AMask: {Flags: gc.Cjmp}, - - // Atomic - s390x.ACS & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.LeftWrite | gc.RegRead | gc.RightRead | gc.RightWrite}, - s390x.ACSG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.LeftWrite | gc.RegRead | gc.RightRead | gc.RightWrite}, - s390x.ALAA & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.RightWrite}, - s390x.ALAAG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightRead | gc.RightWrite}, - - // Macros - s390x.ACLEAR & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightAddr | gc.RightWrite}, - - // Load/store multiple - s390x.ASTMG & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightAddr | gc.RightWrite}, - s390x.ASTMY & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightAddr | gc.RightWrite}, - s390x.ALMG & obj.AMask: {Flags: gc.SizeQ | gc.LeftAddr | gc.LeftRead | gc.RightWrite}, - s390x.ALMY & obj.AMask: {Flags: gc.SizeL | gc.LeftAddr | gc.LeftRead | gc.RightWrite}, - - obj.ARET & obj.AMask: {Flags: gc.Break}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("proginfo: unknown instruction %v", p) - } - - if (info.Flags&gc.RegRead != 0) && p.Reg == 0 { - info.Flags &^= gc.RegRead - info.Flags |= gc.RightRead /*CanRegRead |*/ - } - - if p.From.Type == obj.TYPE_ADDR && p.From.Sym != nil && (info.Flags&gc.LeftRead != 0) { - info.Flags &^= gc.LeftRead - info.Flags |= gc.LeftAddr - } - - return info -} diff --git a/src/cmd/compile/internal/x86/galign.go b/src/cmd/compile/internal/x86/galign.go index d09d9a995c..b5cf044bc7 100644 --- a/src/cmd/compile/internal/x86/galign.go +++ b/src/cmd/compile/internal/x86/galign.go @@ -31,7 +31,6 @@ func Init(arch *gc.Arch) { arch.Defframe = defframe arch.Ginsnop = ginsnop - arch.Proginfo = proginfo arch.SSAMarkMoves = ssaMarkMoves } diff --git a/src/cmd/compile/internal/x86/prog.go b/src/cmd/compile/internal/x86/prog.go deleted file mode 100644 index 70c55340ba..0000000000 --- a/src/cmd/compile/internal/x86/prog.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package x86 - -import ( - "cmd/compile/internal/gc" - "cmd/internal/obj" - "cmd/internal/obj/x86" -) - -const ( - LeftRdwr uint32 = gc.LeftRead | gc.LeftWrite - RightRdwr uint32 = gc.RightRead | gc.RightWrite -) - -// This table gives the basic information about instruction -// generated by the compiler and processed in the optimizer. -// See opt.h for bit definitions. -// -// Instructions not generated need not be listed. -// As an exception to that rule, we typically write down all the -// size variants of an operation even if we just use a subset. -// -// The table is formatted for 8-space tabs. -var progtable = [x86.ALAST & obj.AMask]gc.ProgInfo{ - obj.ATEXT: {Flags: gc.Pseudo}, - obj.AFUNCDATA: {Flags: gc.Pseudo}, - obj.APCDATA: {Flags: gc.Pseudo}, - obj.AUNDEF: {Flags: gc.Break}, - obj.AVARDEF: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARKILL: {Flags: gc.Pseudo | gc.RightWrite}, - obj.AVARLIVE: {Flags: gc.Pseudo | gc.LeftRead}, - - // NOP is an internal no-op that also stands - // for USED and SET annotations, not the Intel opcode. - obj.ANOP: {Flags: gc.LeftRead | gc.RightWrite}, - x86.AADCL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.AADCW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.AADDB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AADDSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.AADDSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.AANDB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AANDL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AANDW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - obj.ACALL: {Flags: gc.RightAddr | gc.Call | gc.KillCarry}, - x86.ACDQ & obj.AMask: {Flags: gc.OK}, - x86.ACWD & obj.AMask: {Flags: gc.OK}, - x86.ACLD & obj.AMask: {Flags: gc.OK}, - x86.ASTD & obj.AMask: {Flags: gc.OK}, - x86.ACMPB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACMPW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACOMISD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACOMISS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ACVTSD2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSD2SS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSL2SD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSL2SS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSS2SD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTSS2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSD2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ACVTTSS2SL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.ADECB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.ADECL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.ADECW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.ADIVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.ADIVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.ADIVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.ADIVSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ADIVSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.AFLDCW & obj.AMask: {Flags: gc.SizeW | gc.LeftAddr}, - x86.AFSTCW & obj.AMask: {Flags: gc.SizeW | gc.RightAddr}, - x86.AFSTSW & obj.AMask: {Flags: gc.SizeW | gc.RightAddr | gc.RightWrite}, - x86.AFADDD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFADDDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFADDF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AFCOMD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | gc.RightRead}, - x86.AFCOMDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | gc.RightRead}, - x86.AFCOMDPP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | gc.RightRead}, - x86.AFCOMF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | gc.RightRead}, - x86.AFCOMFP & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | gc.RightRead}, - // NOTE(khr): don't use FUCOMI* instructions, not available - // on Pentium MMX. See issue 13923. - //x86.AFUCOMIP&obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | gc.RightRead}, - x86.AFUCOMP & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - x86.AFUCOMPP & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - x86.AFCHS & obj.AMask: {Flags: gc.SizeD | RightRdwr}, // also SizeF - - x86.AFDIVDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFDIVF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AFDIVD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFDIVRDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFDIVRF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AFDIVRD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFXCHD & obj.AMask: {Flags: gc.SizeD | LeftRdwr | RightRdwr}, - x86.AFSUBD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFSUBDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFSUBF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AFSUBRD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFSUBRDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFSUBRF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AFMOVD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | gc.RightWrite}, - x86.AFMOVF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | gc.RightWrite}, - x86.AFMOVL & obj.AMask: {Flags: gc.SizeL | gc.LeftAddr | gc.RightWrite}, - x86.AFMOVW & obj.AMask: {Flags: gc.SizeW | gc.LeftAddr | gc.RightWrite}, - x86.AFMOVV & obj.AMask: {Flags: gc.SizeQ | gc.LeftAddr | gc.RightWrite}, - - // These instructions are marked as RightAddr - // so that the register optimizer does not try to replace the - // memory references with integer register references. - // But they do not use the previous value at the address, so - // we also mark them RightWrite. - x86.AFMOVDP & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.RightAddr}, - x86.AFMOVFP & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.RightAddr}, - x86.AFMOVLP & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.RightAddr}, - x86.AFMOVWP & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.RightAddr}, - x86.AFMOVVP & obj.AMask: {Flags: gc.SizeQ | gc.LeftRead | gc.RightWrite | gc.RightAddr}, - x86.AFMULD & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFMULDP & obj.AMask: {Flags: gc.SizeD | gc.LeftAddr | RightRdwr}, - x86.AFMULF & obj.AMask: {Flags: gc.SizeF | gc.LeftAddr | RightRdwr}, - x86.AIDIVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AIDIVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.AIDIVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.AIMULB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AIMULL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.ImulAXDX | gc.SetCarry}, - x86.AIMULW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.ImulAXDX | gc.SetCarry}, - x86.AINCB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.AINCL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.AINCW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.AJCC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJCS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJEQ & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJGE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJGT & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJHI & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJLT & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJMI & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJNE & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJOC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJOS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPC & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPL & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - x86.AJPS & obj.AMask: {Flags: gc.Cjmp | gc.UseCarry}, - obj.AJMP: {Flags: gc.Jump | gc.Break | gc.KillCarry}, - x86.ALEAW & obj.AMask: {Flags: gc.LeftAddr | gc.RightWrite}, - x86.ALEAL & obj.AMask: {Flags: gc.LeftAddr | gc.RightWrite}, - x86.AMOVBLSX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBLZX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBWSX & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVBWZX & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWLSX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVWLZX & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Conv}, - x86.AMOVB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVSB & obj.AMask: {Flags: gc.OK}, - x86.AMOVSL & obj.AMask: {Flags: gc.OK}, - x86.AMOVSW & obj.AMask: {Flags: gc.OK}, - obj.ADUFFCOPY: {Flags: gc.OK}, - x86.AMOVSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMOVSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightWrite | gc.Move}, - - // We use MOVAPD as a faster synonym for MOVSD. - x86.AMOVAPD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightWrite | gc.Move}, - x86.AMULB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.SetCarry}, - x86.AMULL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.SetCarry}, - x86.AMULW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.SetCarry}, - x86.AMULSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.AMULSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.ANEGB & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.SetCarry}, - x86.ANEGL & obj.AMask: {Flags: gc.SizeL | RightRdwr | gc.SetCarry}, - x86.ANEGW & obj.AMask: {Flags: gc.SizeW | RightRdwr | gc.SetCarry}, - x86.ANOTB & obj.AMask: {Flags: gc.SizeB | RightRdwr}, - x86.ANOTL & obj.AMask: {Flags: gc.SizeL | RightRdwr}, - x86.ANOTW & obj.AMask: {Flags: gc.SizeW | RightRdwr}, - x86.AORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.APOPL & obj.AMask: {Flags: gc.SizeL | gc.RightWrite}, - x86.APUSHL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead}, - x86.APXOR & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ARCLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.ARCRW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry | gc.UseCarry}, - x86.AREP & obj.AMask: {Flags: gc.OK}, - x86.AREPN & obj.AMask: {Flags: gc.OK}, - obj.ARET: {Flags: gc.Break | gc.KillCarry}, - x86.AROLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.AROLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.AROLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ARORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASAHF & obj.AMask: {Flags: gc.OK}, - x86.ASALB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASALW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASARW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASBBB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASBBL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASBBW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry | gc.UseCarry}, - x86.ASETCC & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETCS & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETEQ & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETGE & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETGT & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETHI & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETLE & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETLS & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETLT & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETMI & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETNE & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETOC & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETOS & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETPC & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETPL & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASETPS & obj.AMask: {Flags: gc.SizeB | RightRdwr | gc.UseCarry}, - x86.ASHLB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHLL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHLW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASHRW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.ShiftCX | gc.SetCarry}, - x86.ASTOSB & obj.AMask: {Flags: gc.OK}, - x86.ASTOSL & obj.AMask: {Flags: gc.OK}, - x86.ASTOSW & obj.AMask: {Flags: gc.OK}, - obj.ADUFFZERO: {Flags: gc.OK}, - x86.ASUBB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.ASUBSD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | RightRdwr}, - x86.ASUBSS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | RightRdwr}, - x86.ATESTB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ATESTL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.ATESTW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | gc.RightRead | gc.SetCarry}, - x86.AUCOMISD & obj.AMask: {Flags: gc.SizeD | gc.LeftRead | gc.RightRead}, - x86.AUCOMISS & obj.AMask: {Flags: gc.SizeF | gc.LeftRead | gc.RightRead}, - x86.AXCHGB & obj.AMask: {Flags: gc.SizeB | LeftRdwr | RightRdwr}, - x86.AXCHGL & obj.AMask: {Flags: gc.SizeL | LeftRdwr | RightRdwr}, - x86.AXCHGW & obj.AMask: {Flags: gc.SizeW | LeftRdwr | RightRdwr}, - x86.AXORB & obj.AMask: {Flags: gc.SizeB | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORL & obj.AMask: {Flags: gc.SizeL | gc.LeftRead | RightRdwr | gc.SetCarry}, - x86.AXORW & obj.AMask: {Flags: gc.SizeW | gc.LeftRead | RightRdwr | gc.SetCarry}, -} - -func proginfo(p *obj.Prog) gc.ProgInfo { - info := progtable[p.As&obj.AMask] - if info.Flags == 0 { - gc.Fatalf("unknown instruction %v", p) - } - - if info.Flags&gc.ImulAXDX != 0 && p.To.Type != obj.TYPE_NONE { - info.Flags |= RightRdwr - } - - return info -} -- 2.48.1