diff mbox series

[committed,amdgcn] Add LTGT support

Message ID f3cf0b42-6521-721e-4279-b8751ae0bc63@codesourcery.com
State New
Headers show
Series [committed,amdgcn] Add LTGT support | expand

Commit Message

Andrew Stubbs Jan. 30, 2020, 4:52 p.m. UTC
This patch adds support for the LTGT FP comparison operator that was 
previously missing from the backend, and apparently not optional (unlike 
UNLE etc).

It wasn't that we couldn't have it (also unlike UNLE), we just didn't.

Besides just correcting an omission, this also fixes an ICE in testcase 
gcc.dg/pr81228.c.

Andrew
diff mbox series

Patch

Add LTGT operator support for amdgcn

Fixes ICE in testcase gcc.dg/pr81228.c

2020-01-30  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* config/gcn/gcn.c (print_operand): Handle LTGT.
	* config/gcn/predicates.md (gcn_fp_compare_operator): Allow ltgt.

diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c
index c78df1d5e3e..a39e9f3fbd6 100644
--- a/gcc/config/gcn/gcn.c
+++ b/gcc/config/gcn/gcn.c
@@ -5929,6 +5929,9 @@  print_operand (FILE *file, rtx x, int code)
 	  case UNORDERED:
 	    s = "_u_";
 	    break;
+	  case LTGT:
+	    s = "_lg_";
+	    break;
 	  default:
 	    output_operand_lossage ("invalid %%xn code");
 	    return;
diff --git a/gcc/config/gcn/predicates.md b/gcc/config/gcn/predicates.md
index 2f904b1f131..7bf763a4ba5 100644
--- a/gcc/config/gcn/predicates.md
+++ b/gcc/config/gcn/predicates.md
@@ -165,7 +165,7 @@ 
   (match_code "eq,ne,gt,ge,lt,le,gtu,geu,ltu,leu"))
 
 (define_predicate "gcn_fp_compare_operator"
-  (match_code "eq,ne,gt,ge,lt,le,gtu,geu,ltu,leu,ordered,unordered"))
+  (match_code "eq,ne,gt,ge,lt,le,gtu,geu,ltu,leu,ordered,unordered,ltgt"))
 
 (define_predicate "unary_operator"
   (match_code "not,popcount"))