They're each architecture-specific.
Let them share.
Reduces Prog size to 288, which is the
next smaller malloc class.
Reduces inuse_space while compiling the
rotate tests by ~3.2%.
Change-Id: Ica8ec90e466c97b569745fffff0e5acd364e55fa
Reviewed-on: https://go-review.googlesource.com/10514
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
t.To.Name = a.Name
if ctxt.Flag_shared != 0 && t.To.Sym != nil {
- t.Pcrel = p
+ t.Rel = p
}
case C_SROREG,
t.To.Offset = ctxt.Instoffset
}
- if t.Pcrel == nil {
+ if t.Rel == nil {
for q := ctxt.Blitrl; q != nil; q = q.Link { /* could hash on t.t0.offset */
- if q.Pcrel == nil && q.To == t.To {
+ if q.Rel == nil && q.To == t.To {
p.Pcond = q
return
}
if rel.Sym == ctxt.Tlsg && ctxt.Tlsg.Type == 0 {
rel.Type = obj.R_TLS
if ctxt.Flag_shared != 0 {
- rel.Add += ctxt.Pc - p.Pcrel.Pc - 8 - int64(rel.Siz)
+ rel.Add += ctxt.Pc - p.Rel.Pc - 8 - int64(rel.Siz)
}
} else if ctxt.Flag_shared != 0 {
rel.Type = obj.R_PCREL
- rel.Add += ctxt.Pc - p.Pcrel.Pc - 8
+ rel.Add += ctxt.Pc - p.Rel.Pc - 8
} else {
rel.Type = obj.R_ADDR
}
if o.flag&LPCREL != 0 {
rel.Type = obj.R_PCREL
- rel.Add += ctxt.Pc - p.Pcrel.Pc - 16 + int64(rel.Siz)
+ rel.Add += ctxt.Pc - p.Rel.Pc - 16 + int64(rel.Siz)
} else {
rel.Type = obj.R_ADDR
}
for p := casep; p != nil; p = p.Link {
if p.As == ABCASE {
for ; p != nil && p.As == ABCASE; p = p.Link {
- p.Pcrel = casep
+ p.Rel = casep
}
break
}
// TODO(rsc): Describe prog.
// TODO(rsc): Describe TEXT/GLOBL flag in from3, DATA width in from3.
type Prog struct {
- Ctxt *Link
- Link *Prog
- From Addr
- From3 *Addr // optional
- To Addr
- Opt interface{}
- Forwd *Prog
- Pcond *Prog
- Comefrom *Prog
- Pcrel *Prog
- Pc int64
- Lineno int32
- Spadj int32
- As int16
- Reg int16
- RegTo2 int16 // 2nd register output operand
- Mark uint16
- Optab uint16
- Scond uint8
- Back uint8
- Ft uint8
- Tt uint8
- Isize uint8
- Mode int8
+ Ctxt *Link
+ Link *Prog
+ From Addr
+ From3 *Addr // optional
+ To Addr
+ Opt interface{}
+ Forwd *Prog
+ Pcond *Prog
+ Rel *Prog // Source of forward jumps on x86; pcrel on arm
+ Pc int64
+ Lineno int32
+ Spadj int32
+ As int16
+ Reg int16
+ RegTo2 int16 // 2nd register output operand
+ Mark uint16
+ Optab uint16
+ Scond uint8
+ Back uint8
+ Ft uint8
+ Tt uint8
+ Isize uint8
+ Mode int8
Info ProgInfo
}
p.Pc = int64(c)
// process forward jumps to p
- for q = p.Comefrom; q != nil; q = q.Forwd {
+ for q = p.Rel; q != nil; q = q.Forwd {
v = int32(p.Pc - (q.Pc + int64(q.Mark)))
if q.Back&2 != 0 { // short
if v > 127 {
}
}
- p.Comefrom = nil
+ p.Rel = nil
p.Pc = int64(c)
asmins(ctxt, p)
}
// Annotate target; will fill in later.
- p.Forwd = q.Comefrom
+ p.Forwd = q.Rel
- q.Comefrom = p
+ q.Rel = p
if p.Back&2 != 0 { // short
if p.As == AJCXZL {
ctxt.Andptr[0] = 0x67