This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/61195] New: single precision fmov does not need to switch mode
- From: "chrbr at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 May 2014 13:55:23 +0000
- Subject: [Bug target/61195] New: single precision fmov does not need to switch mode
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61195
Bug ID: 61195
Summary: single precision fmov does not need to switch mode
Product: gcc
Version: 4.10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: chrbr at gcc dot gnu.org
for SH4/SH2A the compiler forces a PR mode switch for the floating point moves:
so
float
foo(float f)
{
return f;
}
compiles as:
mov.l .L2,r1
lds.l @r1+,fpscr
add #-4,r1
fmov fr4,fr0
add #4,r1
rts
lds.l @r1+,fpscr
.L3:
.align 2
.L2:
.long ___fpscr_values
This is not necessary, since the prevailing mode for PR=0 is single precision
(double precision would be set with SZ=1)
so the function can be just be compiled as
_foo:
rts
fmov fr4,fr0