From c072558b90f1bbedc2022b0f30c8b1ac4712538e Mon Sep 17 00:00:00 2001 From: Ondřej Surý Date: Fri, 18 Feb 2011 09:50:58 +0100 Subject: Imported Upstream version 2011.02.15 --- src/cmd/5l/asm.c | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) (limited to 'src/cmd/5l/asm.c') diff --git a/src/cmd/5l/asm.c b/src/cmd/5l/asm.c index 34565629f..7163997c0 100644 --- a/src/cmd/5l/asm.c +++ b/src/cmd/5l/asm.c @@ -637,13 +637,6 @@ wput(int32 l) cflush(); } -void -wputl(ushort w) -{ - cput(w); - cput(w>>8); -} - void hput(int32 l) @@ -671,20 +664,6 @@ lput(int32 l) cflush(); } -void -lputl(int32 l) -{ - - cbp[3] = l>>24; - cbp[2] = l>>16; - cbp[1] = l>>8; - cbp[0] = l; - cbp += 4; - cbc -= 4; - if(cbc <= 0) - cflush(); -} - void cflush(void) { @@ -1491,15 +1470,24 @@ if(debug['G']) print("%ux: %s: arm %d %d %d\n", (uint32)(p->pc), p->from.sym->na o1 |= (p->scond & C_SCOND) << 28; break; case 80: /* fmov zfcon,freg */ - if((p->scond & C_SCOND) != C_SCOND_NONE) - diag("floating point cannot be conditional"); // cant happen - o1 = 0xf3000110; // EOR 64 - - // always clears the double float register + if(p->as == AMOVD) { + o1 = 0xeeb00b00; // VMOV imm 64 + o2 = oprrr(ASUBD, p->scond); + } else { + o1 = 0x0eb00a00; // VMOV imm 32 + o2 = oprrr(ASUBF, p->scond); + } + v = 0x70; // 1.0 r = p->to.reg; - o1 |= r << 0; + + // movf $1.0, r + o1 |= (p->scond & C_SCOND) << 28; o1 |= r << 12; - o1 |= r << 16; + o1 |= (v&0xf) << 0; + o1 |= (v&0xf0) << 12; + + // subf r,r,r + o2 |= r | (r<<16) | (r<<12); break; case 81: /* fmov sfcon,freg */ o1 = 0x0eb00a00; // VMOV imm 32 -- cgit v1.2.3