From patchwork Fri Oct 5 17:11:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 979659 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-487036-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tpQp+WX5"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jFl4zu2t"; 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 42Rbrq3FRWz9s3C for ; Sat, 6 Oct 2018 03:11:37 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=d/PfP/XXzib6dL58ZeuLl/wAsIS06YxprAFGXJumg441cy nH4rL+aLLkDCAl/cps/bwZCoOd4hgxl/zCmeCPh5qGqiWDNPjvHDzN/Q4twHlfU2 vghsIx2adbP7+4ntqivgoAPRnA8s8csuFlKSIwzdO2HM6dExR/w8QF1WZFR6I= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=oG+6rHFnmJbWt5WBkHFq4Q2S/7E=; b=tpQp+WX5XuaP+TloWq3u Gmj4eFCMF7YCIib+fgpe67uB6ZhDvADQgP6vAegh80hbkjmjKDbfRiBzdIYu3bPA w6xsQWgitmdIPYQp4/ws0w25lLryIX41Vgy0jbhOV4M85x9gZlJgWOQISx/7foRc OoUBKkvhtXfx1a0OwjVpGmk= Received: (qmail 13349 invoked by alias); 5 Oct 2018 17:11:29 -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 13319 invoked by uid 89); 5 Oct 2018 17:11:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=multi, HX-Received:3383, HX-Received:sk:k125-v6 X-HELO: mail-it1-f179.google.com Received: from mail-it1-f179.google.com (HELO mail-it1-f179.google.com) (209.85.166.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Oct 2018 17:11:26 +0000 Received: by mail-it1-f179.google.com with SMTP id q70-v6so3538723itb.3 for ; Fri, 05 Oct 2018 10:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=OWySef9iR+S6MJRRVjjSp6zJ1UOITs8IE5steKhS08c=; b=jFl4zu2tLHz0PO153+dBrKtwJxjCFoyxOyExlDKb8AQx7iTTq5fU3xJg+16c+A5P0X 27O7LtPee94tA51pTYi3R9LGN9B9nMmrLLfOseP+jyFTwPwQC0OTciEd4fsvxxTDroBz 03K5Cyusw6q9LJvDs24kjaGFW19x9kpoL3ma23bOYwkp2xOLLuiwfOtNtY3DIzUsnVSu RsT2KMH0/KQPPdPY4Epqt9Havz67gJ+q66p7KX7Bd1Fo3pS/Leh/tnDgZuAAI8YeSBQX uYOf2Qa11ipVuELqZ0w5/17rCd4SpYqMvtYR5yif815Aopu1+zCN2BWBIDWqjMupBfud PO0Q== MIME-Version: 1.0 From: Uros Bizjak Date: Fri, 5 Oct 2018 19:11:11 +0200 Message-ID: Subject: [PATCH, i386]: Merge ftest insn patterns with FP compare insn patterns To: "gcc-patches@gcc.gnu.org" Now that we have universal "C" constraint, we can use it in FP compare insn patterns to merge ftest insn patterns. 2018-10-05 Uros Bizjak * config/i386/i386.md (*cmpxf_i387): Change operand 2 predicate to reg_or_0_operand. Add "C" constraint. (*cmpxf_cc_i387): Ditto. (*cmp_i387): Change operand 2 predicate to nonimm_or_0_operand. Add "C" constraint. (*cmp_cc_i387): Ditto. (*cmp_0_i387): Remove insn pattern. (*cmp_0_cc_i387): Ditto. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 122e57f98cc4..d7afb6a0bdaf 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -1461,52 +1461,18 @@ DONE; }) - ;; FP compares, step 1: ;; Set the FP condition codes and move fpsr to ax. ;; We may not use "#" to split and emit these ;; due to reg-stack pops killing fpsr. -(define_insn "*cmp_0_i387" - [(set (match_operand:HI 0 "register_operand" "=a") - (unspec:HI - [(compare:CCFP - (match_operand:X87MODEF 1 "register_operand" "f") - (match_operand:X87MODEF 2 "const0_operand"))] - UNSPEC_FNSTSW))] - "TARGET_80387" - "* return output_fp_compare (insn, operands, false, false);" - [(set_attr "type" "multi") - (set_attr "unit" "i387") - (set_attr "mode" "")]) - -(define_insn_and_split "*cmp_0_cc_i387" - [(set (reg:CCFP FLAGS_REG) - (compare:CCFP - (match_operand:X87MODEF 1 "register_operand" "f") - (match_operand:X87MODEF 2 "const0_operand"))) - (clobber (match_operand:HI 0 "register_operand" "=a"))] - "TARGET_80387 && TARGET_SAHF && !TARGET_CMOVE" - "#" - "&& reload_completed" - [(set (match_dup 0) - (unspec:HI - [(compare:CCFP (match_dup 1)(match_dup 2))] - UNSPEC_FNSTSW)) - (set (reg:CC FLAGS_REG) - (unspec:CC [(match_dup 0)] UNSPEC_SAHF))] - "" - [(set_attr "type" "multi") - (set_attr "unit" "i387") - (set_attr "mode" "")]) - (define_insn "*cmpxf_i387" [(set (match_operand:HI 0 "register_operand" "=a") (unspec:HI [(compare:CCFP (match_operand:XF 1 "register_operand" "f") - (match_operand:XF 2 "register_operand" "f"))] + (match_operand:XF 2 "reg_or_0_operand" "fC"))] UNSPEC_FNSTSW))] "TARGET_80387" "* return output_fp_compare (insn, operands, false, false);" @@ -1518,7 +1484,7 @@ [(set (reg:CCFP FLAGS_REG) (compare:CCFP (match_operand:XF 1 "register_operand" "f") - (match_operand:XF 2 "register_operand" "f"))) + (match_operand:XF 2 "reg_or_0_operand" "fC"))) (clobber (match_operand:HI 0 "register_operand" "=a"))] "TARGET_80387 && TARGET_SAHF && !TARGET_CMOVE" "#" @@ -1539,7 +1505,7 @@ (unspec:HI [(compare:CCFP (match_operand:MODEF 1 "register_operand" "f") - (match_operand:MODEF 2 "nonimmediate_operand" "fm"))] + (match_operand:MODEF 2 "nonimm_or_0_operand" "fmC"))] UNSPEC_FNSTSW))] "TARGET_80387" "* return output_fp_compare (insn, operands, false, false);" @@ -1551,7 +1517,7 @@ [(set (reg:CCFP FLAGS_REG) (compare:CCFP (match_operand:MODEF 1 "register_operand" "f") - (match_operand:MODEF 2 "nonimmediate_operand" "fm"))) + (match_operand:MODEF 2 "nonimm_or_0_operand" "fmC"))) (clobber (match_operand:HI 0 "register_operand" "=a"))] "TARGET_80387 && TARGET_SAHF && !TARGET_CMOVE" "#"