Article View: gnu.gcc.bug
Article #867Unnecessary floating point moves
From: James Larus
Date: Wed, 13 Dec 1989 16:21
Date: Wed, 13 Dec 1989 16:21
25 lines
914 bytes
914 bytes
gcc version 1.36 on DECstation 3100 (MIPS R2000) compiles the
following function:
float
foo (s)
char *s;
{
double atof();
return atof(s);
}
into the following code:
addiu $29,$29,0xfff0 #subsi3 $29,16 -> $29
jal atof # call atof regle 2-call (VOIDmode)
mov.d $f4,$f0 #movdf $f0 -> $f4
cvt.s.d $f4,$f4 #truncdfsf2 $f4 -> $f4
mov.s $f0,$f4 #movsf $f4 -> $f0
addiu $29,$29,0x10 #addsi3 $29,16 -> $29
The move to $f4 to truncate and then back to $f0 is unncessary.
/Jim
Technical Details
Message-ID:
<8912131621.AA19808@primost.cs.wisc.edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!philmtl!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!larusShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!philmtl!uunet!tut.cis.ohio-state.edu!CS.WISC.EDU!larus From: larus@CS.WISC.EDU (James Larus) Newsgroups: gnu.gcc.bug Subject: Unnecessary floating point moves Message-ID: <8912131621.AA19808@primost.cs.wisc.edu> Date: 13 Dec 89 16:21:16 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: larus@cs.wisc.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 25