Fix wrong code by arm_final_prescan with fp16 move instructions
authorSudakshina Das <sudi.das@arm.com>
Fri, 1 Dec 2017 10:12:55 +0000 (10:12 +0000)
committerSudakshina Das <sudi@gcc.gnu.org>
Fri, 1 Dec 2017 10:12:55 +0000 (10:12 +0000)
ChangeLog entry are as follow:

*** gcc/ChangeLog ***

2017-12-01  Sudakshina Das  <sudi.das@arm.com>

* config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute.

*** gcc/testsuite/ChangeLog ***

2017-12-01  Sudakshina Das  <sudi.das@arm.com>

* gcc.target/arm/armv8_2-fp16-move-2.c: New test.

From-SVN: r255301

gcc/ChangeLog
gcc/config/arm/vfp.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/armv8_2-fp16-move-2.c [new file with mode: 0644]

index 09fd188aecf2b3594b022d469935e5909bfb43af..360561e929d574fb83ba9908630b290a4d87a9ff 100644 (file)
@@ -1,3 +1,7 @@
+2017-12-01  Sudakshina Das  <sudi.das@arm.com>
+
+       * config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute.
+
 2017-12-01  Jakub Jelinek  <jakub@redhat.com>
 
        * function.h (struct function): Remove cilk_frame_decl,
index 075a938d22e40d92aa53e22f622445d4acc14a05..61b6477ad470a7c3db8c251c44d650d1c54f998c 100644 (file)
       gcc_unreachable ();
     }
  }
-  [(set_attr "predicable" "yes, yes, no, yes, no, no, no, no, no, no")
+  [(set_attr "conds" "*, *, unconditional, *, unconditional, unconditional,\
+                     unconditional, unconditional, unconditional,\
+                     unconditional")
+   (set_attr "predicable" "yes, yes, no, yes, no, no, no, no, no, no")
    (set_attr "predicable_short_it" "no, no, no, yes,\
                                    no, no, no, no,\
                                    no, no")
index ea2f2c7764b60b2f31d93b6301cc2080118ade2d..b51bd2a8ad674e1f0223bf990b46e8a7251f54b9 100644 (file)
@@ -1,3 +1,7 @@
+2017-12-01  Sudakshina Das  <sudi.das@arm.com>
+
+       * gcc.target/arm/armv8_2-fp16-move-2.c: New test.
+
 2017-12-01  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/79153
diff --git a/gcc/testsuite/gcc.target/arm/armv8_2-fp16-move-2.c b/gcc/testsuite/gcc.target/arm/armv8_2-fp16-move-2.c
new file mode 100644 (file)
index 0000000..fcb857f
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile }  */
+/* { dg-require-effective-target arm_v8_2a_fp16_scalar_ok }  */
+/* { dg-options "-O2 -marm" }  */
+/* { dg-add-options arm_v8_2a_fp16_scalar }  */
+
+__fp16
+test_select (__fp16 a, __fp16 b, __fp16 c)
+{
+  return (a < b) ? b : c;
+}
+/* { dg-final { scan-assembler "bmi" } } */