From patchwork Fri Mar 2 20:27:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 144336 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 95C7AB6F62 for ; Sat, 3 Mar 2012 07:28:39 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1331324919; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date: Message-ID:Mime-Version:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=YlLTCMeTjjcX4goPWaFi9Au/Kh0=; b=ao07wOuQmyaACB7 IE3QQNJK/15XwTj7sEVVZhXxJx5ixz99JeFtPJfHFhOfU4haXzmI7sH8uukkBKBK exl8UEU1vApZ/cGCBdJbnGV7AR2vKW+HiHfP/IwasQXORbRr4g/9KjseYQ+Q0ZQf jbdxNzw5CS9XkVnPKPuP+lVtqPns= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Subject:From:To:Cc:In-Reply-To:References:Content-Type:Date:Message-ID:Mime-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=dYzjTAzAYH5Z+jtR8F9/k125pL/u2tF6FHIl57a51rh6/HM7UUnCYKCSdMBqRr zUFs+8bSVIF8laGef2MuYOdBsWw+QmCIDUufIqVfUsQPQQawhKvfXASucXXAzJXx k85rQ3qbaHZWf0gKQnbpbSQnxGZAT5/9GTHR8wBzgnk3Q=; Received: (qmail 8163 invoked by alias); 2 Mar 2012 20:28:34 -0000 Received: (qmail 8150 invoked by uid 22791); 2 Mar 2012 20:28:33 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_OV, TW_VQ, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout09.t-online.de (HELO mailout09.t-online.de) (194.25.134.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Mar 2012 20:28:16 +0000 Received: from fwd04.aul.t-online.de (fwd04.aul.t-online.de ) by mailout09.t-online.de with smtp id 1S3Z5J-00072q-6s; Fri, 02 Mar 2012 21:28:13 +0100 Received: from [192.168.0.104] (r4WdA+Zr8hf89UtxetPtUsU5XYJA13opydIxxWh0pnkTtx+vhR-5ldAe-gYZMY5g5y@[87.157.60.227]) by fwd04.t-online.de with esmtp id 1S3Z5F-1wbJtA0; Fri, 2 Mar 2012 21:28:09 +0100 Subject: Re: [4.7][SH] Binary compatibility with atomic_test_and_test_trueval != 1 From: Oleg Endo To: Richard Henderson Cc: GCC Patches , Jakub Jelinek , kkojima@gcc.gnu.org In-Reply-To: <4F510D55.4090803@redhat.com> References: <4F21D3AC.2030500@redhat.com> <1330442171.2929.150.camel@yam-132-YW-E178-FTW> <4F510D55.4090803@redhat.com> Date: Fri, 02 Mar 2012 21:27:49 +0100 Message-ID: <1330720069.2929.227.camel@yam-132-YW-E178-FTW> 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 On Fri, 2012-03-02 at 10:11 -0800, Richard Henderson wrote: > For proper binary compatibility, we should probably introduce that asap. > You forgot two things in your patch, gen_int_mode and the fact that we > still have to return a boolean (0/1) value. Ah, yes, of course! > > Also in order for the binary compatibility to work right, you'd want to > have the SH test-and-set-trueval set appropriately asap. Kaz, I assume > you'd agree that 0x80 is a good value for the "tas.b" insn? We don't > necessarily need to support tas.b right away, but getting trueval set > right is imperative. > > I'm in the process of sanity testing this on x86_64 with trueval set to 0x80. > Jakub, ok for 4.7 branch if it passes? > Since we're now back to stage 1 again, I'm about to commit this one ... http://gcc.gnu.org/ml/gcc-patches/2012-03/msg00085.html So the SH tas.b instruction support should be there from 4.8. Attached is the hunk from the tas.b patch for 4.8 to define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL. Cheers, Oleg Index: gcc/config/sh/sh.h =================================================================== --- gcc/config/sh/sh.h (revision 184669) +++ gcc/config/sh/sh.h (working copy) @@ -2475,4 +2475,11 @@ /* FIXME: middle-end support for highpart optimizations is missing. */ #define high_life_started reload_in_progress +/* The tas.b instruction sets the 7th bit in the byte, i.e. 0x80. + This value is used by optabs.c atomic op expansion code as well as in + sync.md. It must be defined as signed char here or else the movqi + pattern will refuse to load it as a QImode constant. */ +#undef TARGET_ATOMIC_TEST_AND_SET_TRUEVAL +#define TARGET_ATOMIC_TEST_AND_SET_TRUEVAL ((signed char)0x80) + #endif /* ! GCC_SH_H */