aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/arm/fixed_float_conversion.c
blob: 078b103745d6b9b7dfb73be22f67041924e64612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Check that vcvt is used for fixed and float data conversions.  */
/* { dg-do compile } */
/* { dg-require-effective-target arm_vfp3_ok } */
/* { dg-options "-O1" } */
/* { dg-add-options arm_vfp3 } */

float
fixed_to_float (int i)
{
  return ((float) i / (1 << 16));
}

int
float_to_fixed (float f)
{
  return ((int) (f * (1 << 16)));
}

/* { dg-final { scan-assembler "vcvt.f32.s32" } } */
/* { dg-final { scan-assembler "vcvt.s32.f32" } } */