From: Michael Collison Date: Fri, 1 Jun 2018 00:37:28 +0000 (+0000) Subject: 2018-05-15 Michael Collison X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eeb59c16f849534b6cf03566151225c7b7fb92cd;p=gcc.git 2018-05-15 Michael Collison * config/aarch64/aarch64.md: (*fix_to_zero_extenddfdi2): New pattern. * gcc.target/aarch64/fix_extend1.c: New testcase. From-SVN: r261051 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 370344c66e6..956fbde816b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-31 Michael Collison + + * config/aarch64/aarch64.md: + (*fix_to_zero_extenddfdi2): New pattern. + * gcc.target/aarch64/fix_extend1.c: New testcase. + 2018-05-31 Qing Zhao PR middle-end/78809 diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 7a0e34d624b..2539f2e4b25 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -5103,6 +5103,16 @@ [(set_attr "type" "f_cvtf2i")] ) +(define_insn "*fix_to_zero_extenddi2" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI + (unsigned_fix:SI + (match_operand:GPF 1 "register_operand" "w"))))] + "TARGET_FLOAT" + "fcvtzu\t%w0, %1" + [(set_attr "type" "f_cvtf2i")] +) + (define_insn "2" [(set (match_operand:GPF 0 "register_operand" "=w,w") (FLOATUORS:GPF (match_operand: 1 "register_operand" "w,?r")))] diff --git a/gcc/testsuite/gcc.target/aarch64/fix_extend1.c b/gcc/testsuite/gcc.target/aarch64/fix_extend1.c new file mode 100644 index 00000000000..3a251d0be0a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/fix_extend1.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +unsigned long +f7 (double x) +{ + return (unsigned) x; +} + +unsigned long +f7_2 (float x) +{ + return (unsigned) x; +} + +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, d\[0-9\]+" } } */ +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, s\[0-9\]+" } } */