1
0
mirror of https://github.com/golang/go synced 2024-11-22 20:50:05 -07:00

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 <eric.fang@arm.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
eric fang 2021-01-12 02:45:46 +00:00
parent 27dbc4551a
commit 775f11cda1

View File

@ -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 {