Inline immediates for AMD GCN instructions are supposed to be in the range -16..64 inclusive, but the implementation had the upper bound exclusive.

This patch fixes the error.

Andrew
Fix amdgcn inline immediate range

2020-01-06  Andrew Stubbs  <a...@codesourcery.com>

	gcc/
	* config/gcn/gcn.c (gcn_inline_constant_p): Allow 64 as an inline
	immediate.

diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index 94f1e45bb3d..b361cffbb84 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -842,7 +842,7 @@ bool
 gcn_inline_constant_p (rtx x)
 {
   if (GET_CODE (x) == CONST_INT)
-    return INTVAL (x) >= -16 && INTVAL (x) < 64;
+    return INTVAL (x) >= -16 && INTVAL (x) <= 64;
   if (GET_CODE (x) == CONST_DOUBLE)
     return gcn_inline_fp_constant_p (x, false);
   if (GET_CODE (x) == CONST_VECTOR)

Reply via email to