From 1013465feaf83fd7503711c03a0c1013a7a37ca4 Mon Sep 17 00:00:00 2001 From: Tamar Christina Date: Thu, 26 Oct 2017 06:42:41 +0000 Subject: [PATCH] re PR target/81800 (On aarch64 ilp32 lrint should not be inlined as two instructions) 2017-10-26 Tamar Christina PR target/81800 * config/aarch64/aarch64.md (lrint2): Add flag_trapping_math and flag_fp_int_builtin_inexact. gcc/testsuite/ 2017-10-26 Tamar Christina * gcc.target/aarch64/inline-lrint_2.c (dg-options): Add -fno-trapping-math. From-SVN: r254098 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.md | 4 +++- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5e297fb8b0f..ad54a57e1c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-10-26 Tamar Christina + + PR target/81800 + * config/aarch64/aarch64.md (lrint2): Add flag_trapping_math + and flag_fp_int_builtin_inexact. + 2017-10-25 Palmer Dabbelt * config/riscv/riscv.md (ZERO_EXTEND_LOAD): Define. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 389f2f9d31a..eee836be055 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -5155,7 +5155,9 @@ (define_expand "lrint2" [(match_operand:GPI 0 "register_operand") (match_operand:GPF 1 "register_operand")] - "TARGET_FLOAT" + "TARGET_FLOAT + && ((GET_MODE_SIZE (mode) <= GET_MODE_SIZE (mode)) + || !flag_trapping_math || flag_fp_int_builtin_inexact)" { rtx cvt = gen_reg_rtx (mode); emit_insn (gen_rint2 (cvt, operands[1])); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf7095ea308..8dcf46104d6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-10-26 Tamar Christina + + * gcc.target/aarch64/inline-lrint_2.c (dg-options): Add -fno-trapping-math. + 2017-10-26 Tamar Christina * gcc.target/aarch64/advsimd-intrinsics/vect-dot-qi.h: New. diff --git a/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c b/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c index 6080e186d8f..bd0c73c8d34 100644 --- a/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c +++ b/gcc/testsuite/gcc.target/aarch64/inline-lrint_2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ /* { dg-require-effective-target ilp32 } */ -/* { dg-options "-O3 -fno-math-errno" } */ +/* { dg-options "-O3 -fno-math-errno -fno-trapping-math" } */ #include "lrint-matherr.h" -- 2.30.2