From patchwork Thu Sep 6 18:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 967095 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-485310-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="fIVjmAgz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TL/bGsyA"; 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 425qjd2Kr7z9s4s for ; Fri, 7 Sep 2018 05:03:48 +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=AvCeZmW0tcTKTTH9WplunrCAD18o8pf9DPBhB12FSD8uMr YY++q7ZwIkQ0KbYZ8QrRD+CBLahKwodDJLTZXNdYlFNMndGQ5OlW6t6Aa5EZ/fyA skVRbhhXl+iys+ZhfQiVppbnC8AuJ+URwAUFXp/UqX9vrLuijGiSaXLoR9/3o= 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=bU61MzRPzOtAziqcd7k2dPK1Hc8=; b=fIVjmAgzVbsfo3kfqhJD Pwlwv2dbb+ClXX9IlN019C3s9u4Z2d5gh9xjdHhNikd+PVdumWQrxHyP3QAZ0iYq Z3bIZ0HLRKcVtuya1ZduryJjoXZ8GDPB8WWDRsGrtW2ZCtHiWTkQ1HXYJlp84Md2 NeirUtRfA5Lc4wjVODMnzyU= Received: (qmail 69136 invoked by alias); 6 Sep 2018 18:57:05 -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 69114 invoked by uid 89); 6 Sep 2018 18:57:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=i386.h, UD:i386.h, i386h X-HELO: mail-it0-f45.google.com Received: from mail-it0-f45.google.com (HELO mail-it0-f45.google.com) (209.85.214.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Sep 2018 18:57:01 +0000 Received: by mail-it0-f45.google.com with SMTP id p79-v6so16890413itp.3 for ; Thu, 06 Sep 2018 11:57:00 -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=5IF7zyWM60el+nv+4dEnuMElzuTIxmInZMbKPql1vfA=; b=TL/bGsyAlJ9g/oAaZbMhQcw8eVeauHJ8tQg0uf+79gQvoRj3Dqq0Y9IYmIpTlDMdXa +GvZOdwt+J5CzgUVov+6mr9Wi2JVHXnA/VqFBAdoFues22YESSPvo7TCEOB+9vv1yMaB uxyXh8P2XWPkhWq4TN5V4NJgwXv4ghMxV4BleZg7JxlTp45jGzRwkGvpRMao5lUbM61F qNcEAljcf+t0GJnftLWt1/6rR0eD4VgLg7bCOomrMR6jSHZtOfvZKZWQ0VaTf58eiJrA NK5EEQWcW4FIJ55oJKlDTbeUsuVB8fx1pOe3aF9t2zx3w77Dqu2tC/U5lAM4khXsfabA 5I/Q== MIME-Version: 1.0 Received: by 2002:a02:694f:0:0:0:0:0 with HTTP; Thu, 6 Sep 2018 11:56:58 -0700 (PDT) From: Uros Bizjak Date: Thu, 6 Sep 2018 20:56:58 +0200 Message-ID: Subject: [PATCH, i386]: Rewrite fix_trunc patterns To: "gcc-patches@gcc.gnu.org" Hello! Similar to recent float_truncate patch, IRA is able to generate output memory location by itself, so there is no need to manually provide one in the pattern. Attached patch rewrites fix_trunc (and similar) patterns to output directly to memory operand. 2018-09-06 Uros Bizjak * config/i386/i386.md (fix_trunc_fisttp_i387_1): Remove. Update callers to gen_fix_trunc_i387_fisttp (fix_trunc_i387_fisttp): Change operand 0 predicate to nonimmediate_operand. (fix_trunc_i387_fisttp_with_temp): Remove insn pattern and corresponding splitters. (*fix_trunc_i387_1): Always expand with fix_trunc_i387. (fix_truncdi_i387): Change operand 0 predicate to nonimmediate_operand. (fix_truncdi_i387_with_temp): Remove insn pattern and corresponding splitters. (fix_trunc_i387): Change operand 0 predicate to nonimmediate_operand. (fix_trunc_i387_with_temp): Remove insn pattern and corresponding splitters. (*fistdi2_1): Remove. (fistdi2): Ditto. (fistdi2_with_temp): Remove insn pattern and corresponding splitters. (lrintxfdi2): Remove expander. Reimplement as define_insn. (*fist2_1): Remove. (fist2): Ditto. (fist2_with_temp): Remove insn pattern and corresponding splitters. (lrintxf2): Remove expander. Reimplement as define_insn. (*fist2__1): Always expand with fist2_. (fistdi2_): Change operand 0 predicate to nonimmediate_operand. (fistdi2__with_temp): Remove insn pattern and corresponding splitters. (fist2_): Change operand 0 predicate to nonimmediate_operand. (fist2__with_temp): Remove insn pattern and corresponding splitters. (*fixuns_truncsi2_avx512f_zext): Depend on TARGET_SSE_MATH. Patch was bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 264130) +++ i386.md (working copy) @@ -4736,7 +4736,7 @@ { if (TARGET_FISTTP) { - emit_insn (gen_fix_truncdi_fisttp_i387_1 (operands[0], operands[1])); + emit_insn (gen_fix_truncdi_i387_fisttp (operands[0], operands[1])); DONE; } }) @@ -4750,7 +4750,7 @@ if (TARGET_FISTTP && !(TARGET_64BIT && SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)) { - emit_insn (gen_fix_truncdi_fisttp_i387_1 (operands[0], operands[1])); + emit_insn (gen_fix_truncdi_i387_fisttp (operands[0], operands[1])); DONE; } if (TARGET_64BIT && SSE_FLOAT_MODE_P (mode)) @@ -4773,7 +4773,7 @@ { if (TARGET_FISTTP) { - emit_insn (gen_fix_truncsi_fisttp_i387_1 (operands[0], operands[1])); + emit_insn (gen_fix_truncsi_i387_fisttp (operands[0], operands[1])); DONE; } }) @@ -4787,7 +4787,7 @@ if (TARGET_FISTTP && !(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)) { - emit_insn (gen_fix_truncsi_fisttp_i387_1 (operands[0], operands[1])); + emit_insn (gen_fix_truncsi_i387_fisttp (operands[0], operands[1])); DONE; } if (SSE_FLOAT_MODE_P (mode)) @@ -4811,7 +4811,7 @@ { if (TARGET_FISTTP) { - emit_insn (gen_fix_trunchi_fisttp_i387_1 (operands[0], operands[1])); + emit_insn (gen_fix_trunchi_i387_fisttp (operands[0], operands[1])); DONE; } }) @@ -4875,7 +4875,7 @@ (zero_extend:DI (unsigned_fix:SI (match_operand:MODEF 1 "nonimmediate_operand" "vm"))))] - "TARGET_64BIT && TARGET_AVX512F" + "TARGET_64BIT && TARGET_AVX512F && TARGET_SSE_MATH" "vcvtt2usi\t{%1, %k0|%k0, %1}" [(set_attr "type" "sseicvt") (set_attr "prefix" "evex") @@ -4940,35 +4940,8 @@ [(set (match_dup 2) (match_dup 1)) (set (match_dup 0) (fix:SWI48 (match_dup 2)))]) -(define_insn_and_split "fix_trunc_fisttp_i387_1" - [(set (match_operand:SWI248x 0 "nonimmediate_operand") - (fix:SWI248x (match_operand 1 "register_operand")))] - "X87_FLOAT_MODE_P (GET_MODE (operands[1])) - && TARGET_FISTTP - && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) - && (TARGET_64BIT || mode != DImode)) - && TARGET_SSE_MATH) - && can_create_pseudo_p ()" - "#" - "&& 1" - [(const_int 0)] -{ - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fix_trunc_i387_fisttp (operands[0], operands[1])); - else - { - operands[2] = assign_386_stack_local (mode, SLOT_TEMP); - emit_insn (gen_fix_trunc_i387_fisttp_with_temp (operands[0], - operands[1], - operands[2])); - } - DONE; -} - [(set_attr "type" "fisttp") - (set_attr "mode" "")]) - (define_insn "fix_trunc_i387_fisttp" - [(set (match_operand:SWI248x 0 "memory_operand" "=m") + [(set (match_operand:SWI248x 0 "nonimmediate_operand" "=m") (fix:SWI248x (match_operand 1 "register_operand" "f"))) (clobber (match_scratch:XF 2 "=&1f"))] "X87_FLOAT_MODE_P (GET_MODE (operands[1])) @@ -4980,39 +4953,6 @@ [(set_attr "type" "fisttp") (set_attr "mode" "")]) -(define_insn "fix_trunc_i387_fisttp_with_temp" - [(set (match_operand:SWI248x 0 "nonimmediate_operand" "=m,?r") - (fix:SWI248x (match_operand 1 "register_operand" "f,f"))) - (clobber (match_operand:SWI248x 2 "memory_operand" "=X,m")) - (clobber (match_scratch:XF 3 "=&1f,&1f"))] - "X87_FLOAT_MODE_P (GET_MODE (operands[1])) - && TARGET_FISTTP - && !((SSE_FLOAT_MODE_P (GET_MODE (operands[1])) - && (TARGET_64BIT || mode != DImode)) - && TARGET_SSE_MATH)" - "#" - [(set_attr "type" "fisttp") - (set_attr "mode" "")]) - -(define_split - [(set (match_operand:SWI248x 0 "register_operand") - (fix:SWI248x (match_operand 1 "register_operand"))) - (clobber (match_operand:SWI248x 2 "memory_operand")) - (clobber (match_scratch 3))] - "reload_completed" - [(parallel [(set (match_dup 2) (fix:SWI248x (match_dup 1))) - (clobber (match_dup 3))]) - (set (match_dup 0) (match_dup 2))]) - -(define_split - [(set (match_operand:SWI248x 0 "memory_operand") - (fix:SWI248x (match_operand 1 "register_operand"))) - (clobber (match_operand:SWI248x 2 "memory_operand")) - (clobber (match_scratch 3))] - "reload_completed" - [(parallel [(set (match_dup 0) (fix:SWI248x (match_dup 1))) - (clobber (match_dup 3))])]) - ;; See the comments in i386.h near OPTIMIZE_MODE_SWITCHING for the description ;; of the machinery. Please note the clobber of FLAGS_REG. In i387 control ;; word calculation (inserted by LCM in mode switching pass) a FLAGS_REG @@ -5035,16 +4975,9 @@ operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); operands[3] = assign_386_stack_local (HImode, SLOT_CW_TRUNC); - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fix_trunc_i387 (operands[0], operands[1], - operands[2], operands[3])); - else - { - operands[4] = assign_386_stack_local (mode, SLOT_TEMP); - emit_insn (gen_fix_trunc_i387_with_temp (operands[0], operands[1], - operands[2], operands[3], - operands[4])); - } + + emit_insn (gen_fix_trunc_i387 (operands[0], operands[1], + operands[2], operands[3])); DONE; } [(set_attr "type" "fistp") @@ -5052,7 +4985,7 @@ (set_attr "mode" "")]) (define_insn "fix_truncdi_i387" - [(set (match_operand:DI 0 "memory_operand" "=m") + [(set (match_operand:DI 0 "nonimmediate_operand" "=m") (fix:DI (match_operand 1 "register_operand" "f"))) (use (match_operand:HI 2 "memory_operand" "m")) (use (match_operand:HI 3 "memory_operand" "m")) @@ -5065,50 +4998,8 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "DI")]) -(define_insn "fix_truncdi_i387_with_temp" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") - (fix:DI (match_operand 1 "register_operand" "f,f"))) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:DI 4 "memory_operand" "=X,m")) - (clobber (match_scratch:XF 5 "=&1f,&1f"))] - "X87_FLOAT_MODE_P (GET_MODE (operands[1])) - && !TARGET_FISTTP - && !(TARGET_64BIT && SSE_FLOAT_MODE_P (GET_MODE (operands[1])))" - "#" - [(set_attr "type" "fistp") - (set_attr "i387_cw" "trunc") - (set_attr "mode" "DI")]) - -(define_split - [(set (match_operand:DI 0 "register_operand") - (fix:DI (match_operand 1 "register_operand"))) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:DI 4 "memory_operand")) - (clobber (match_scratch 5))] - "reload_completed" - [(parallel [(set (match_dup 4) (fix:DI (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (match_dup 5))]) - (set (match_dup 0) (match_dup 4))]) - -(define_split - [(set (match_operand:DI 0 "memory_operand") - (fix:DI (match_operand 1 "register_operand"))) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:DI 4 "memory_operand")) - (clobber (match_scratch 5))] - "reload_completed" - [(parallel [(set (match_dup 0) (fix:DI (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (match_dup 5))])]) - (define_insn "fix_trunc_i387" - [(set (match_operand:SWI24 0 "memory_operand" "=m") + [(set (match_operand:SWI24 0 "nonimmediate_operand" "=m") (fix:SWI24 (match_operand 1 "register_operand" "f"))) (use (match_operand:HI 2 "memory_operand" "m")) (use (match_operand:HI 3 "memory_operand" "m"))] @@ -5120,43 +5011,6 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "")]) -(define_insn "fix_trunc_i387_with_temp" - [(set (match_operand:SWI24 0 "nonimmediate_operand" "=m,?r") - (fix:SWI24 (match_operand 1 "register_operand" "f,f"))) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:SWI24 4 "memory_operand" "=X,m"))] - "X87_FLOAT_MODE_P (GET_MODE (operands[1])) - && !TARGET_FISTTP - && !SSE_FLOAT_MODE_P (GET_MODE (operands[1]))" - "#" - [(set_attr "type" "fistp") - (set_attr "i387_cw" "trunc") - (set_attr "mode" "")]) - -(define_split - [(set (match_operand:SWI24 0 "register_operand") - (fix:SWI24 (match_operand 1 "register_operand"))) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:SWI24 4 "memory_operand"))] - "reload_completed" - [(parallel [(set (match_dup 4) (fix:SWI24 (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3))]) - (set (match_dup 0) (match_dup 4))]) - -(define_split - [(set (match_operand:SWI24 0 "memory_operand") - (fix:SWI24 (match_operand 1 "register_operand"))) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:SWI24 4 "memory_operand"))] - "reload_completed" - [(parallel [(set (match_dup 0) (fix:SWI24 (match_dup 1))) - (use (match_dup 2)) - (use (match_dup 3))])]) - (define_insn "x86_fnstcw_1" [(set (match_operand:HI 0 "memory_operand" "=m") (unspec:HI [(reg:HI FPCR_REG)] UNSPEC_FSTCW))] @@ -16554,31 +16408,8 @@ DONE; }) -(define_insn_and_split "*fistdi2_1" - [(set (match_operand:DI 0 "nonimmediate_operand") - (unspec:DI [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST))] - "TARGET_USE_FANCY_MATH_387 - && can_create_pseudo_p ()" - "#" - "&& 1" - [(const_int 0)] -{ - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fistdi2 (operands[0], operands[1])); - else - { - operands[2] = assign_386_stack_local (DImode, SLOT_TEMP); - emit_insn (gen_fistdi2_with_temp (operands[0], operands[1], - operands[2])); - } - DONE; -} - [(set_attr "type" "fpspc") - (set_attr "mode" "DI")]) - -(define_insn "fistdi2" - [(set (match_operand:DI 0 "memory_operand" "=m") +(define_insn "lrintxfdi2" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m") (unspec:DI [(match_operand:XF 1 "register_operand" "f")] UNSPEC_FIST)) (clobber (match_scratch:XF 2 "=&1f"))] @@ -16587,58 +16418,8 @@ [(set_attr "type" "fpspc") (set_attr "mode" "DI")]) -(define_insn "fistdi2_with_temp" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") - (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] - UNSPEC_FIST)) - (clobber (match_operand:DI 2 "memory_operand" "=X,m")) - (clobber (match_scratch:XF 3 "=&1f,&1f"))] - "TARGET_USE_FANCY_MATH_387" - "#" - [(set_attr "type" "fpspc") - (set_attr "mode" "DI")]) - -(define_split - [(set (match_operand:DI 0 "register_operand") - (unspec:DI [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST)) - (clobber (match_operand:DI 2 "memory_operand")) - (clobber (match_scratch 3))] - "reload_completed" - [(parallel [(set (match_dup 2) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) - (clobber (match_dup 3))]) - (set (match_dup 0) (match_dup 2))]) - -(define_split - [(set (match_operand:DI 0 "memory_operand") - (unspec:DI [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST)) - (clobber (match_operand:DI 2 "memory_operand")) - (clobber (match_scratch 3))] - "reload_completed" - [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) - (clobber (match_dup 3))])]) - -(define_insn_and_split "*fist2_1" - [(set (match_operand:SWI24 0 "register_operand") - (unspec:SWI24 [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST))] - "TARGET_USE_FANCY_MATH_387 - && can_create_pseudo_p ()" - "#" - "&& 1" - [(const_int 0)] -{ - operands[2] = assign_386_stack_local (mode, SLOT_TEMP); - emit_insn (gen_fist2_with_temp (operands[0], operands[1], - operands[2])); - DONE; -} - [(set_attr "type" "fpspc") - (set_attr "mode" "")]) - -(define_insn "fist2" - [(set (match_operand:SWI24 0 "memory_operand" "=m") +(define_insn "lrintxf2" + [(set (match_operand:SWI24 0 "nonimmediate_operand" "=m") (unspec:SWI24 [(match_operand:XF 1 "register_operand" "f")] UNSPEC_FIST))] "TARGET_USE_FANCY_MATH_387" @@ -16646,39 +16427,6 @@ [(set_attr "type" "fpspc") (set_attr "mode" "")]) -(define_insn "fist2_with_temp" - [(set (match_operand:SWI24 0 "register_operand" "=r") - (unspec:SWI24 [(match_operand:XF 1 "register_operand" "f")] - UNSPEC_FIST)) - (clobber (match_operand:SWI24 2 "memory_operand" "=m"))] - "TARGET_USE_FANCY_MATH_387" - "#" - [(set_attr "type" "fpspc") - (set_attr "mode" "")]) - -(define_split - [(set (match_operand:SWI24 0 "register_operand") - (unspec:SWI24 [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST)) - (clobber (match_operand:SWI24 2 "memory_operand"))] - "reload_completed" - [(set (match_dup 2) (unspec:SWI24 [(match_dup 1)] UNSPEC_FIST)) - (set (match_dup 0) (match_dup 2))]) - -(define_split - [(set (match_operand:SWI24 0 "memory_operand") - (unspec:SWI24 [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST)) - (clobber (match_operand:SWI24 2 "memory_operand"))] - "reload_completed" - [(set (match_dup 0) (unspec:SWI24 [(match_dup 1)] UNSPEC_FIST))]) - -(define_expand "lrintxf2" - [(set (match_operand:SWI248x 0 "nonimmediate_operand") - (unspec:SWI248x [(match_operand:XF 1 "register_operand")] - UNSPEC_FIST))] - "TARGET_USE_FANCY_MATH_387") - (define_expand "lrint2" [(set (match_operand:SWI48 0 "nonimmediate_operand") (unspec:SWI48 [(match_operand:MODEF 1 "register_operand")] @@ -16918,16 +16666,9 @@ operands[2] = assign_386_stack_local (HImode, SLOT_CW_STORED); operands[3] = assign_386_stack_local (HImode, SLOT_CW_); - if (memory_operand (operands[0], VOIDmode)) - emit_insn (gen_fist2_ (operands[0], operands[1], - operands[2], operands[3])); - else - { - operands[4] = assign_386_stack_local (mode, SLOT_TEMP); - emit_insn (gen_fist2__with_temp - (operands[0], operands[1], operands[2], - operands[3], operands[4])); - } + + emit_insn (gen_fist2_ (operands[0], operands[1], + operands[2], operands[3])); DONE; } [(set_attr "type" "fistp") @@ -16935,7 +16676,7 @@ (set_attr "mode" "")]) (define_insn "fistdi2_" - [(set (match_operand:DI 0 "memory_operand" "=m") + [(set (match_operand:DI 0 "nonimmediate_operand" "=m") (unspec:DI [(match_operand:XF 1 "register_operand" "f")] FIST_ROUNDING)) (use (match_operand:HI 2 "memory_operand" "m")) @@ -16948,54 +16689,8 @@ (set_attr "i387_cw" "") (set_attr "mode" "DI")]) -(define_insn "fistdi2__with_temp" - [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") - (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:DI 4 "memory_operand" "=X,m")) - (clobber (match_scratch:XF 5 "=&1f,&1f"))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "#" - [(set_attr "type" "fistp") - (set_attr "i387_cw" "") - (set_attr "mode" "DI")]) - -(define_split - [(set (match_operand:DI 0 "register_operand") - (unspec:DI [(match_operand:XF 1 "register_operand")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:DI 4 "memory_operand")) - (clobber (match_scratch 5))] - "reload_completed" - [(parallel [(set (match_dup 4) - (unspec:DI [(match_dup 1)] FIST_ROUNDING)) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (match_dup 5))]) - (set (match_dup 0) (match_dup 4))]) - -(define_split - [(set (match_operand:DI 0 "memory_operand") - (unspec:DI [(match_operand:XF 1 "register_operand")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:DI 4 "memory_operand")) - (clobber (match_scratch 5))] - "reload_completed" - [(parallel [(set (match_dup 0) - (unspec:DI [(match_dup 1)] FIST_ROUNDING)) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (match_dup 5))])]) - (define_insn "fist2_" - [(set (match_operand:SWI24 0 "memory_operand" "=m") + [(set (match_operand:SWI24 0 "nonimmediate_operand" "=m") (unspec:SWI24 [(match_operand:XF 1 "register_operand" "f")] FIST_ROUNDING)) (use (match_operand:HI 2 "memory_operand" "m")) @@ -17007,47 +16702,6 @@ (set_attr "i387_cw" "") (set_attr "mode" "")]) -(define_insn "fist2__with_temp" - [(set (match_operand:SWI24 0 "nonimmediate_operand" "=m,?r") - (unspec:SWI24 [(match_operand:XF 1 "register_operand" "f,f")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand" "m,m")) - (use (match_operand:HI 3 "memory_operand" "m,m")) - (clobber (match_operand:SWI24 4 "memory_operand" "=X,m"))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "#" - [(set_attr "type" "fistp") - (set_attr "i387_cw" "") - (set_attr "mode" "")]) - -(define_split - [(set (match_operand:SWI24 0 "register_operand") - (unspec:SWI24 [(match_operand:XF 1 "register_operand")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:SWI24 4 "memory_operand"))] - "reload_completed" - [(parallel [(set (match_dup 4) - (unspec:SWI24 [(match_dup 1)] FIST_ROUNDING)) - (use (match_dup 2)) - (use (match_dup 3))]) - (set (match_dup 0) (match_dup 4))]) - -(define_split - [(set (match_operand:SWI24 0 "memory_operand") - (unspec:SWI24 [(match_operand:XF 1 "register_operand")] - FIST_ROUNDING)) - (use (match_operand:HI 2 "memory_operand")) - (use (match_operand:HI 3 "memory_operand")) - (clobber (match_operand:SWI24 4 "memory_operand"))] - "reload_completed" - [(parallel [(set (match_dup 0) - (unspec:SWI24 [(match_dup 1)] FIST_ROUNDING)) - (use (match_dup 2)) - (use (match_dup 3))])]) - (define_expand "lxf2" [(parallel [(set (match_operand:SWI248x 0 "nonimmediate_operand") (unspec:SWI248x [(match_operand:XF 1 "register_operand")]