From patchwork Tue Sep 28 06:17:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 65937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6EF46B70B8 for ; Tue, 28 Sep 2010 16:17:40 +1000 (EST) Received: (qmail 17600 invoked by alias); 28 Sep 2010 06:17:36 -0000 Received: (qmail 17591 invoked by uid 22791); 28 Sep 2010 06:17:35 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_ZJ, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qy0-f182.google.com (HELO mail-qy0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Sep 2010 06:17:31 +0000 Received: by qyk7 with SMTP id 7so6466540qyk.20 for ; Mon, 27 Sep 2010 23:17:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.60.136 with SMTP id p8mr6405354qah.216.1285654649153; Mon, 27 Sep 2010 23:17:29 -0700 (PDT) Received: by 10.229.84.4 with HTTP; Mon, 27 Sep 2010 23:17:29 -0700 (PDT) Date: Tue, 28 Sep 2010 08:17:29 +0200 Message-ID: Subject: [PATCH, i386]: Split *avx_3 From: Uros Bizjak To: gcc-patches@gcc.gnu.org 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 Hello! IMO, it is not possible for humans to determine the logic from current pattern how prefix_extra is calculated. Attached patch splits the pattern in two and also removes maxmin code iterator that is used only for this pattern. 2010-09-28 Uros Bizjak * config/i386/sse.md (*avx_3): Split from *avx_3. (*avx_3): Ditto. * config/i386/i386.md (maxmin): Remove code iterator. Tested on x86_64-pc-linux-gnu, committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 164643) +++ i386.md (working copy) @@ -712,9 +712,6 @@ ;; Mapping of unsigned max and min (define_code_iterator umaxmin [umax umin]) -;; Mapping of signed/unsigned max and min -(define_code_iterator maxmin [smax smin umax umin]) - ;; Base name for integer and FP insn mnemonic (define_code_attr maxmin_int [(smax "maxs") (smin "mins") (umax "maxu") (umin "minu")]) Index: sse.md =================================================================== --- sse.md (revision 164643) +++ sse.md (working copy) @@ -6031,18 +6031,16 @@ (define_insn "*avx_3" [(set (match_operand:SSEMODE124 0 "register_operand" "=x") - (maxmin:SSEMODE124 + (umaxmin:SSEMODE124 (match_operand:SSEMODE124 1 "nonimmediate_operand" "%x") (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))] "TARGET_AVX && ix86_binary_operator_ok (, mode, operands)" "vp\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sseiadd") (set (attr "prefix_extra") - (if_then_else - (ne (symbol_ref "mode != (( == SMAX || == SMIN) ? V8HImode : V16QImode)") - (const_int 0)) - (const_string "1") - (const_string "0"))) + (if_then_else (match_operand:V16QI 0 "" "") + (const_string "0") + (const_string "1"))) (set_attr "prefix" "vex") (set_attr "mode" "TI")]) @@ -6065,6 +6063,21 @@ (set_attr "prefix_data16" "1") (set_attr "mode" "TI")]) +(define_insn "*avx_3" + [(set (match_operand:SSEMODE124 0 "register_operand" "=x") + (smaxmin:SSEMODE124 + (match_operand:SSEMODE124 1 "nonimmediate_operand" "%x") + (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))] + "TARGET_AVX && ix86_binary_operator_ok (, mode, operands)" + "vp\t{%2, %1, %0|%0, %1, %2}" + [(set_attr "type" "sseiadd") + (set (attr "prefix_extra") + (if_then_else (match_operand:V8HI 0 "" "") + (const_string "0") + (const_string "1"))) + (set_attr "prefix" "vex") + (set_attr "mode" "TI")]) + (define_expand "v8hi3" [(set (match_operand:V8HI 0 "register_operand" "") (smaxmin:V8HI @@ -6917,7 +6930,7 @@ } [(set_attr "type" "sselog") (set (attr "prefix_extra") - (if_then_else (match_operand:V8HI 0 "register_operand" "") + (if_then_else (match_operand:V8HI 0 "" "") (const_string "0") (const_string "1"))) (set_attr "length_immediate" "1")