This patch adds an extension to aarch64_gimple_fold_builtin () that does constant folding on __builtin_fmulx* calls for 32 and 64 bit floating point scalar modes. We fold when both arguments are constant, as well as when only one is. The special cases of 0*inf, -0*inf, 0*-inf, and -0*-inf are also handled. The case for vector constant arguments will be dealt with in a future patch since the tests for that would be obscure and would unnecessarily complicate this patch. Added tests to check for proper handling of constant folding. Tested on targets aarch64-none-elf and aarch64_be-none-elf. --- gcc/ 2015-XX-XX Bilyan Borisov * config/aarch64/aarch64-builtins.c (aarch64_gimple_fold_builtin): Added constant folding. gcc/testsuite/ 2015-XX-XX Bilyan Borisov * gcc.target/aarch64/simd/vmulx.x: New. * gcc.target/aarch64/simd/vmulx_f64_2.c: Likewise. * gcc.target/aarch64/simd/vmulxd_f64_2.c: Likewise. * gcc.target/aarch64/simd/vmulxs_f32_2.c: Likewise.