Commit 59584ede authored by Russ Cox's avatar Russ Cox

cmd/internal/obj/x86: accept TYPE_MEM in CMPPS 3rd argument

(Because that's what the assembly files actually say - no $ on the constant.)

Change-Id: Idb774cdca0e089c4ac24ab665e23290bf7b565bf
Reviewed-on: https://go-review.googlesource.com/6895Reviewed-by: default avatarRob Pike <r@golang.org>
parent a0ac4938
......@@ -186,6 +186,15 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
}
}
// Rewrite 0 to $0 in 3rd argment to CMPPS etc.
// That's what the tables expect.
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 float constants to values stored in memory.
switch p.As {
// Convert AMOVSS $(0), Xx to AXORPS Xx, Xx
......
......@@ -302,7 +302,8 @@ spec8: /* CMPPS/CMPPD */
rem ',' reg ',' con
{
$$.from = $1;
$$.to = $3;
$$.from3 = $3;
$$.to.Type = obj.TYPE_MEM; // to give library something to do
$$.to.Offset = $5;
}
......
This diff is collapsed.
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