[Committed,AArch64] Fix fp16 test failures after PR82964 fix

Message ID DB6PR0801MB205325B8E4337B9DB020B20683E80@DB6PR0801MB2053.eurprd08.prod.outlook.com
State New
Headers show
  • [Committed,AArch64] Fix fp16 test failures after PR82964 fix
Related show

Commit Message

Wilco Dijkstra Jan. 18, 2018, 4:41 p.m.
This fixes test failures in gcc.target/aarch64/f16_mov_immediate_*.c
after fixing PR82964 (https://gcc.gnu.org/ml/gcc-patches/2018-01/msg01636.html). 
The check for a scalar floating point constant didn't include 16-bit floating point modes,
so use GET_MODE_CLASS instead.

This fixes the failures and has no effect otherwise.  Committed as trivial fix.

2018-01-18  Wilco Dijkstra  <wdijkstr@arm.com>

	PR target/82964
	* config/aarch64/aarch64.c (aarch64_legitimate_constant_p):
	Use GET_MODE_CLASS for scalar floating point.


diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 671168cc3f32ac3f2669fc79835435fdf618a56d..c6a83c881038873d8b68e36f906783be63ddde56 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -11813,8 +11813,7 @@  aarch64_legitimate_constant_p (machine_mode mode, rtx x)
   /* Support CSE and rematerialization of common constants.  */
   if (CONST_INT_P (x)
-      || (CONST_DOUBLE_P (x)
-	  && (mode == SFmode || mode == DFmode || mode == TFmode))
+      || (CONST_DOUBLE_P (x) && GET_MODE_CLASS (mode) == MODE_FLOAT)
       || GET_CODE (x) == CONST_VECTOR)
     return true;