From 775f11cda1d30f3f9778e737c2280cfe28ead1b4 Mon Sep 17 00:00:00 2001 From: eric fang Date: Tue, 12 Jan 2021 02:45:46 +0000 Subject: [PATCH] cmd/internal/obj/arm64: remove unncessary class check in addpool The argument class check in addpool is unnecessary, remove it so that we don't need to list all the compatiable classes. Change-Id: I36f6594db35e25db22fe898273e024c2db4cb771 Reviewed-on: https://go-review.googlesource.com/c/go/+/283492 Trust: eric fang Reviewed-by: Cherry Zhang --- src/cmd/internal/obj/arm64/asm7.go | 97 +----------------------------- 1 file changed, 2 insertions(+), 95 deletions(-) diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go index 3b0fa6fb53d..e9f18e1bf03 100644 --- a/src/cmd/internal/obj/arm64/asm7.go +++ b/src/cmd/internal/obj/arm64/asm7.go @@ -1251,101 +1251,8 @@ func (c *ctxt7) addpool(p *obj.Prog, a *obj.Addr) { sz = 8 } - switch cls { - // TODO(aram): remove. - default: - if a.Name != obj.NAME_EXTERN { - fmt.Printf("addpool: %v in %v shouldn't go to default case\n", DRconv(cls), p) - } - - t.To.Offset = a.Offset - t.To.Sym = a.Sym - t.To.Type = a.Type - t.To.Name = a.Name - - /* This is here because MOV uint12<<12, R is disabled in optab. - Because of this, we need to load the constant from memory. */ - case C_ADDCON: - fallthrough - - case C_ADDCON2, - C_LCON, - C_VCON, - C_LACON, - - C_ZAUTO, - C_NSAUTO_16, - C_NSAUTO_8, - C_NSAUTO_4, - C_NSAUTO, - C_NPAUTO_16, - C_NPAUTO, - C_NQAUTO_16, - C_NAUTO4K, - C_PSAUTO_16, - C_PSAUTO_8, - C_PSAUTO_4, - C_PSAUTO, - C_PPAUTO_16, - C_PPAUTO, - C_PQAUTO_16, - C_UAUTO4K_16, - C_UAUTO4K_8, - C_UAUTO4K_4, - C_UAUTO4K_2, - C_UAUTO4K, - C_UAUTO8K_16, - C_UAUTO8K_8, - C_UAUTO8K_4, - C_UAUTO8K, - C_UAUTO16K_16, - C_UAUTO16K_8, - C_UAUTO16K, - C_UAUTO32K_16, - C_UAUTO32K, - C_UAUTO64K, - C_LAUTO, - - C_ZOREG, - C_NSOREG_16, - C_NSOREG_8, - C_NSOREG_4, - C_NSOREG, - C_NPOREG_16, - C_NPOREG, - C_NQOREG_16, - C_NOREG4K, - C_PSOREG_16, - C_PSOREG_8, - C_PSOREG_4, - C_PSOREG, - C_PPOREG_16, - C_PPOREG, - C_PQOREG_16, - C_UOREG4K_16, - C_UOREG4K_8, - C_UOREG4K_4, - C_UOREG4K_2, - C_UOREG4K, - C_UOREG8K_16, - C_UOREG8K_8, - C_UOREG8K_4, - C_UOREG8K, - C_UOREG16K_16, - C_UOREG16K_8, - C_UOREG16K, - C_UOREG32K_16, - C_UOREG32K, - C_UOREG64K, - C_LOREG: - if a.Name == obj.NAME_EXTERN { - fmt.Printf("addpool: %v in %v needs reloc\n", DRconv(cls), p) - } - - t.To.Type = obj.TYPE_CONST - t.To.Offset = lit - break - } + t.To.Type = obj.TYPE_CONST + t.To.Offset = lit for q := c.blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */ if q.To == t.To {