From patchwork Tue Aug 24 16:20:41 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 62609 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 652EBB70A7 for ; Wed, 25 Aug 2010 02:21:17 +1000 (EST) Received: (qmail 908 invoked by alias); 24 Aug 2010 16:21:13 -0000 Received: (qmail 888 invoked by uid 22791); 24 Aug 2010 16:21:11 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, SARE_LWSHORTT, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 Aug 2010 16:20:59 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 9C806BE7; Tue, 24 Aug 2010 18:20:56 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Mc2lY1xvtAcP; Tue, 24 Aug 2010 18:20:54 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id A2BACBE6; Tue, 24 Aug 2010 18:20:54 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.3+Sun/8.14.3/Submit) id o7OGKf67028256; Tue, 24 Aug 2010 18:20:41 +0200 (MEST) From: Rainer Orth To: Richard Henderson Cc: GCC Patches Subject: Re: [PATCH, v8] Vectorized _cpp_clean_line References: <4C702671.2090204@redhat.com> <4C72BC1F.1030605@redhat.com> Date: Tue, 24 Aug 2010 18:20:41 +0200 In-Reply-To: <4C72BC1F.1030605@redhat.com> (Richard Henderson's message of "Mon, 23 Aug 2010 11:21:19 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2.50 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes 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 Richard Henderson writes: > In the short term, could you simply add the appropriate && !defined(__sun__) > or whatever to the #if protecting the sse code? Here's the patch I've tested. i386-pc-solaris2.1[01] bootstraps with Sun as completed successfully, i386-pc-solaris2.9 is running the testsuite, i386-pc-solaris2.8 still running: 2010-08-24 Rainer Orth * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer etc. on Solaris 2/x86. Ok for mainline? To properly fix this, we need several changes: * Check if the assembler used supports SSE2/SSE4.2 insns. * Perform a runtime check if SSE insns can be executed; cf. gcc/testsuite/gcc.target/i386/sse-os-support.h. * On Solaris 10+, link executables using libcpp.a with a linker mapfile like gcc/testsuite/gcc.target/i386/clearcap.map. I'm not sure if the performance gain from this code is worth the effort, though. Rainer diff -r 0cf77b5772bf libcpp/lex.c --- a/libcpp/lex.c Mon Aug 23 13:25:29 2010 +0200 +++ b/libcpp/lex.c Tue Aug 24 17:33:23 2010 +0200 @@ -264,7 +264,17 @@ } } -#if (GCC_VERSION >= 4005) && (defined(__i386__) || defined(__x86_64__)) +/* Disable on Solaris 2/x86 until the following problems can be properly + autoconfed: + + The Solaris 8 assembler cannot assemble SSE2/SSE4.2 insns. + The Solaris 9 assembler cannot assemble SSE4.2 insns. + Before Solaris 9 Update 6, SSE insns cannot be executed. + The Solaris 10+ assembler tags objects with the instruction set + extensions used, so SSE4.2 executables cannot run on machines that + don't support that extension. */ + +#if (GCC_VERSION >= 4005) && (defined(__i386__) || defined(__x86_64__)) && !(defined(__sun__) && defined(__svr4__)) /* Replicated character data to be shared between implementations. Recall that outside of a context with vector support we can't