diff options
author | Xianmiao Qu <cooper.qu@linux.alibaba.com> | 2022-10-27 17:26:54 +0800 |
---|---|---|
committer | Xianmiao Qu <cooper.qu@linux.alibaba.com> | 2023-01-10 19:52:24 +0800 |
commit | 288b18bf0739a83609e720e8d263181c4ec4d86c (patch) | |
tree | 1df854e7907cc0c40acefdec1702b6dd649225e5 | |
parent | 8b7c12d83ccb6565d1f4532f9669c33ebbafaef8 (diff) | |
download | gcc-288b18bf0739a83609e720e8d263181c4ec4d86c.zip gcc-288b18bf0739a83609e720e8d263181c4ec4d86c.tar.gz gcc-288b18bf0739a83609e720e8d263181c4ec4d86c.tar.bz2 |
C-SKY: Add conditions for ceil etc patterns.
The ceil etc functions can be only inlined as instruction when
they can raise the "inexact" exception. Without the adding
conditions, it will cause the "gcc.dg/torture/builtin-fp-int-inexact-c2x.c"
etc cases fails.
gcc/
* config/csky/csky_insn_fpuv3.md (l<frm_pattern><fixsuop><mode>si2): Test
flag_fp_int_builtin_inexact || !flag_trapping_math.
(<frm_pattern><mode>2): Likewise.
-rw-r--r-- | gcc/config/csky/csky_insn_fpuv3.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/config/csky/csky_insn_fpuv3.md b/gcc/config/csky/csky_insn_fpuv3.md index 628bae5..7f8f459 100644 --- a/gcc/config/csky/csky_insn_fpuv3.md +++ b/gcc/config/csky/csky_insn_fpuv3.md @@ -476,14 +476,16 @@ [(set (match_operand:SI 0 "register_operand" "=v") (FIX_SU:SI (unspec:F3ANY [(match_operand:F3ANY 1 "register_operand" "0")] FRM)))] - "CSKY_ISA_FEATURE(fpv3_<mode>)" + "CSKY_ISA_FEATURE(fpv3_<mode>) + && (flag_fp_int_builtin_inexact || !flag_trapping_math)" "fftoi.f<f3t>.<fixsu>32<rm>\t%0, %1" ) (define_insn "<frm_pattern><mode>2" [(set (match_operand:F3ANY 0 "register_operand" "=v") (unspec:F3ANY [(match_operand:F3ANY 1 "register_operand" "0")] FRMF))] - "CSKY_ISA_FEATURE(fpv3_<mode>)" + "CSKY_ISA_FEATURE(fpv3_<mode>) + && (flag_fp_int_builtin_inexact || !flag_trapping_math)" "fftofi.f<f3t><rm>\t%0, %1" ) |