mirror of
https://github.com/golang/go
synced 2024-11-23 20:30:04 -07:00
cmd/internal/obj/x86: fix nacl/amd64p32
Change-Id: I815b685e261065bad3416b55feb4fec68974c9a0 Reviewed-on: https://go-review.googlesource.com/6896 Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
6c58d28ca4
commit
12079acaa0
@ -173,9 +173,13 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctxt.Headtype == obj.Hnacl && p.Mode == 64 {
|
// Rewrite 0 to $0 in 3rd argment to CMPPS etc.
|
||||||
nacladdr(ctxt, p, &p.From)
|
// That's what the tables expect.
|
||||||
nacladdr(ctxt, p, &p.To)
|
switch p.As {
|
||||||
|
case ACMPPD, ACMPPS, ACMPSD, ACMPSS:
|
||||||
|
if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE && p.To.Reg == REG_NONE && p.To.Index == REG_NONE && p.To.Sym == nil {
|
||||||
|
p.To.Type = obj.TYPE_CONST
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite CALL/JMP/RET to symbol as TYPE_BRANCH.
|
// Rewrite CALL/JMP/RET to symbol as TYPE_BRANCH.
|
||||||
@ -186,13 +190,9 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite 0 to $0 in 3rd argment to CMPPS etc.
|
if ctxt.Headtype == obj.Hnacl && p.Mode == 64 {
|
||||||
// That's what the tables expect.
|
nacladdr(ctxt, p, &p.From)
|
||||||
switch p.As {
|
nacladdr(ctxt, p, &p.To)
|
||||||
case ACMPPD, ACMPPS, ACMPSD, ACMPSS:
|
|
||||||
if p.To.Type == obj.TYPE_MEM && p.To.Name == obj.NAME_NONE && p.To.Reg == REG_NONE && p.To.Index == REG_NONE && p.To.Sym == nil {
|
|
||||||
p.To.Type = obj.TYPE_CONST
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite float constants to values stored in memory.
|
// Rewrite float constants to values stored in memory.
|
||||||
|
Loading…
Reference in New Issue
Block a user