Commit 5457d860 by Oleg Endo

fpul-usage-1.c: New.

	* gcc.target/sh/fpul-usage-1.c: New.

From-SVN: r185406
parent 1eb74c79
2012-03-15 Oleg Endo <olegendo@gcc.gnu.org>
* gcc.target/sh/fpul-usage-1.c: New.
2012-03-14 Oleg Endo <olegendo@gcc.gnu.org>
PR target/49468
......
/* Check that the FPUL register is used when reading a float as an int and
vice versa, as opposed to pushing and popping the values over the stack. */
/* { dg-do compile { target "sh*-*-*" } } */
/* { dg-options "-O1" } */
/* { dg-skip-if "" { "sh*-*-*" } { "-m1" "-m2" "-m4al" "*nofpu" "-m4-340*" "-m4-400*" "-m4-500*" "-m5*" } { "" } } */
/* { dg-final { scan-assembler "fpul" } } */
/* { dg-final { scan-assembler-not "r15" } } */
int
float_as_int (float val)
{
union { float f; int i; } u;
u.f = val;
return u.i;
}
float
int_as_float (int val)
{
union { float f; int i; } u;
u.i = val;
return u.f;
}
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