PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / arm / fixed_float_conversion.c
blob05ccd14c8dea77165774cba809a0ec1c3917cc49
1 /* Check that vcvt is used for fixed and float data conversions. */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target arm_vfp3_ok } */
4 /* { dg-options "-O1" } */
5 /* { dg-add-options arm_vfp3 } */
6 /* { dg-skip-if "need fp instructions" { *-*-* } { "-mfloat-abi=soft" } { "" } } */
8 float
9 fixed_to_float (int i)
11 return ((float) i / (1 << 16));
14 int
15 float_to_fixed (float f)
17 return ((int) (f * (1 << 16)));
20 /* { dg-final { scan-assembler "vcvt.f32.s32" } } */
21 /* { dg-final { scan-assembler "vcvt.s32.f32" } } */