Commit ebaf8db4 authored by Russ Cox's avatar Russ Cox

[dev.cc] cmd/internal/obj: export more symbols, rename Type_ to Type

For new assembler, reconvert using rsc.io/c2go rev f9db76e.
- Removes trailing _ from Go keywords that are exported.
- Export regstr as Register, anames[5689] as Anames.

Also update clients.

Change-Id: I41c8fd2d14490236f548b4aa0ed0b9bd7571d2d7
Reviewed-on: https://go-review.googlesource.com/3151Reviewed-by: default avatarRob Pike <r@golang.org>
parent 7522e135
package arm
var anames5 = []string{
var Anames = []string{
"XXX",
"AND",
"EOR",
......
......@@ -277,12 +277,12 @@ var zprg = obj.Prog{
Reg: NREG,
From: obj.Addr{
Name: D_NONE,
Type_: D_NONE,
Type: D_NONE,
Reg: NREG,
},
To: obj.Addr{
Name: D_NONE,
Type_: D_NONE,
Type: D_NONE,
Reg: NREG,
},
}
......@@ -362,7 +362,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
case AB,
ABL:
if p.To.Type_ != D_OREG {
if p.To.Type != D_OREG {
if out != nil {
asmout(ctxt, p, o, out)
}
......@@ -414,7 +414,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
AMOVW,
ASTREX,
ASTREXD:
if p.To.Type_ == D_REG && p.To.Reg == 15 && p.From.Reg == 13 { // MOVW.W x(R13), PC
if p.To.Type == D_REG && p.To.Reg == 15 && p.From.Reg == 13 { // MOVW.W x(R13), PC
if out != nil {
asmout(ctxt, p, o, out)
}
......@@ -454,11 +454,11 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
}
}
if p.To.Type_ == D_REG && p.To.Reg == 15 {
if p.To.Type == D_REG && p.To.Reg == 15 {
ctxt.Diag("unsupported instruction (move to another register and use indirect jump instead): %v", p)
}
if p.To.Type_ == D_OREG && p.To.Reg == 13 && (p.Scond&C_WBIT != 0) && size > 4 {
if p.To.Type == D_OREG && p.To.Reg == 13 && (p.Scond&C_WBIT != 0) && size > 4 {
// function prolog with very large frame size: MOVW.W R14,-100004(R13)
// split it into two instructions:
// ADD $-100004, R13
......@@ -468,7 +468,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
p.Scond &^= C_WBIT
*q = *p
a = &p.To
if p.To.Type_ == D_OREG {
if p.To.Type == D_OREG {
a2 = &q.To
} else {
......@@ -488,16 +488,16 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
p.From = *a
p.From.Reg = NREG
p.From.Type_ = D_CONST
p.From.Type = D_CONST
p.To = zprg.To
p.To.Type_ = D_REG
p.To.Type = D_REG
p.To.Reg = 13
// make q into p but load/store from 0(R13)
q.Spadj = 0
*a2 = zprg.From
a2.Type_ = D_OREG
a2.Type = D_OREG
a2.Reg = 13
a2.Sym = nil
a2.Offset = 0
......@@ -505,8 +505,8 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
break
}
if (p.To.Type_ == D_OREG && p.To.Reg != 13 && p.To.Reg != 9) || (p.From.Type_ == D_OREG && p.From.Reg != 13 && p.From.Reg != 9) { // MOVW Rx, X(Ry), y != 13 && y != 9 // MOVW X(Rx), Ry, x != 13 && x != 9
if p.To.Type_ == D_OREG {
if (p.To.Type == D_OREG && p.To.Reg != 13 && p.To.Reg != 9) || (p.From.Type == D_OREG && p.From.Reg != 13 && p.From.Reg != 9) { // MOVW Rx, X(Ry), y != 13 && y != 9 // MOVW X(Rx), Ry, x != 13 && x != 9
if p.To.Type == D_OREG {
a = &p.To
} else {
......@@ -548,7 +548,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
}
q = ctxt.Arch.Prg()
*q = *p
if p.To.Type_ == D_OREG {
if p.To.Type == D_OREG {
a2 = &q.To
} else {
......@@ -567,15 +567,15 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
p.As = AMOVW
p.From = *a
p.From.Type_ = D_CONST
p.From.Type = D_CONST
p.To = zprg.To
p.To.Type_ = D_REG
p.To.Type = D_REG
p.To.Reg = 11
// make q into p but load/store from 0(R11)
*a2 = zprg.From
a2.Type_ = D_OREG
a2.Type = D_OREG
a2.Reg = 11
a2.Sym = nil
a2.Offset = 0
......@@ -589,7 +589,7 @@ func asmoutnacl(ctxt *obj.Link, origPC int32, p *obj.Prog, o *Optab, out []uint3
}
// destination register specific
if p.To.Type_ == D_REG {
if p.To.Type == D_REG {
switch p.To.Reg {
case 9:
......@@ -701,7 +701,7 @@ func span5(ctxt *obj.Link, cursym *obj.LSym) {
break
}
if p.As == AMOVW && p.To.Type_ == D_REG && p.To.Reg == REGPC && p.Scond&C_SCOND == C_SCOND_NONE {
if p.As == AMOVW && p.To.Type == D_REG && p.To.Reg == REGPC && p.Scond&C_SCOND == C_SCOND_NONE {
flushpool(ctxt, p, 0, 0)
}
c += int32(m)
......@@ -896,7 +896,7 @@ func flushpool(ctxt *obj.Link, p *obj.Prog, skip int, force int) int {
}
q = ctxt.Arch.Prg()
q.As = AB
q.To.Type_ = D_BRANCH
q.To.Type = D_BRANCH
q.Pcond = p.Link
q.Link = ctxt.Blitrl
q.Lineno = p.Lineno
......@@ -950,7 +950,7 @@ func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) {
default:
t.To.Offset = a.Offset
t.To.Sym = a.Sym
t.To.Type_ = a.Type_
t.To.Type = a.Type
t.To.Name = a.Name
if ctxt.Flag_shared != 0 && t.To.Sym != nil {
......@@ -967,7 +967,7 @@ func addpool(ctxt *obj.Link, p *obj.Prog, a *obj.Addr) {
C_SAUTO,
C_LAUTO,
C_LACON:
t.To.Type_ = D_CONST
t.To.Type = D_CONST
t.To.Offset = ctxt.Instoffset
break
}
......@@ -1064,7 +1064,7 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
var s *obj.LSym
var t int
switch a.Type_ {
switch a.Type {
case D_NONE:
return C_NONE
......@@ -1291,7 +1291,7 @@ func oplook(ctxt *obj.Link, p *obj.Prog) *Optab {
if false { /*debug['O']*/
fmt.Printf("oplook %v %v %v %v\n", Aconv(int(p.As)), DRconv(a1), DRconv(a2), DRconv(a3))
fmt.Printf("\t\t%d %d\n", p.From.Type_, p.To.Type_)
fmt.Printf("\t\t%d %d\n", p.From.Type, p.To.Type)
}
e = oprange[r].stop
......@@ -1308,8 +1308,8 @@ func oplook(ctxt *obj.Link, p *obj.Prog) *Optab {
}
}
ctxt.Diag("illegal combination %v; %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type_, p.To.Type_)
ctxt.Diag("from %d %d to %d %d\n", p.From.Type_, p.From.Name, p.To.Type_, p.To.Name)
ctxt.Diag("illegal combination %v; %v %v %v, %d %d", p, DRconv(a1), DRconv(a2), DRconv(a3), p.From.Type, p.To.Type)
ctxt.Diag("from %d %d to %d %d\n", p.From.Type, p.From.Name, p.To.Type, p.To.Name)
prasm(p)
if o == nil {
o = optab
......@@ -1627,7 +1627,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
rf = int(p.From.Reg)
rt = int(p.To.Reg)
r = int(p.Reg)
if p.To.Type_ == D_NONE {
if p.To.Type == D_NONE {
rt = 0
}
if p.As == AMOVB || p.As == AMOVH || p.As == AMOVW || p.As == AMVN {
......@@ -1644,7 +1644,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 |= uint32(immrot(uint32(ctxt.Instoffset)))
rt = int(p.To.Reg)
r = int(p.Reg)
if p.To.Type_ == D_NONE {
if p.To.Type == D_NONE {
rt = 0
}
if p.As == AMOVW || p.As == AMVN {
......@@ -1680,7 +1680,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
rel.Sym = p.To.Sym
v += int32(p.To.Offset)
rel.Add = int64(o1) | (int64(v)>>2)&0xffffff
rel.Type_ = obj.R_CALLARM
rel.Type = obj.R_CALLARM
break
}
......@@ -1708,7 +1708,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
rel = obj.Addrel(ctxt.Cursym)
rel.Off = int32(ctxt.Pc)
rel.Siz = 0
rel.Type_ = obj.R_CALLIND
rel.Type = obj.R_CALLIND
case 8: /* sll $c,[R],R -> mov (R<<$c),R */
aclass(ctxt, &p.From)
......@@ -1736,7 +1736,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
case 10: /* swi [$con] */
o1 = oprrr(ctxt, int(p.As), int(p.Scond))
if p.To.Type_ != D_NONE {
if p.To.Type != D_NONE {
aclass(ctxt, &p.To)
o1 |= uint32(ctxt.Instoffset & 0xffffff)
}
......@@ -1761,18 +1761,18 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
// Emit a TLS relocation instead of a standard one.
if rel.Sym == ctxt.Tlsg {
rel.Type_ = obj.R_TLS
rel.Type = obj.R_TLS
if ctxt.Flag_shared != 0 {
rel.Add += ctxt.Pc - p.Pcrel.Pc - 8 - int64(rel.Siz)
}
rel.Xadd = rel.Add
rel.Xsym = rel.Sym
} else if ctxt.Flag_shared != 0 {
rel.Type_ = obj.R_PCREL
rel.Type = obj.R_PCREL
rel.Add += ctxt.Pc - p.Pcrel.Pc - 8
} else {
rel.Type_ = obj.R_ADDR
rel.Type = obj.R_ADDR
}
o1 = 0
}
......@@ -1799,7 +1799,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(p.To.Reg)
}
o2 |= uint32(r) << 16
if p.To.Type_ != D_NONE {
if p.To.Type != D_NONE {
o2 |= uint32(p.To.Reg) << 12
}
......@@ -1926,7 +1926,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(o.param)
}
o2 |= uint32(r) << 16
if p.To.Type_ != D_NONE {
if p.To.Type != D_NONE {
o2 |= uint32(p.To.Reg) << 12
}
......@@ -2088,7 +2088,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 |= uint32(immrot(0xff))
rt = int(p.To.Reg)
r = int(p.From.Reg)
if p.To.Type_ == D_NONE {
if p.To.Type == D_NONE {
rt = 0
}
if r == NREG {
......@@ -2157,7 +2157,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
rel = obj.Addrel(ctxt.Cursym)
rel.Off = int32(ctxt.Pc)
rel.Siz = 4
if p.To.Sym != nil && p.To.Sym.Type_ != 0 {
if p.To.Sym != nil && p.To.Sym.Type != 0 {
rel.Sym = p.To.Sym
rel.Add = p.To.Offset
} else {
......@@ -2167,11 +2167,11 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
}
if o.flag&LPCREL != 0 {
rel.Type_ = obj.R_PCREL
rel.Type = obj.R_PCREL
rel.Add += ctxt.Pc - p.Pcrel.Pc - 16 + int64(rel.Siz)
} else {
rel.Type_ = obj.R_ADDR
rel.Type = obj.R_ADDR
}
o1 = 0
}
......@@ -2550,7 +2550,7 @@ func mov(ctxt *obj.Link, p *obj.Prog) uint32 {
o1 |= uint32(p.From.Offset)
rt = int(p.To.Reg)
r = int(p.Reg)
if p.To.Type_ == D_NONE {
if p.To.Type == D_NONE {
rt = 0
}
if p.As == AMOVW || p.As == AMVN {
......
......@@ -84,9 +84,9 @@ func Pconv(p *obj.Prog) string {
sc += ".U"
}
if a == AMOVM {
if p.From.Type_ == D_CONST {
if p.From.Type == D_CONST {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, RAconv(&p.From), Dconv(p, 0, &p.To))
} else if p.To.Type_ == D_CONST {
} else if p.To.Type == D_CONST {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), RAconv(&p.To))
} else {
......@@ -98,7 +98,7 @@ func Pconv(p *obj.Prog) string {
str = fmt.Sprintf("%.5d (%v)\t%v\t%v,%d,%v", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
} else if p.Reg == NREG {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
} else if p.From.Type_ != D_FREG {
} else if p.From.Type != D_FREG {
str = fmt.Sprintf("%.5d (%v)\t%v%s\t%v,R%d,%v", p.Pc, p.Line(), Aconv(a), sc, Dconv(p, 0, &p.From), p.Reg, Dconv(p, 0, &p.To))
} else {
......@@ -115,7 +115,7 @@ func Aconv(a int) string {
s = "???"
if a >= AXXX && a < ALAST {
s = anames5[a]
s = Anames[a]
}
fp += s
return fp
......@@ -128,9 +128,9 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
var op string
var v int
switch a.Type_ {
switch a.Type {
default:
str = fmt.Sprintf("GOK-type(%d)", a.Type_)
str = fmt.Sprintf("GOK-type(%d)", a.Type)
case D_NONE:
str = ""
......@@ -220,7 +220,7 @@ func RAconv(a *obj.Addr) string {
var v int
str = fmt.Sprintf("GOK-reglist")
switch a.Type_ {
switch a.Type {
case D_CONST,
D_CONST2:
if a.Reg != NREG {
......
This diff is collapsed.
......@@ -67,7 +67,7 @@ func savedata(ctxt *Link, s *LSym, p *Prog, pn string) {
}
Symgrow(ctxt, s, int64(off+siz))
switch int(p.To.Type_) {
switch int(p.To.Type) {
default:
ctxt.Diag("bad data: %P", p)
......@@ -89,12 +89,12 @@ func savedata(ctxt *Link, s *LSym, p *Prog, pn string) {
copy(s.P[off:off+siz], p.To.U.Sval)
case ctxt.Arch.D_CONST, ctxt.Arch.D_ADDR:
if p.To.Sym != nil || int(p.To.Type_) == ctxt.Arch.D_ADDR {
if p.To.Sym != nil || int(p.To.Type) == ctxt.Arch.D_ADDR {
r := Addrel(s)
r.Off = off
r.Siz = uint8(siz)
r.Sym = p.To.Sym
r.Type_ = R_ADDR
r.Type = R_ADDR
r.Add = p.To.Offset
break
}
......@@ -120,8 +120,8 @@ func Addrel(s *LSym) *Reloc {
}
func setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 {
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
if s.Size < off+wid {
......@@ -187,8 +187,8 @@ func addaddrplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
var i int64
var r *Reloc
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
i = s.Size
......@@ -198,7 +198,7 @@ func addaddrplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
r.Sym = t
r.Off = int32(i)
r.Siz = uint8(ctxt.Arch.Ptrsize)
r.Type_ = R_ADDR
r.Type = R_ADDR
r.Add = add
return i + int64(r.Siz)
}
......@@ -207,8 +207,8 @@ func addpcrelplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
var i int64
var r *Reloc
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
i = s.Size
......@@ -218,7 +218,7 @@ func addpcrelplus(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
r.Sym = t
r.Off = int32(i)
r.Add = add
r.Type_ = R_PCREL
r.Type = R_PCREL
r.Siz = 4
return i + int64(r.Siz)
}
......@@ -230,8 +230,8 @@ func addaddr(ctxt *Link, s *LSym, t *LSym) int64 {
func setaddrplus(ctxt *Link, s *LSym, off int64, t *LSym, add int64) int64 {
var r *Reloc
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
if off+int64(ctxt.Arch.Ptrsize) > s.Size {
......@@ -243,7 +243,7 @@ func setaddrplus(ctxt *Link, s *LSym, off int64, t *LSym, add int64) int64 {
r.Sym = t
r.Off = int32(off)
r.Siz = uint8(ctxt.Arch.Ptrsize)
r.Type_ = R_ADDR
r.Type = R_ADDR
r.Add = add
return off + int64(r.Siz)
}
......@@ -256,8 +256,8 @@ func addsize(ctxt *Link, s *LSym, t *LSym) int64 {
var i int64
var r *Reloc
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
i = s.Size
......@@ -267,7 +267,7 @@ func addsize(ctxt *Link, s *LSym, t *LSym) int64 {
r.Sym = t
r.Off = int32(i)
r.Siz = uint8(ctxt.Arch.Ptrsize)
r.Type_ = R_SIZE
r.Type = R_SIZE
return i + int64(r.Siz)
}
......@@ -275,8 +275,8 @@ func addaddrplus4(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
var i int64
var r *Reloc
if s.Type_ == 0 {
s.Type_ = SDATA
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
i = s.Size
......@@ -286,7 +286,7 @@ func addaddrplus4(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
r.Sym = t
r.Off = int32(i)
r.Siz = 4
r.Type_ = R_ADDR
r.Type = R_ADDR
r.Add = add
return i + int64(r.Siz)
}
......@@ -3,7 +3,7 @@ package i386
/*
* this is the ranlib header
*/
var anames8 = []string{
var Anames = []string{
"XXX",
"AAA",
"AAD",
......
This diff is collapsed.
......@@ -69,7 +69,7 @@ func Pconv(p *obj.Prog) string {
func Aconv(i int) string {
var fp string
fp += anames8[i]
fp += Anames[i]
return fp
}
......@@ -80,7 +80,7 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
var i int
i = int(a.Type_)
i = int(a.Type)
if flag&fmtLong != 0 /*untyped*/ {
if i == D_CONST2 {
......@@ -166,11 +166,11 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
str = fmt.Sprintf("$\"%q\"", a.U.Sval)
case D_ADDR:
a.Type_ = int16(a.Index)
a.Type = int16(a.Index)
a.Index = D_NONE
str = fmt.Sprintf("$%v", Dconv(p, 0, a))
a.Index = uint8(a.Type_)
a.Type_ = D_ADDR
a.Index = uint8(a.Type)
a.Type = D_ADDR
goto conv
}
......@@ -185,7 +185,7 @@ conv:
return fp
}
var regstr = []string{
var Register = []string{
"AL", /* [D_AL] */
"CL",
"DL",
......@@ -262,7 +262,7 @@ func Rconv(r int) string {
var fp string
if r >= D_AL && r <= D_NONE {
str = fmt.Sprintf("%s", regstr[r-D_AL])
str = fmt.Sprintf("%s", Register[r-D_AL])
} else {
str = fmt.Sprintf("gok(%d)", r)
......
This diff is collapsed.
......@@ -41,7 +41,7 @@ type Addr struct {
}
Sym *LSym
Gotype *LSym
Type_ int16
Type int16
Index uint8
Scale int8
Reg int8
......@@ -85,7 +85,7 @@ type Prog struct {
type LSym struct {
Name string
Extname string
Type_ int16
Type int16
Version int16
Dupok uint8
Cfunc uint8
......@@ -137,7 +137,7 @@ type Reloc struct {
Off int32
Siz uint8
Done uint8
Type_ int32
Type int32
Variant int32
Add int64
Xadd int64
......@@ -149,7 +149,7 @@ type Auto struct {
Asym *LSym
Link *Auto
Aoffset int32
Type_ int16
Type int16
Gotype *LSym
}
......
......@@ -72,7 +72,7 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
a = new(Auto)
a.Asym = p.From.Sym
a.Aoffset = int32(p.From.Offset)
a.Type_ = int16(ctxt.Arch.Symtype(&p.From))
a.Type = int16(ctxt.Arch.Symtype(&p.From))
a.Gotype = p.From.Gotype
a.Link = curtext.Autom
curtext.Autom = a
......@@ -98,17 +98,17 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
}
s.Next = nil
s.Size = p.To.Offset
if s.Type_ == 0 || s.Type_ == SXREF {
s.Type_ = SBSS
if s.Type == 0 || s.Type == SXREF {
s.Type = SBSS
}
flag = ctxt.Arch.Textflag(p)
if flag&DUPOK != 0 {
s.Dupok = 1
}
if flag&RODATA != 0 {
s.Type_ = SRODATA
s.Type = SRODATA
} else if flag&NOPTR != 0 {
s.Type_ = SNOPTRBSS
s.Type = SNOPTRBSS
}
edata = s
continue
......@@ -150,7 +150,7 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
s.Nosplit = 1
}
s.Next = nil
s.Type_ = STEXT
s.Type = STEXT
s.Text = p
s.Etext = p
curtext = s
......@@ -163,7 +163,7 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
continue
}
if p.To.Sym.Name == "go_args_stackmap" {
if int(p.From.Type_) != ctxt.Arch.D_CONST || p.From.Offset != FUNCDATA_ArgsPointerMaps {
if int(p.From.Type) != ctxt.Arch.D_CONST || p.From.Offset != FUNCDATA_ArgsPointerMaps {
ctxt.Diag("FUNCDATA use of go_args_stackmap(SB) without FUNCDATA_ArgsPointerMaps")
}
p.To.Sym = Linklookup(ctxt, string(fmt.Sprintf("%s.args_stackmap", curtext.Name)), int(curtext.Version))
......@@ -187,7 +187,7 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
}
found = 0
for p = s.Text; p != nil; p = p.Link {
if int(p.As) == ctxt.Arch.AFUNCDATA && int(p.From.Type_) == ctxt.Arch.D_CONST && p.From.Offset == FUNCDATA_ArgsPointerMaps {
if int(p.As) == ctxt.Arch.AFUNCDATA && int(p.From.Type) == ctxt.Arch.D_CONST && p.From.Offset == FUNCDATA_ArgsPointerMaps {
found = 1
break
}
......@@ -196,13 +196,13 @@ func Writeobjdirect(ctxt *Link, b *Biobuf) {
if !(found != 0) {
p = Appendp(ctxt, s.Text)
p.As = int16(ctxt.Arch.AFUNCDATA)
p.From.Type_ = int16(ctxt.Arch.D_CONST)
p.From.Type = int16(ctxt.Arch.D_CONST)
p.From.Offset = FUNCDATA_ArgsPointerMaps
if ctxt.Arch.Thechar == '6' || ctxt.Arch.Thechar == '8' {
p.To.Type_ = int16(ctxt.Arch.D_EXTERN)
p.To.Type = int16(ctxt.Arch.D_EXTERN)
} else {
p.To.Type_ = int16(ctxt.Arch.D_OREG)
p.To.Type = int16(ctxt.Arch.D_OREG)
p.To.Name = int8(ctxt.Arch.D_EXTERN)
}
......@@ -269,8 +269,8 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
if s.Version != 0 {
fmt.Fprintf(ctxt.Bso, "v=%d ", s.Version)
}
if s.Type_ != 0 {
fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type_)
if s.Type != 0 {
fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type)
}
if s.Dupok != 0 {
fmt.Fprintf(ctxt.Bso, "dupok ")
......@@ -282,7 +282,7 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
fmt.Fprintf(ctxt.Bso, "nosplit ")
}
fmt.Fprintf(ctxt.Bso, "size=%d value=%d", int64(s.Size), int64(s.Value))
if s.Type_ == STEXT {
if s.Type == STEXT {
fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Args), uint64(s.Locals))
if s.Leaf != 0 {
fmt.Fprintf(ctxt.Bso, " leaf")
......@@ -323,16 +323,16 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
name = r.Sym.Name
}
if ctxt.Arch.Thechar == '5' || ctxt.Arch.Thechar == '9' {
fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type_, name, uint64(int64(r.Add)))
fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(int64(r.Add)))
} else {
fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type_, name, int64(r.Add))
fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, int64(r.Add))
}
}
}
Bputc(b, 0xfe)
wrint(b, int64(s.Type_))
wrint(b, int64(s.Type))
wrstring(b, s.Name)
wrint(b, int64(s.Version))
wrint(b, int64(s.Dupok))
......@@ -345,14 +345,14 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
r = &s.R[i]
wrint(b, int64(r.Off))
wrint(b, int64(r.Siz))
wrint(b, int64(r.Type_))
wrint(b, int64(r.Type))
wrint(b, r.Add)
wrint(b, r.Xadd)
wrsym(b, r.Sym)
wrsym(b, r.Xsym)
}
if s.Type_ == STEXT {
if s.Type == STEXT {
wrint(b, int64(s.Args))
wrint(b, int64(s.Locals))
wrint(b, int64(s.Nosplit))
......@@ -365,13 +365,13 @@ func writesym(ctxt *Link, b *Biobuf, s *LSym) {
for a = s.Autom; a != nil; a = a.Link {
wrsym(b, a.Asym)
wrint(b, int64(a.Aoffset))
if int(a.Type_) == ctxt.Arch.D_AUTO {
if int(a.Type) == ctxt.Arch.D_AUTO {
wrint(b, A_AUTO)
} else if int(a.Type_) == ctxt.Arch.D_PARAM {
} else if int(a.Type) == ctxt.Arch.D_PARAM {
wrint(b, A_PARAM)
} else {
log.Fatalf("%s: invalid local variable type %d", s.Name, a.Type_)
log.Fatalf("%s: invalid local variable type %d", s.Name, a.Type)
}
wrsym(b, a.Gotype)
}
......
......@@ -76,7 +76,7 @@ func linkpatch(ctxt *Link, sym *LSym) {
if ctxt.Arch.Progedit != nil {
ctxt.Arch.Progedit(ctxt, p)
}
if int(p.To.Type_) != ctxt.Arch.D_BRANCH {
if int(p.To.Type) != ctxt.Arch.D_BRANCH {
continue
}
if p.To.U.Branch != nil {
......@@ -108,7 +108,7 @@ func linkpatch(ctxt *Link, sym *LSym) {
name = p.To.Sym.Name
}
ctxt.Diag("branch out of range (%#x)\n%v [%s]", uint32(c), p, name)
p.To.Type_ = int16(ctxt.Arch.D_NONE)
p.To.Type = int16(ctxt.Arch.D_NONE)
}
p.To.U.Branch = q
......@@ -120,7 +120,7 @@ func linkpatch(ctxt *Link, sym *LSym) {
if p.Pcond != nil {
p.Pcond = brloop(ctxt, p.Pcond)
if p.Pcond != nil {
if int(p.To.Type_) == ctxt.Arch.D_BRANCH {
if int(p.To.Type) == ctxt.Arch.D_BRANCH {
p.To.Offset = p.Pcond.Pc
}
}
......
......@@ -293,7 +293,7 @@ func linkpcln(ctxt *Link, cursym *LSym) {
if int(p.As) == ctxt.Arch.AFUNCDATA {
i = int(p.From.Offset)
pcln.Funcdataoff[i] = p.To.Offset
if int(p.To.Type_) != ctxt.Arch.D_CONST {
if int(p.To.Type) != ctxt.Arch.D_CONST {
// TODO: Dedup.
//funcdata_bytes += p->to.sym->size;
pcln.Funcdata[i] = p.To.Sym
......
......@@ -5,7 +5,7 @@ package ppc64
/*
* this is the ranlib header
*/
var anames9 = []string{
var Anames = []string{
"XXX",
"ADD",
"ADDCC",
......
......@@ -479,14 +479,14 @@ func span9(ctxt *obj.Link, cursym *obj.LSym) {
q.Link = p.Link
p.Link = q
q.As = ABR
q.To.Type_ = D_BRANCH
q.To.Type = D_BRANCH
q.Pcond = p.Pcond
p.Pcond = q
q = ctxt.Arch.Prg()
q.Link = p.Link
p.Link = q
q.As = ABR
q.To.Type_ = D_BRANCH
q.To.Type = D_BRANCH
q.Pcond = q.Link.Link
//addnop(p->link);
......@@ -549,7 +549,7 @@ func isuint32(v uint64) int {
func aclass(ctxt *obj.Link, a *obj.Addr) int {
var s *obj.LSym
switch a.Type_ {
switch a.Type {
case D_NONE:
return C_NONE
......@@ -652,7 +652,7 @@ func aclass(ctxt *obj.Link, a *obj.Addr) int {
if s == nil {
break
}
if s.Type_ == obj.SCONST {
if s.Type == obj.SCONST {
ctxt.Instoffset = s.Value + a.Offset
goto consize
}
......@@ -1405,7 +1405,7 @@ func addaddrreloc(ctxt *obj.Link, s *obj.LSym, o1 *uint32, o2 *uint32) {
rel.Siz = 8
rel.Sym = s
rel.Add = int64(uint64(*o1)<<32 | uint64(uint32(*o2)))
rel.Type_ = obj.R_ADDRPOWER
rel.Type = obj.R_ADDRPOWER
}
/*
......@@ -1543,7 +1543,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
break
case 1: /* mov r1,r2 ==> OR Rs,Rs,Ra */
if p.To.Reg == REGZERO && p.From.Type_ == D_CONST {
if p.To.Reg == REGZERO && p.From.Type == D_CONST {
v = regoff(ctxt, &p.From)
if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 {
......@@ -1630,7 +1630,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(o.param)
}
v = regoff(ctxt, &p.To)
if p.To.Type_ == D_OREG && p.Reg != NREG {
if p.To.Type == D_OREG && p.Reg != NREG {
if v != 0 {
ctxt.Diag("illegal indexed instruction\n%v", p)
}
......@@ -1650,7 +1650,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(o.param)
}
v = regoff(ctxt, &p.From)
if p.From.Type_ == D_OREG && p.Reg != NREG {
if p.From.Type == D_OREG && p.Reg != NREG {
if v != 0 {
ctxt.Diag("illegal indexed instruction\n%v", p)
}
......@@ -1670,7 +1670,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(o.param)
}
v = regoff(ctxt, &p.From)
if p.From.Type_ == D_OREG && p.Reg != NREG {
if p.From.Type == D_OREG && p.Reg != NREG {
if v != 0 {
ctxt.Diag("illegal indexed instruction\n%v", p)
}
......@@ -1717,11 +1717,11 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
}
rel.Add = int64(v)
rel.Type_ = obj.R_CALLPOWER
rel.Type = obj.R_CALLPOWER
}
case 12: /* movb r,r (extsb); movw r,r (extsw) */
if p.To.Reg == REGZERO && p.From.Type_ == D_CONST {
if p.To.Reg == REGZERO && p.From.Type == D_CONST {
v = regoff(ctxt, &p.From)
if r0iszero != 0 /*TypeKind(100016)*/ && v != 0 {
......@@ -1792,7 +1792,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
16: /* bc bo,bi,sbra */
a = 0
if p.From.Type_ == D_CONST {
if p.From.Type == D_CONST {
a = int(regoff(ctxt, &p.From))
}
r = int(p.Reg)
......@@ -2080,7 +2080,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
rel.Siz = 8
rel.Sym = p.From.Sym
rel.Add = p.From.Offset
rel.Type_ = obj.R_ADDR
rel.Type = obj.R_ADDR
o2 = 0
o1 = o2
}
......@@ -2188,7 +2188,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 = LOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.To.Reg), uint32(r), 0)
case 49: /* op Rb; op $n, Rb */
if p.From.Type_ != D_REG { /* tlbie $L, rB */
if p.From.Type != D_REG { /* tlbie $L, rB */
v = regoff(ctxt, &p.From) & 1
o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), 0, 0, uint32(p.To.Reg)) | uint32(v)<<21
} else {
......@@ -2342,7 +2342,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 |= (uint32(mask[0])&31)<<6 | (uint32(mask[1])&31)<<1
case 64: /* mtfsf fr[, $m] {,fpcsr} */
if p.From3.Type_ != D_NONE {
if p.From3.Type != D_NONE {
v = regoff(ctxt, &p.From3) & 255
} else {
......@@ -2359,11 +2359,11 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 = OP_MTFSFI | (uint32(p.To.Reg)&15)<<23 | (uint32(regoff(ctxt, &p.From))&31)<<12
case 66: /* mov spr,r1; mov r1,spr, also dcr */
if p.From.Type_ == D_REG {
if p.From.Type == D_REG {
r = int(p.From.Reg)
v = int32(p.To.Offset)
if p.To.Type_ == D_DCR {
if p.To.Type == D_DCR {
o1 = OPVCC(31, 451, 0, 0) /* mtdcr */
} else {
......@@ -2373,7 +2373,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
r = int(p.To.Reg)
v = int32(p.From.Offset)
if p.From.Type_ == D_DCR {
if p.From.Type == D_DCR {
o1 = OPVCC(31, 323, 0, 0) /* mfdcr */
} else {
......@@ -2384,14 +2384,14 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 = AOP_RRR(o1, uint32(r), 0, 0) | (uint32(v)&0x1f)<<16 | ((uint32(v)>>5)&0x1f)<<11
case 67: /* mcrf crfD,crfS */
if p.From.Type_ != D_CREG || p.From.Reg == NREG || p.To.Type_ != D_CREG || p.To.Reg == NREG {
if p.From.Type != D_CREG || p.From.Reg == NREG || p.To.Type != D_CREG || p.To.Reg == NREG {
ctxt.Diag("illegal CR field number\n%v", p)
}
o1 = AOP_RRR(OP_MCRF, ((uint32(p.To.Reg) & 7) << 2), ((uint32(p.From.Reg) & 7) << 2), 0)
case 68: /* mfcr rD; mfocrf CRM,rD */
if p.From.Type_ == D_CREG && p.From.Reg != NREG {
if p.From.Type == D_CREG && p.From.Reg != NREG {
v = 1 << uint(7-(p.To.Reg&7)) /* CR(n) */
o1 = AOP_RRR(OP_MFCR, uint32(p.To.Reg), 0, 0) | 1<<20 | uint32(v)<<12 /* new form, mfocrf */
......@@ -2401,7 +2401,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
}
case 69: /* mtcrf CRM,rS */
if p.From3.Type_ != D_NONE {
if p.From3.Type != D_NONE {
if p.To.Reg != NREG {
ctxt.Diag("can't use both mask and CR(n)\n%v", p)
......@@ -2443,20 +2443,20 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
o1 = AOP_RRR(uint32(oprrr(ctxt, int(p.As))), uint32(p.From.Reg), 0, uint32(p.To.Reg))
case 73: /* mcrfs crfD,crfS */
if p.From.Type_ != D_FPSCR || p.From.Reg == NREG || p.To.Type_ != D_CREG || p.To.Reg == NREG {
if p.From.Type != D_FPSCR || p.From.Reg == NREG || p.To.Type != D_CREG || p.To.Reg == NREG {
ctxt.Diag("illegal FPSCR/CR field number\n%v", p)
}
o1 = AOP_RRR(OP_MCRFS, ((uint32(p.To.Reg) & 7) << 2), ((uint32(p.From.Reg) & 7) << 2), 0)
case 77: /* syscall $scon, syscall Rx */
if p.From.Type_ == D_CONST {
if p.From.Type == D_CONST {
if p.From.Offset > BIG || p.From.Offset < -BIG {
ctxt.Diag("illegal syscall, sysnum too large: %v", p)
}
o1 = AOP_IRR(OP_ADDI, REGZERO, REGZERO, uint32(p.From.Offset))
} else if p.From.Type_ == D_REG {
} else if p.From.Type == D_REG {
o1 = LOP_RRR(OP_OR, REGZERO, uint32(p.From.Reg), uint32(p.From.Reg))
} else {
......
......@@ -84,24 +84,24 @@ func Pconv(p *obj.Prog) string {
if p.Mark&NOSCHED != 0 {
str += fmt.Sprintf("*")
}
if p.Reg == NREG && p.From3.Type_ == D_NONE {
if p.Reg == NREG && p.From3.Type == D_NONE {
str += fmt.Sprintf("%.5d (%v)\t%v\t%v,%v", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From), Dconv(p, 0, &p.To))
} else if a != ATEXT && p.From.Type_ == D_OREG {
} else if a != ATEXT && p.From.Type == D_OREG {
str += fmt.Sprintf("%.5d (%v)\t%v\t%d(R%d+R%d),%v", p.Pc, p.Line(), Aconv(a), p.From.Offset, p.From.Reg, p.Reg, Dconv(p, 0, &p.To))
} else if p.To.Type_ == D_OREG {
} else if p.To.Type == D_OREG {
str += fmt.Sprintf("%.5d (%v)\t%v\t%v,%d(R%d+R%d)", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From), p.To.Offset, p.To.Reg, p.Reg)
} else {
str += fmt.Sprintf("%.5d (%v)\t%v\t%v", p.Pc, p.Line(), Aconv(a), Dconv(p, 0, &p.From))
if p.Reg != NREG {
ch = 'R'
if p.From.Type_ == D_FREG {
if p.From.Type == D_FREG {
ch = 'F'
}
str += fmt.Sprintf(",%c%d", ch, p.Reg)
}
if p.From3.Type_ != D_NONE {
if p.From3.Type != D_NONE {
str += fmt.Sprintf(",%v", Dconv(p, 0, &p.From3))
}
str += fmt.Sprintf(",%v", Dconv(p, 0, &p.To))
......@@ -123,7 +123,7 @@ func Aconv(a int) string {
s = "???"
if a >= AXXX && a < ALAST {
s = anames9[a]
s = Anames[a]
}
fp += s
return fp
......@@ -136,7 +136,7 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
var v int32
if flag&fmtLong != 0 /*untyped*/ {
if a.Type_ == D_CONST {
if a.Type == D_CONST {
str = fmt.Sprintf("$%d-%d", int32(a.Offset), int32(a.Offset>>32))
} else {
......@@ -147,9 +147,9 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
goto ret
}
switch a.Type_ {
switch a.Type {
default:
str = fmt.Sprintf("GOK-type(%d)", a.Type_)
str = fmt.Sprintf("GOK-type(%d)", a.Type)
case D_NONE:
str = ""
......
This diff is collapsed.
......@@ -234,7 +234,7 @@ func linknewsym(ctxt *Link, symb string, v int) *LSym {
s.Plt = -1
s.Got = -1
s.Name = symb
s.Type_ = 0
s.Type = 0
s.Version = int16(v)
s.Value = 0
s.Sig = 0
......
......@@ -3,7 +3,7 @@ package x86
/*
* this is the ranlib header
*/
var anames6 = []string{
var Anames = []string{
"XXX",
"AAA",
"AAD",
......
This diff is collapsed.
......@@ -82,7 +82,7 @@ func Pconv(p *obj.Prog) string {
func Aconv(i int) string {
var fp string
fp += anames6[i]
fp += Anames[i]
return fp
}
......@@ -93,7 +93,7 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
var i int
i = int(a.Type_)
i = int(a.Type)
if flag&fmtLong != 0 /*untyped*/ {
if i == D_CONST {
......@@ -173,11 +173,11 @@ func Dconv(p *obj.Prog, flag int, a *obj.Addr) string {
str = fmt.Sprintf("$\"%q\"", a.U.Sval)
case D_ADDR:
a.Type_ = int16(a.Index)
a.Type = int16(a.Index)
a.Index = D_NONE
str = fmt.Sprintf("$%v", Dconv(p, 0, a))
a.Index = uint8(a.Type_)
a.Type_ = D_ADDR
a.Index = uint8(a.Type)
a.Type = D_ADDR
goto conv
}
......@@ -192,7 +192,7 @@ conv:
return fp
}
var regstr = []string{
var Register = []string{
"AL", /* [D_AL] */
"CL",
"DL",
......@@ -313,7 +313,7 @@ func Rconv(r int) string {
var fp string
if r >= D_AL && r <= D_NONE {
str = fmt.Sprintf("%s", regstr[r-D_AL])
str = fmt.Sprintf("%s", Register[r-D_AL])
} else {
str = fmt.Sprintf("gok(%d)", r)
......
This diff is collapsed.
......@@ -179,7 +179,7 @@ inst:
var g obj.Addr
g = nullgen;
g.Type_ = D_CONST;
g.Type = D_CONST;
g.Offset = int64($6);
outcode($1, $2, &$3, NREG, &g);
}
......@@ -188,7 +188,7 @@ inst:
var g obj.Addr
g = nullgen;
g.Type_ = D_CONST;
g.Type = D_CONST;
g.Offset = int64($4);
outcode($1, $2, &g, NREG, &$7);
}
......@@ -220,21 +220,21 @@ inst:
| LTYPEB name ',' imm
{
asm.Settext($2.Sym);
$4.Type_ = D_CONST2;
$4.Type = D_CONST2;
$4.Offset2 = -obj.ArgsSizeUnknown;
outcode($1, Always, &$2, 0, &$4);
}
| LTYPEB name ',' con ',' imm
{
asm.Settext($2.Sym);
$6.Type_ = D_CONST2;
$6.Type = D_CONST2;
$6.Offset2 = -obj.ArgsSizeUnknown;
outcode($1, Always, &$2, $4, &$6);
}
| LTYPEB name ',' con ',' imm '-' con
{
asm.Settext($2.Sym);
$6.Type_ = D_CONST2;
$6.Type = D_CONST2;
$6.Offset2 = $8;
outcode($1, Always, &$2, $4, &$6);
}
......@@ -286,7 +286,7 @@ inst:
var g obj.Addr
g = nullgen;
g.Type_ = D_CONST;
g.Type = D_CONST;
g.Offset = int64(
(0xe << 24) | /* opcode */
($1 << 20) | /* MCR/MRC */
......@@ -313,7 +313,7 @@ inst:
*/
| LTYPEN cond reg ',' reg ',' reg ',' spreg
{
$7.Type_ = D_REGREG2;
$7.Type = D_REGREG2;
$7.Offset = int64($9);
outcode($1, $2, &$3, int32($5.Reg), &$7);
}
......@@ -329,7 +329,7 @@ inst:
*/
| LTYPEPC gen ',' gen
{
if $2.Type_ != D_CONST || $4.Type_ != D_CONST {
if $2.Type != D_CONST || $4.Type != D_CONST {
yyerror("arguments to PCDATA must be integer constants")
}
outcode($1, Always, &$2, NREG, &$4);
......@@ -339,10 +339,10 @@ inst:
*/
| LTYPEF gen ',' gen
{
if $2.Type_ != D_CONST {
if $2.Type != D_CONST {
yyerror("index for FUNCDATA must be integer constant")
}
if $4.Type_ != D_EXTERN && $4.Type_ != D_STATIC && $4.Type_ != D_OREG {
if $4.Type != D_EXTERN && $4.Type != D_STATIC && $4.Type != D_OREG {
yyerror("value for FUNCDATA must be symbol reference")
}
outcode($1, Always, &$2, NREG, &$4);
......@@ -375,7 +375,7 @@ rel:
con '(' LPC ')'
{
$$ = nullgen;
$$.Type_ = D_BRANCH;
$$.Type = D_BRANCH;
$$.Offset = int64($1) + int64(asm.PC);
}
| LNAME offset
......@@ -385,30 +385,30 @@ rel:
if asm.Pass == 2 && $1.Type != LLAB {
yyerror("undefined label: %s", $1.Labelname)
}
$$.Type_ = D_BRANCH;
$$.Type = D_BRANCH;
$$.Offset = $1.Value + int64($2);
}
ximm: '$' con
{
$$ = nullgen;
$$.Type_ = D_CONST;
$$.Type = D_CONST;
$$.Offset = int64($2);
}
| '$' oreg
{
$$ = $2;
$$.Type_ = D_CONST;
$$.Type = D_CONST;
}
| '$' '*' '$' oreg
{
$$ = $4;
$$.Type_ = D_OCONST;
$$.Type = D_OCONST;
}
| '$' LSCONST
{
$$ = nullgen;
$$.Type_ = D_SCONST;
$$.Type = D_SCONST;
$$.U.Sval = $2
}
| fcon
......@@ -417,13 +417,13 @@ fcon:
'$' LFCONST
{
$$ = nullgen;
$$.Type_ = D_FCONST;
$$.Type = D_FCONST;
$$.U.Dval = $2;
}
| '$' '-' LFCONST
{
$$ = nullgen;
$$.Type_ = D_FCONST;
$$.Type = D_FCONST;
$$.U.Dval = -$3;
}
......@@ -459,19 +459,19 @@ gen:
| LPSR
{
$$ = nullgen;
$$.Type_ = D_PSR;
$$.Type = D_PSR;
$$.Reg = int8($1);
}
| LFCR
{
$$ = nullgen;
$$.Type_ = D_FPCR;
$$.Type = D_FPCR;
$$.Reg = int8($1);
}
| con
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Offset = int64($1);
}
| oreg
......@@ -490,7 +490,7 @@ ireg:
'(' spreg ')'
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Reg = int8($2);
$$.Offset = 0;
}
......@@ -500,7 +500,7 @@ ioreg:
| con '(' sreg ')'
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Reg = int8($3);
$$.Offset = int64($1);
}
......@@ -510,7 +510,7 @@ oreg:
| name '(' sreg ')'
{
$$ = $1;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Reg = int8($3);
}
| ioreg
......@@ -523,7 +523,7 @@ imsr:
imm: '$' con
{
$$ = nullgen;
$$.Type_ = D_CONST;
$$.Type = D_CONST;
$$.Offset = int64($2);
}
......@@ -531,7 +531,7 @@ reg:
spreg
{
$$ = nullgen;
$$.Type_ = D_REG;
$$.Type = D_REG;
$$.Reg = int8($1);
}
......@@ -539,7 +539,7 @@ regreg:
'(' spreg ',' spreg ')'
{
$$ = nullgen;
$$.Type_ = D_REGREG;
$$.Type = D_REGREG;
$$.Reg = int8($2);
$$.Offset = int64($4);
}
......@@ -548,25 +548,25 @@ shift:
spreg '<' '<' rcon
{
$$ = nullgen;
$$.Type_ = D_SHIFT;
$$.Type = D_SHIFT;
$$.Offset = int64($1) | int64($4) | (0 << 5);
}
| spreg '>' '>' rcon
{
$$ = nullgen;
$$.Type_ = D_SHIFT;
$$.Type = D_SHIFT;
$$.Offset = int64($1) | int64($4) | (1 << 5);
}
| spreg '-' '>' rcon
{
$$ = nullgen;
$$.Type_ = D_SHIFT;
$$.Type = D_SHIFT;
$$.Offset = int64($1) | int64($4) | (2 << 5);
}
| spreg LAT '>' rcon
{
$$ = nullgen;
$$.Type_ = D_SHIFT;
$$.Type = D_SHIFT;
$$.Offset = int64($1) | int64($4) | (3 << 5);
}
......@@ -625,13 +625,13 @@ freg:
LFREG
{
$$ = nullgen;
$$.Type_ = D_FREG;
$$.Type = D_FREG;
$$.Reg = int8($1);
}
| LF '(' con ')'
{
$$ = nullgen;
$$.Type_ = D_FREG;
$$.Type = D_FREG;
$$.Reg = int8($3);
}
......@@ -639,7 +639,7 @@ name:
con '(' pointer ')'
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Name = int8($3);
$$.Sym = nil;
$$.Offset = int64($1);
......@@ -647,7 +647,7 @@ name:
| LNAME offset '(' pointer ')'
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Name = int8($4);
$$.Sym = obj.Linklookup(asm.Ctxt, $1.Name, 0);
$$.Offset = int64($2);
......@@ -655,7 +655,7 @@ name:
| LNAME '<' '>' offset '(' LSB ')'
{
$$ = nullgen;
$$.Type_ = D_OREG;
$$.Type = D_OREG;
$$.Name = D_STATIC;
$$.Sym = obj.Linklookup(asm.Ctxt, $1.Name, 1);
$$.Offset = int64($4);
......
......@@ -298,7 +298,7 @@ var lexinit = []asm.Lextab{
}
func cinit() {
nullgen.Type_ = arm.D_NONE
nullgen.Type = arm.D_NONE
nullgen.Name = arm.D_NONE
nullgen.Reg = arm.NREG
}
......
......@@ -726,7 +726,7 @@ yydefault:
var g obj.Addr
g = nullgen
g.Type_ = D_CONST
g.Type = D_CONST
g.Offset = int64(yyS[yypt-1].lval)
outcode(yyS[yypt-6].lval, yyS[yypt-5].lval, &yyS[yypt-4].addr, NREG, &g)
}
......@@ -736,7 +736,7 @@ yydefault:
var g obj.Addr
g = nullgen
g.Type_ = D_CONST
g.Type = D_CONST
g.Offset = int64(yyS[yypt-3].lval)
outcode(yyS[yypt-6].lval, yyS[yypt-5].lval, &g, NREG, &yyS[yypt-0].addr)
}
......@@ -764,7 +764,7 @@ yydefault:
//line a.y:221
{
asm.Settext(yyS[yypt-2].addr.Sym)
yyS[yypt-0].addr.Type_ = D_CONST2
yyS[yypt-0].addr.Type = D_CONST2
yyS[yypt-0].addr.Offset2 = -obj.ArgsSizeUnknown
outcode(yyS[yypt-3].lval, Always, &yyS[yypt-2].addr, 0, &yyS[yypt-0].addr)
}
......@@ -772,7 +772,7 @@ yydefault:
//line a.y:228
{
asm.Settext(yyS[yypt-4].addr.Sym)
yyS[yypt-0].addr.Type_ = D_CONST2
yyS[yypt-0].addr.Type = D_CONST2
yyS[yypt-0].addr.Offset2 = -obj.ArgsSizeUnknown
outcode(yyS[yypt-5].lval, Always, &yyS[yypt-4].addr, yyS[yypt-2].lval, &yyS[yypt-0].addr)
}
......@@ -780,7 +780,7 @@ yydefault:
//line a.y:235
{
asm.Settext(yyS[yypt-6].addr.Sym)
yyS[yypt-2].addr.Type_ = D_CONST2
yyS[yypt-2].addr.Type = D_CONST2
yyS[yypt-2].addr.Offset2 = yyS[yypt-0].lval
outcode(yyS[yypt-7].lval, Always, &yyS[yypt-6].addr, yyS[yypt-4].lval, &yyS[yypt-2].addr)
}
......@@ -825,7 +825,7 @@ yydefault:
var g obj.Addr
g = nullgen
g.Type_ = D_CONST
g.Type = D_CONST
g.Offset = int64(
(0xe << 24) | /* opcode */
(yyS[yypt-11].lval << 20) | /* MCR/MRC */
......@@ -847,7 +847,7 @@ yydefault:
case 40:
//line a.y:305
{
yyS[yypt-2].addr.Type_ = D_REGREG2
yyS[yypt-2].addr.Type = D_REGREG2
yyS[yypt-2].addr.Offset = int64(yyS[yypt-0].lval)
outcode(yyS[yypt-8].lval, yyS[yypt-7].lval, &yyS[yypt-6].addr, int32(yyS[yypt-4].addr.Reg), &yyS[yypt-2].addr)
}
......@@ -859,7 +859,7 @@ yydefault:
case 42:
//line a.y:321
{
if yyS[yypt-2].addr.Type_ != D_CONST || yyS[yypt-0].addr.Type_ != D_CONST {
if yyS[yypt-2].addr.Type != D_CONST || yyS[yypt-0].addr.Type != D_CONST {
yyerror("arguments to PCDATA must be integer constants")
}
outcode(yyS[yypt-3].lval, Always, &yyS[yypt-2].addr, NREG, &yyS[yypt-0].addr)
......@@ -867,10 +867,10 @@ yydefault:
case 43:
//line a.y:331
{
if yyS[yypt-2].addr.Type_ != D_CONST {
if yyS[yypt-2].addr.Type != D_CONST {
yyerror("index for FUNCDATA must be integer constant")
}
if yyS[yypt-0].addr.Type_ != D_EXTERN && yyS[yypt-0].addr.Type_ != D_STATIC && yyS[yypt-0].addr.Type_ != D_OREG {
if yyS[yypt-0].addr.Type != D_EXTERN && yyS[yypt-0].addr.Type != D_STATIC && yyS[yypt-0].addr.Type != D_OREG {
yyerror("value for FUNCDATA must be symbol reference")
}
outcode(yyS[yypt-3].lval, Always, &yyS[yypt-2].addr, NREG, &yyS[yypt-0].addr)
......@@ -899,7 +899,7 @@ yydefault:
//line a.y:366
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_BRANCH
yyVAL.addr.Type = D_BRANCH
yyVAL.addr.Offset = int64(yyS[yypt-3].lval) + int64(asm.PC)
}
case 51:
......@@ -910,33 +910,33 @@ yydefault:
if asm.Pass == 2 && yyS[yypt-1].sym.Type != LLAB {
yyerror("undefined label: %s", yyS[yypt-1].sym.Labelname)
}
yyVAL.addr.Type_ = D_BRANCH
yyVAL.addr.Type = D_BRANCH
yyVAL.addr.Offset = yyS[yypt-1].sym.Value + int64(yyS[yypt-0].lval)
}
case 52:
//line a.y:383
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_CONST
yyVAL.addr.Type = D_CONST
yyVAL.addr.Offset = int64(yyS[yypt-0].lval)
}
case 53:
//line a.y:389
{
yyVAL.addr = yyS[yypt-0].addr
yyVAL.addr.Type_ = D_CONST
yyVAL.addr.Type = D_CONST
}
case 54:
//line a.y:394
{
yyVAL.addr = yyS[yypt-0].addr
yyVAL.addr.Type_ = D_OCONST
yyVAL.addr.Type = D_OCONST
}
case 55:
//line a.y:399
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_SCONST
yyVAL.addr.Type = D_SCONST
yyVAL.addr.U.Sval = yyS[yypt-0].sval
}
case 56:
......@@ -945,14 +945,14 @@ yydefault:
//line a.y:408
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_FCONST
yyVAL.addr.Type = D_FCONST
yyVAL.addr.U.Dval = yyS[yypt-0].dval
}
case 58:
//line a.y:414
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_FCONST
yyVAL.addr.Type = D_FCONST
yyVAL.addr.U.Dval = -yyS[yypt-0].dval
}
case 59:
......@@ -992,21 +992,21 @@ yydefault:
//line a.y:450
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_PSR
yyVAL.addr.Type = D_PSR
yyVAL.addr.Reg = int8(yyS[yypt-0].lval)
}
case 67:
//line a.y:456
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_FPCR
yyVAL.addr.Type = D_FPCR
yyVAL.addr.Reg = int8(yyS[yypt-0].lval)
}
case 68:
//line a.y:462
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Offset = int64(yyS[yypt-0].lval)
}
case 69:
......@@ -1026,7 +1026,7 @@ yydefault:
//line a.y:481
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Reg = int8(yyS[yypt-1].lval)
yyVAL.addr.Offset = 0
}
......@@ -1036,7 +1036,7 @@ yydefault:
//line a.y:491
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Reg = int8(yyS[yypt-1].lval)
yyVAL.addr.Offset = int64(yyS[yypt-3].lval)
}
......@@ -1046,7 +1046,7 @@ yydefault:
//line a.y:501
{
yyVAL.addr = yyS[yypt-3].addr
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Reg = int8(yyS[yypt-1].lval)
}
case 78:
......@@ -1061,21 +1061,21 @@ yydefault:
//line a.y:514
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_CONST
yyVAL.addr.Type = D_CONST
yyVAL.addr.Offset = int64(yyS[yypt-0].lval)
}
case 83:
//line a.y:522
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_REG
yyVAL.addr.Type = D_REG
yyVAL.addr.Reg = int8(yyS[yypt-0].lval)
}
case 84:
//line a.y:530
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_REGREG
yyVAL.addr.Type = D_REGREG
yyVAL.addr.Reg = int8(yyS[yypt-3].lval)
yyVAL.addr.Offset = int64(yyS[yypt-1].lval)
}
......@@ -1083,28 +1083,28 @@ yydefault:
//line a.y:539
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_SHIFT
yyVAL.addr.Type = D_SHIFT
yyVAL.addr.Offset = int64(yyS[yypt-3].lval) | int64(yyS[yypt-0].lval) | (0 << 5)
}
case 86:
//line a.y:545
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_SHIFT
yyVAL.addr.Type = D_SHIFT
yyVAL.addr.Offset = int64(yyS[yypt-3].lval) | int64(yyS[yypt-0].lval) | (1 << 5)
}
case 87:
//line a.y:551
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_SHIFT
yyVAL.addr.Type = D_SHIFT
yyVAL.addr.Offset = int64(yyS[yypt-3].lval) | int64(yyS[yypt-0].lval) | (2 << 5)
}
case 88:
//line a.y:557
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_SHIFT
yyVAL.addr.Type = D_SHIFT
yyVAL.addr.Offset = int64(yyS[yypt-3].lval) | int64(yyS[yypt-0].lval) | (3 << 5)
}
case 89:
......@@ -1163,21 +1163,21 @@ yydefault:
//line a.y:616
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_FREG
yyVAL.addr.Type = D_FREG
yyVAL.addr.Reg = int8(yyS[yypt-0].lval)
}
case 101:
//line a.y:622
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_FREG
yyVAL.addr.Type = D_FREG
yyVAL.addr.Reg = int8(yyS[yypt-1].lval)
}
case 102:
//line a.y:630
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Name = int8(yyS[yypt-1].lval)
yyVAL.addr.Sym = nil
yyVAL.addr.Offset = int64(yyS[yypt-3].lval)
......@@ -1186,7 +1186,7 @@ yydefault:
//line a.y:638
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Name = int8(yyS[yypt-1].lval)
yyVAL.addr.Sym = obj.Linklookup(asm.Ctxt, yyS[yypt-4].sym.Name, 0)
yyVAL.addr.Offset = int64(yyS[yypt-3].lval)
......@@ -1195,7 +1195,7 @@ yydefault:
//line a.y:646
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = D_OREG
yyVAL.addr.Type = D_OREG
yyVAL.addr.Name = D_STATIC
yyVAL.addr.Sym = obj.Linklookup(asm.Ctxt, yyS[yypt-6].sym.Name, 1)
yyVAL.addr.Offset = int64(yyS[yypt-3].lval)
......
......@@ -289,7 +289,7 @@ spec9: /* shufl */
{
$$.from = $3;
$$.to = $5;
if $1.Type_ != x86.D_CONST {
if $1.Type != x86.D_CONST {
yyerror("illegal constant");
}
$$.to.Offset = $1.Offset;
......@@ -322,7 +322,7 @@ spec11: /* GLOBL */
spec12: /* asm.PCDATA */
rim ',' rim
{
if $1.Type_ != x86.D_CONST || $3.Type_ != x86.D_CONST {
if $1.Type != x86.D_CONST || $3.Type != x86.D_CONST {
yyerror("arguments to asm.PCDATA must be integer constants");
}
$$.from = $1;
......@@ -332,10 +332,10 @@ spec12: /* asm.PCDATA */
spec13: /* FUNCDATA */
rim ',' rim
{
if $1.Type_ != x86.D_CONST {
if $1.Type != x86.D_CONST {
yyerror("index for FUNCDATA must be integer constant");
}
if $3.Type_ != x86.D_EXTERN && $3.Type_ != x86.D_STATIC {
if $3.Type != x86.D_EXTERN && $3.Type != x86.D_STATIC {
yyerror("value for FUNCDATA must be symbol reference");
}
$$.from = $1;
......@@ -368,7 +368,7 @@ rel:
con '(' LPC ')'
{
$$ = nullgen;
$$.Type_ = x86.D_BRANCH;
$$.Type = x86.D_BRANCH;
$$.Offset = $1 + int64(asm.PC);
}
| LNAME offset
......@@ -378,7 +378,7 @@ rel:
if asm.Pass == 2 && $1.Type != LLAB {
yyerror("undefined label: %s", $1.Labelname);
}
$$.Type_ = x86.D_BRANCH;
$$.Type = x86.D_BRANCH;
$$.Offset = $1.Value + $2;
}
......@@ -386,43 +386,43 @@ reg:
LBREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
| LFREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
| LLREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
| LMREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
| LSP
{
$$ = nullgen;
$$.Type_ = x86.D_SP;
$$.Type = x86.D_SP;
}
| LSREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
| LXREG
{
$$ = nullgen;
$$.Type_ = int16($1);
$$.Type = int16($1);
}
imm2:
'$' con2
{
$$ = nullgen;
$$.Type_ = x86.D_CONST;
$$.Type = x86.D_CONST;
$$.Offset = $2;
}
......@@ -430,16 +430,16 @@ imm:
'$' con
{
$$ = nullgen;
$$.Type_ = x86.D_CONST;
$$.Type = x86.D_CONST;
$$.Offset = $2;
}
| '$' nam
{
$$ = $2;
$$.Index = uint8($2.Type_);
$$.Type_ = x86.D_ADDR;
$$.Index = uint8($2.Type);
$$.Type = x86.D_ADDR;
/*
if($2.Type_ == x86.D_AUTO || $2.Type_ == x86.D_PARAM)
if($2.Type == x86.D_AUTO || $2.Type == x86.D_PARAM)
yyerror("constant cannot be automatic: %s",
$2.sym.Name);
*/
......@@ -447,31 +447,31 @@ imm:
| '$' LSCONST
{
$$ = nullgen;
$$.Type_ = x86.D_SCONST;
$$.Type = x86.D_SCONST;
$$.U.Sval = ($2+"\x00\x00\x00\x00\x00\x00\x00\x00")[:8]
}
| '$' LFCONST
{
$$ = nullgen;
$$.Type_ = x86.D_FCONST;
$$.Type = x86.D_FCONST;
$$.U.Dval = $2;
}
| '$' '(' LFCONST ')'
{
$$ = nullgen;
$$.Type_ = x86.D_FCONST;
$$.Type = x86.D_FCONST;
$$.U.Dval = $3;
}
| '$' '(' '-' LFCONST ')'
{
$$ = nullgen;
$$.Type_ = x86.D_FCONST;
$$.Type = x86.D_FCONST;
$$.U.Dval = -$4;
}
| '$' '-' LFCONST
{
$$ = nullgen;
$$.Type_ = x86.D_FCONST;
$$.Type = x86.D_FCONST;
$$.U.Dval = -$3;
}
......@@ -483,31 +483,31 @@ omem:
con
{
$$ = nullgen;
$$.Type_ = x86.D_INDIR+x86.D_NONE;
$$.Type = x86.D_INDIR+x86.D_NONE;
$$.Offset = $1;
}
| con '(' LLREG ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$3);
$$.Type = int16(x86.D_INDIR+$3);
$$.Offset = $1;
}
| con '(' LSP ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+x86.D_SP);
$$.Type = int16(x86.D_INDIR+x86.D_SP);
$$.Offset = $1;
}
| con '(' LSREG ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$3);
$$.Type = int16(x86.D_INDIR+$3);
$$.Offset = $1;
}
| con '(' LLREG '*' con ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+x86.D_NONE);
$$.Type = int16(x86.D_INDIR+x86.D_NONE);
$$.Offset = $1;
$$.Index = uint8($3);
$$.Scale = int8($5);
......@@ -516,7 +516,7 @@ omem:
| con '(' LLREG ')' '(' LLREG '*' con ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$3);
$$.Type = int16(x86.D_INDIR+$3);
$$.Offset = $1;
$$.Index = uint8($6);
$$.Scale = int8($8);
......@@ -525,7 +525,7 @@ omem:
| con '(' LLREG ')' '(' LSREG '*' con ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$3);
$$.Type = int16(x86.D_INDIR+$3);
$$.Offset = $1;
$$.Index = uint8($6);
$$.Scale = int8($8);
......@@ -534,17 +534,17 @@ omem:
| '(' LLREG ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$2);
$$.Type = int16(x86.D_INDIR+$2);
}
| '(' LSP ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+x86.D_SP);
$$.Type = int16(x86.D_INDIR+x86.D_SP);
}
| '(' LLREG '*' con ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+x86.D_NONE);
$$.Type = int16(x86.D_INDIR+x86.D_NONE);
$$.Index = uint8($2);
$$.Scale = int8($4);
checkscale($$.Scale);
......@@ -552,7 +552,7 @@ omem:
| '(' LLREG ')' '(' LLREG '*' con ')'
{
$$ = nullgen;
$$.Type_ = int16(x86.D_INDIR+$2);
$$.Type = int16(x86.D_INDIR+$2);
$$.Index = uint8($5);
$$.Scale = int8($7);
checkscale($$.Scale);
......@@ -575,14 +575,14 @@ nam:
LNAME offset '(' pointer ')'
{
$$ = nullgen;
$$.Type_ = int16($4);
$$.Type = int16($4);
$$.Sym = obj.Linklookup(asm.Ctxt, $1.Name, 0);
$$.Offset = $2;
}
| LNAME '<' '>' offset '(' LSB ')'
{
$$ = nullgen;
$$.Type_ = x86.D_STATIC;
$$.Type = x86.D_STATIC;
$$.Sym = obj.Linklookup(asm.Ctxt, $1.Name, 1);
$$.Offset = $4;
}
......
......@@ -915,7 +915,7 @@ var lexinit = []asm.Lextab{
}
func cinit() {
nullgen.Type_ = x86.D_NONE
nullgen.Type = x86.D_NONE
nullgen.Index = x86.D_NONE
}
......
......@@ -866,7 +866,7 @@ yydefault:
{
yyVAL.addr2.from = yyS[yypt-2].addr
yyVAL.addr2.to = yyS[yypt-0].addr
if yyS[yypt-4].addr.Type_ != x86.D_CONST {
if yyS[yypt-4].addr.Type != x86.D_CONST {
yyerror("illegal constant")
}
yyVAL.addr2.to.Offset = yyS[yypt-4].addr.Offset
......@@ -899,7 +899,7 @@ yydefault:
case 61:
//line a.y:324
{
if yyS[yypt-2].addr.Type_ != x86.D_CONST || yyS[yypt-0].addr.Type_ != x86.D_CONST {
if yyS[yypt-2].addr.Type != x86.D_CONST || yyS[yypt-0].addr.Type != x86.D_CONST {
yyerror("arguments to asm.PCDATA must be integer constants")
}
yyVAL.addr2.from = yyS[yypt-2].addr
......@@ -908,10 +908,10 @@ yydefault:
case 62:
//line a.y:334
{
if yyS[yypt-2].addr.Type_ != x86.D_CONST {
if yyS[yypt-2].addr.Type != x86.D_CONST {
yyerror("index for FUNCDATA must be integer constant")
}
if yyS[yypt-0].addr.Type_ != x86.D_EXTERN && yyS[yypt-0].addr.Type_ != x86.D_STATIC {
if yyS[yypt-0].addr.Type != x86.D_EXTERN && yyS[yypt-0].addr.Type != x86.D_STATIC {
yyerror("value for FUNCDATA must be symbol reference")
}
yyVAL.addr2.from = yyS[yypt-2].addr
......@@ -947,7 +947,7 @@ yydefault:
//line a.y:369
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_BRANCH
yyVAL.addr.Type = x86.D_BRANCH
yyVAL.addr.Offset = yyS[yypt-3].lval + int64(asm.PC)
}
case 74:
......@@ -958,73 +958,73 @@ yydefault:
if asm.Pass == 2 && yyS[yypt-1].sym.Type != LLAB {
yyerror("undefined label: %s", yyS[yypt-1].sym.Labelname)
}
yyVAL.addr.Type_ = x86.D_BRANCH
yyVAL.addr.Type = x86.D_BRANCH
yyVAL.addr.Offset = yyS[yypt-1].sym.Value + yyS[yypt-0].lval
}
case 75:
//line a.y:387
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 76:
//line a.y:392
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 77:
//line a.y:397
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 78:
//line a.y:402
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 79:
//line a.y:407
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_SP
yyVAL.addr.Type = x86.D_SP
}
case 80:
//line a.y:412
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 81:
//line a.y:417
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-0].lval)
yyVAL.addr.Type = int16(yyS[yypt-0].lval)
}
case 82:
//line a.y:423
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_CONST
yyVAL.addr.Type = x86.D_CONST
yyVAL.addr.Offset = yyS[yypt-0].lval
}
case 83:
//line a.y:431
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_CONST
yyVAL.addr.Type = x86.D_CONST
yyVAL.addr.Offset = yyS[yypt-0].lval
}
case 84:
//line a.y:437
{
yyVAL.addr = yyS[yypt-0].addr
yyVAL.addr.Index = uint8(yyS[yypt-0].addr.Type_)
yyVAL.addr.Type_ = x86.D_ADDR
yyVAL.addr.Index = uint8(yyS[yypt-0].addr.Type)
yyVAL.addr.Type = x86.D_ADDR
/*
if($2.Type_ == x86.D_AUTO || $2.Type_ == x86.D_PARAM)
if($2.Type == x86.D_AUTO || $2.Type == x86.D_PARAM)
yyerror("constant cannot be automatic: %s",
$2.sym.Name);
*/
......@@ -1033,35 +1033,35 @@ yydefault:
//line a.y:447
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_SCONST
yyVAL.addr.Type = x86.D_SCONST
yyVAL.addr.U.Sval = (yyS[yypt-0].sval + "\x00\x00\x00\x00\x00\x00\x00\x00")[:8]
}
case 86:
//line a.y:453
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_FCONST
yyVAL.addr.Type = x86.D_FCONST
yyVAL.addr.U.Dval = yyS[yypt-0].dval
}
case 87:
//line a.y:459
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_FCONST
yyVAL.addr.Type = x86.D_FCONST
yyVAL.addr.U.Dval = yyS[yypt-1].dval
}
case 88:
//line a.y:465
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_FCONST
yyVAL.addr.Type = x86.D_FCONST
yyVAL.addr.U.Dval = -yyS[yypt-1].dval
}
case 89:
//line a.y:471
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_FCONST
yyVAL.addr.Type = x86.D_FCONST
yyVAL.addr.U.Dval = -yyS[yypt-0].dval
}
case 90:
......@@ -1072,35 +1072,35 @@ yydefault:
//line a.y:483
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_INDIR + x86.D_NONE
yyVAL.addr.Type = x86.D_INDIR + x86.D_NONE
yyVAL.addr.Offset = yyS[yypt-0].lval
}
case 93:
//line a.y:489
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-1].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-1].lval)
yyVAL.addr.Offset = yyS[yypt-3].lval
}
case 94:
//line a.y:495
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + x86.D_SP)
yyVAL.addr.Type = int16(x86.D_INDIR + x86.D_SP)
yyVAL.addr.Offset = yyS[yypt-3].lval
}
case 95:
//line a.y:501
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-1].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-1].lval)
yyVAL.addr.Offset = yyS[yypt-3].lval
}
case 96:
//line a.y:507
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + x86.D_NONE)
yyVAL.addr.Type = int16(x86.D_INDIR + x86.D_NONE)
yyVAL.addr.Offset = yyS[yypt-5].lval
yyVAL.addr.Index = uint8(yyS[yypt-3].lval)
yyVAL.addr.Scale = int8(yyS[yypt-1].lval)
......@@ -1110,7 +1110,7 @@ yydefault:
//line a.y:516
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Offset = yyS[yypt-8].lval
yyVAL.addr.Index = uint8(yyS[yypt-3].lval)
yyVAL.addr.Scale = int8(yyS[yypt-1].lval)
......@@ -1120,7 +1120,7 @@ yydefault:
//line a.y:525
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Offset = yyS[yypt-8].lval
yyVAL.addr.Index = uint8(yyS[yypt-3].lval)
yyVAL.addr.Scale = int8(yyS[yypt-1].lval)
......@@ -1130,19 +1130,19 @@ yydefault:
//line a.y:534
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-1].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-1].lval)
}
case 100:
//line a.y:539
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + x86.D_SP)
yyVAL.addr.Type = int16(x86.D_INDIR + x86.D_SP)
}
case 101:
//line a.y:544
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + x86.D_NONE)
yyVAL.addr.Type = int16(x86.D_INDIR + x86.D_NONE)
yyVAL.addr.Index = uint8(yyS[yypt-3].lval)
yyVAL.addr.Scale = int8(yyS[yypt-1].lval)
checkscale(yyVAL.addr.Scale)
......@@ -1151,7 +1151,7 @@ yydefault:
//line a.y:552
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Type = int16(x86.D_INDIR + yyS[yypt-6].lval)
yyVAL.addr.Index = uint8(yyS[yypt-3].lval)
yyVAL.addr.Scale = int8(yyS[yypt-1].lval)
checkscale(yyVAL.addr.Scale)
......@@ -1173,7 +1173,7 @@ yydefault:
//line a.y:575
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = int16(yyS[yypt-1].lval)
yyVAL.addr.Type = int16(yyS[yypt-1].lval)
yyVAL.addr.Sym = obj.Linklookup(asm.Ctxt, yyS[yypt-4].sym.Name, 0)
yyVAL.addr.Offset = yyS[yypt-3].lval
}
......@@ -1181,7 +1181,7 @@ yydefault:
//line a.y:582
{
yyVAL.addr = nullgen
yyVAL.addr.Type_ = x86.D_STATIC
yyVAL.addr.Type = x86.D_STATIC
yyVAL.addr.Sym = obj.Linklookup(asm.Ctxt, yyS[yypt-6].sym.Name, 1)
yyVAL.addr.Offset = yyS[yypt-3].lval
}
......
This diff is collapsed.
......@@ -702,7 +702,7 @@ var lexinit = []asm.Lextab{
}
func cinit() {
nullgen.Type_ = i386.D_NONE
nullgen.Type = i386.D_NONE
nullgen.Index = i386.D_NONE
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -465,7 +465,7 @@ var lexinit = []asm.Lextab{
}
func cinit() {
nullgen.Type_ = ppc64.D_NONE
nullgen.Type = ppc64.D_NONE
nullgen.Name = ppc64.D_NONE
nullgen.Reg = ppc64.NREG
nullgen.Scale = ppc64.NREG // replaced Gen.xreg with Prog.scale
......
This diff is collapsed.
......@@ -298,7 +298,7 @@ func readsym(b *bufio.Reader, s *obj.LSym) {
delete(undef, s)
s.Name = rdstring(b)
s.Extname = rdstring(b)
s.Type_ = int16(rdint(b))
s.Type = int16(rdint(b))
s.Version = int16(rdint(b))
s.Dupok = uint8(rdint(b))
s.External = uint8(rdint(b))
......@@ -347,7 +347,7 @@ func readsym(b *bufio.Reader, s *obj.LSym) {
r.Off = int32(rdint(b))
r.Siz = uint8(rdint(b))
r.Done = uint8(rdint(b))
r.Type_ = int32(rdint(b))
r.Type = int32(rdint(b))
r.Add = rdint(b)
r.Xadd = rdint(b)
r.Sym = rdsym(b)
......@@ -384,7 +384,7 @@ func readaddr(b *bufio.Reader, a *obj.Addr) {
a.U.Branch = rdprog(b)
a.Sym = rdsym(b)
a.Gotype = rdsym(b)
a.Type_ = int16(rdint(b))
a.Type = int16(rdint(b))
a.Index = uint8(rdint(b))
a.Scale = int8(rdint(b))
a.Reg = int8(rdint(b))
......
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