diff mbox series

[committed,amdgcn] Fix inline immediate range

Message ID 30f03ddf-cd53-4b39-4858-6d349a8a5165@codesourcery.com
State New
Headers show
Series [committed,amdgcn] Fix inline immediate range | expand

Commit Message

Andrew Stubbs Jan. 6, 2020, 12:27 p.m. UTC
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
diff mbox series

Patch

Fix amdgcn inline immediate range

2020-01-06  Andrew Stubbs  <ams@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)