Commit 3578bdf3 authored by Dave Cheney's avatar Dave Cheney Committed by Aram Hăvărneanu

internal/obj/arm64: remove CASE and BCASE

Fixes #10994

CASE and BCASE were used by 7c in switch statements, cmd/compile
does not use them, cmd/assemble couldn't assemble them, and the arm64
peephole optimiser didn't know about them.

Change-Id: Id04835fcb37e207f76d211ce54a4db9c057d6112
Reviewed-on: https://go-review.googlesource.com/14100Reviewed-by: default avatarAram Hăvărneanu <aram@mgk.ro>
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 019297a9
...@@ -647,8 +647,6 @@ const ( ...@@ -647,8 +647,6 @@ const (
AWORD AWORD
ADYNT ADYNT
AINIT AINIT
ABCASE
ACASE
ADWORD ADWORD
ASIGNAME ASIGNAME
AGOK AGOK
......
...@@ -317,8 +317,6 @@ var Anames = []string{ ...@@ -317,8 +317,6 @@ var Anames = []string{
"WORD", "WORD",
"DYNT", "DYNT",
"INIT", "INIT",
"BCASE",
"CASE",
"DWORD", "DWORD",
"SIGNAME", "SIGNAME",
"GOK", "GOK",
......
...@@ -468,8 +468,6 @@ var optab = []Optab{ ...@@ -468,8 +468,6 @@ var optab = []Optab{
{AFCCMPS, C_COND, C_REG, C_VCON, 57, 4, 0, 0, 0}, {AFCCMPS, C_COND, C_REG, C_VCON, 57, 4, 0, 0, 0},
{AFCSELD, C_COND, C_REG, C_FREG, 18, 4, 0, 0, 0}, {AFCSELD, C_COND, C_REG, C_FREG, 18, 4, 0, 0, 0},
{AFCVTSD, C_FREG, C_NONE, C_FREG, 29, 4, 0, 0, 0}, {AFCVTSD, C_FREG, C_NONE, C_FREG, 29, 4, 0, 0, 0},
{ACASE, C_REG, C_NONE, C_REG, 62, 4 * 4, 0, 0, 0},
{ABCASE, C_NONE, C_NONE, C_SBRA, 63, 4, 0, 0, 0},
{ACLREX, C_NONE, C_NONE, C_VCON, 38, 4, 0, 0, 0}, {ACLREX, C_NONE, C_NONE, C_VCON, 38, 4, 0, 0, 0},
{ACLREX, C_NONE, C_NONE, C_NONE, 38, 4, 0, 0, 0}, {ACLREX, C_NONE, C_NONE, C_NONE, 38, 4, 0, 0, 0},
{ACBZ, C_REG, C_NONE, C_SBRA, 39, 4, 0, 0, 0}, {ACBZ, C_REG, C_NONE, C_SBRA, 39, 4, 0, 0, 0},
...@@ -1570,8 +1568,6 @@ func buildop(ctxt *obj.Link) { ...@@ -1570,8 +1568,6 @@ func buildop(ctxt *obj.Link) {
ADWORD, ADWORD,
obj.ARET, obj.ARET,
obj.ATEXT, obj.ATEXT,
ACASE,
ABCASE,
ASTP, ASTP,
ALDP: ALDP:
break break
...@@ -1801,7 +1797,6 @@ func SYSARG4(op1 int, Cn int, Cm int, op2 int) int { ...@@ -1801,7 +1797,6 @@ func SYSARG4(op1 int, Cn int, Cm int, op2 int) int {
} }
func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
var lastcase *obj.Prog
o1 := uint32(0) o1 := uint32(0)
o2 := uint32(0) o2 := uint32(0)
o3 := uint32(0) o3 := uint32(0)
...@@ -2699,28 +2694,6 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) { ...@@ -2699,28 +2694,6 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 = ADR(0, uint32(d), uint32(p.To.Reg)) o1 = ADR(0, uint32(d), uint32(p.To.Reg))
case 62: /* case Rv, Rt -> adr tab, Rt; movw Rt[R<<2], Rl; add Rt, Rl; br (Rl) */
// adr 4(pc), Rt
o1 = ADR(0, 4*4, uint32(p.To.Reg))
// movw Rt[Rv<<2], REGTMP
o2 = (2 << 30) | (7 << 27) | (2 << 22) | (1 << 21) | (3 << 13) | (1 << 12) | (2 << 10) | (uint32(p.From.Reg&31) << 16) | (uint32(p.To.Reg&31) << 5) | REGTMP&31
// add Rt, REGTMP
o3 = oprrr(ctxt, AADD) | (uint32(p.To.Reg) << 16) | (REGTMP << 5) | REGTMP
// br (REGTMP)
o4 = (0x6b << 25) | (0x1F << 16) | (REGTMP & 31 << 5)
lastcase = p
case 63: /* bcase */
if lastcase == nil {
ctxt.Diag("missing CASE\n%v", p)
break
}
if p.Pcond != nil {
o1 = uint32(p.Pcond.Pc - (lastcase.Pc + 4*4))
ctxt.Diag("FIXME: some relocation needed in bcase\n%v", p)
}
/* reloc ops */ /* reloc ops */
case 64: /* movT R,addr -> adrp + add + movT R, (REGTMP) */ case 64: /* movT R,addr -> adrp + add + movT R, (REGTMP) */
o1 = ADR(1, 0, REGTMP) o1 = ADR(1, 0, REGTMP)
......
...@@ -440,7 +440,7 @@ loop: ...@@ -440,7 +440,7 @@ loop:
if p.Pcond != nil { if p.Pcond != nil {
if a != ABL && p.Link != nil { if a != ABL && p.Link != nil {
q = obj.Brchain(ctxt, p.Link) q = obj.Brchain(ctxt, p.Link)
if a != obj.ATEXT && a != ABCASE { if a != obj.ATEXT {
if q != nil && (q.Mark&FOLL != 0) { if q != nil && (q.Mark&FOLL != 0) {
p.As = int16(relinv(a)) p.As = int16(relinv(a))
p.Link = p.Pcond p.Link = p.Pcond
...@@ -515,7 +515,6 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) { ...@@ -515,7 +515,6 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
ACBZW, ACBZW,
ATBZ, ATBZ,
ATBNZ, ATBNZ,
ABCASE,
AB, AB,
ABEQ, ABEQ,
ABNE, ABNE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment