From patchwork Fri Jan 24 14:58:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Stubbs X-Patchwork-Id: 1228854 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-518220-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha1 header.s=default header.b=Q09Y29I/; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4842MR6Nm1z9sS3 for ; Sat, 25 Jan 2020 01:58:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=WBe6EAo+e77M6b7bmtU16JionntWXongrVm81XnA8mu9tO09S+ ovt0Ae7Dssbk3L1DER7qfiCx9o7HYlga9ahA5/P2KRoyGm3W2wtk2hRIhScrby9a BxnVKo/wWQYCl+/QAoZe/Hv4gBlVPD1z5SeJhUbvggiPpXqlBm6GS09Hk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=WjH80qP1CYdC9wde/U92tT7Tqd8=; b=Q09Y29I/WgY0KJXR0Tzg 9ZAV73jnZRecK66Q5XgxzgNyciJYVdYSBJJ4REY8OiOuVRBrhBHH9rhQJY0HbBgo J77Dujwtquc1XE2vTeBRa82ePNCKkGZho/CAzQOGpcK5tXt4/iJJUsunJiPmbnxW gSSnvVMefAEzbUY3hP/GEnA= Received: (qmail 79500 invoked by alias); 24 Jan 2020 14:58:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 79492 invoked by uid 89); 24 Jan 2020 14:58:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa3.mentor.iphmx.com Received: from esa3.mentor.iphmx.com (HELO esa3.mentor.iphmx.com) (68.232.137.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Jan 2020 14:58:15 +0000 IronPort-SDR: CTRQ3SXlS1dcZa7/awrl26N6kFctPSOfvb5bVtJGdPEMLbztYnc+5283N8qsal78mMHAMZs8xC 61NO8jlRD+XccFx4QnrFeCkbXY8e3LfxUXtpqJZOtnBoHySNk8i0EjAlU9MRm6qqxkvS7/Nsyn Yp6u2g91s6Jnd4jCnWmQc8flU9fCQ3aKPNI+Y1E+mr895rmMaKAyt6+L59RxR5Dy5reN7Qj2FD rU7qju3XQVF7d/Jlvhac4Fk3tbDmRK2hQKbuCQ2Oszj1lsaL5xn6RETGHtv5fBlUvLf6m9hraY 69M= Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 24 Jan 2020 06:58:13 -0800 IronPort-SDR: Lxn5QAtU5Z5zZl2pi8IeCUJbusvAGpY0RGyFOo1pE0EHsgprZKHflIAm6levC4w9jczZ3Ve5Zc jMhwqOvt59wg== To: "gcc-patches@gcc.gnu.org" From: Andrew Stubbs Subject: [committed, amdgcn] Fix ICE on unsupported FP comparison Message-ID: Date: Fri, 24 Jan 2020 14:58:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 I've committed this patch to fix an ICE building the gcc.dg/vect/fast-math-pr55281.c testcase. The problem was that the combine pass was trying to use the "unle" and "ungt" FP comparison operators. There's no hardware support for these, so the operators should have been rejected, but the predicates were too loose. Andrew Fix ICE on unsupported FP comparison 2020-01-24 Andrew Stubbs gcc/ * config/gcn/gcn-valu.md (vec_cmpdi): Use gcn_fp_compare_operator. (vec_cmpudi): Use gcn_compare_operator. (vec_cmpv64qidi): Use gcn_compare_operator. (vec_cmpdi_exec): Use gcn_fp_compare_operator. (vec_cmpudi_exec): Use gcn_compare_operator. (vec_cmpv64qidi_exec): Use gcn_compare_operator. (vec_cmpdi_dup): Use gcn_fp_compare_operator. (vec_cmpdi_dup_exec): Use gcn_fp_compare_operator. (vcond): Use gcn_fp_compare_operator. (vcond_exec): Use gcn_fp_compare_operator. (vcondu): Use gcn_fp_compare_operator. (vcondu_exec): Use gcn_fp_compare_operator. diff --git a/gcc/config/gcn/gcn-valu.md b/gcc/config/gcn/gcn-valu.md index 7c3de8cbc7e..331c768cb88 100644 --- a/gcc/config/gcn/gcn-valu.md +++ b/gcc/config/gcn/gcn-valu.md @@ -2530,7 +2530,7 @@ (define_insn "vec_cmpdi" [(set (match_operand:DI 0 "register_operand" "=cV,cV, e, e,Sg,Sg") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_fp_compare_operator" [(match_operand:VCMP_MODE 2 "gcn_alu_operand" "vSv, B,vSv, B, v,vA") (match_operand:VCMP_MODE 3 "gcn_vop3_operand" @@ -2549,7 +2549,7 @@ (define_expand "vec_cmpudi" [(match_operand:DI 0 "register_operand") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_compare_operator" [(match_operand:VCMP_MODE_INT 2 "gcn_alu_operand") (match_operand:VCMP_MODE_INT 3 "gcn_vop3_operand")])] "" @@ -2565,7 +2565,7 @@ ; There's no instruction for 8-bit vector comparison, so we need to extend. (define_expand "vec_cmpv64qidi" [(match_operand:DI 0 "register_operand") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_compare_operator" [(any_extend:V64SI (match_operand:V64QI 2 "gcn_alu_operand")) (any_extend:V64SI (match_operand:V64QI 3 "gcn_vop3_operand"))])] "can_create_pseudo_p ()" @@ -2582,7 +2582,7 @@ (define_insn "vec_cmpdi_exec" [(set (match_operand:DI 0 "register_operand" "=cV,cV, e, e,Sg,Sg") (and:DI - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_fp_compare_operator" [(match_operand:VCMP_MODE 2 "gcn_alu_operand" "vSv, B,vSv, B, v,vA") (match_operand:VCMP_MODE 3 "gcn_vop3_operand" @@ -2602,7 +2602,7 @@ (define_expand "vec_cmpudi_exec" [(match_operand:DI 0 "register_operand") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_compare_operator" [(match_operand:VCMP_MODE_INT 2 "gcn_alu_operand") (match_operand:VCMP_MODE_INT 3 "gcn_vop3_operand")]) (match_operand:DI 4 "gcn_exec_reg_operand")] @@ -2619,7 +2619,7 @@ (define_expand "vec_cmpv64qidi_exec" [(match_operand:DI 0 "register_operand") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_compare_operator" [(any_extend:V64SI (match_operand:V64QI 2 "gcn_alu_operand")) (any_extend:V64SI (match_operand:V64QI 3 "gcn_vop3_operand"))]) (match_operand:DI 4 "gcn_exec_reg_operand")] @@ -2639,7 +2639,7 @@ (define_insn "vec_cmpdi_dup" [(set (match_operand:DI 0 "register_operand" "=cV,cV, e,e,Sg") - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_fp_compare_operator" [(vec_duplicate:VCMP_MODE (match_operand: 2 "gcn_alu_operand" " Sv, B,Sv,B, A")) @@ -2658,7 +2658,7 @@ (define_insn "vec_cmpdi_dup_exec" [(set (match_operand:DI 0 "register_operand" "=cV,cV, e,e,Sg") (and:DI - (match_operator 1 "comparison_operator" + (match_operator 1 "gcn_fp_compare_operator" [(vec_duplicate:VCMP_MODE (match_operand: 2 "gcn_alu_operand" " Sv, B,Sv,B, A")) @@ -2690,7 +2690,7 @@ [(match_operand:VEC_ALLREG_MODE 0 "register_operand") (match_operand:VEC_ALLREG_MODE 1 "gcn_vop3_operand") (match_operand:VEC_ALLREG_MODE 2 "gcn_alu_operand") - (match_operator 3 "comparison_operator" + (match_operator 3 "gcn_fp_compare_operator" [(match_operand:VEC_ALLREG_ALT 4 "gcn_alu_operand") (match_operand:VEC_ALLREG_ALT 5 "gcn_vop3_operand")])] "" @@ -2707,7 +2707,7 @@ [(match_operand:VEC_ALLREG_MODE 0 "register_operand") (match_operand:VEC_ALLREG_MODE 1 "gcn_vop3_operand") (match_operand:VEC_ALLREG_MODE 2 "gcn_alu_operand") - (match_operator 3 "comparison_operator" + (match_operator 3 "gcn_fp_compare_operator" [(match_operand:VEC_ALLREG_ALT 4 "gcn_alu_operand") (match_operand:VEC_ALLREG_ALT 5 "gcn_vop3_operand")]) (match_operand:DI 6 "gcn_exec_reg_operand" "e")] @@ -2725,7 +2725,7 @@ [(match_operand:VEC_ALLREG_MODE 0 "register_operand") (match_operand:VEC_ALLREG_MODE 1 "gcn_vop3_operand") (match_operand:VEC_ALLREG_MODE 2 "gcn_alu_operand") - (match_operator 3 "comparison_operator" + (match_operator 3 "gcn_fp_compare_operator" [(match_operand:VEC_ALLREG_INT_MODE 4 "gcn_alu_operand") (match_operand:VEC_ALLREG_INT_MODE 5 "gcn_vop3_operand")])] "" @@ -2742,7 +2742,7 @@ [(match_operand:VEC_ALLREG_MODE 0 "register_operand") (match_operand:VEC_ALLREG_MODE 1 "gcn_vop3_operand") (match_operand:VEC_ALLREG_MODE 2 "gcn_alu_operand") - (match_operator 3 "comparison_operator" + (match_operator 3 "gcn_fp_compare_operator" [(match_operand:VEC_ALLREG_INT_MODE 4 "gcn_alu_operand") (match_operand:VEC_ALLREG_INT_MODE 5 "gcn_vop3_operand")]) (match_operand:DI 6 "gcn_exec_reg_operand" "e")]