From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2727 invoked by alias); 13 May 2011 13:57:43 -0000 Received: (qmail 2711 invoked by uid 22791); 13 May 2011 13:57:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 May 2011 13:57:26 +0000 Received: (qmail 17164 invoked from network); 13 May 2011 13:57:26 -0000 Received: from unknown (HELO rex.config) (julian@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 May 2011 13:57:26 -0000 Date: Fri, 13 May 2011 14:26:00 -0000 From: Julian Brown To: gcc-patches@gcc.gnu.org Subject: [PATCH] ARM fixed-point support [1/6]: comparison optab biasing Message-ID: <20110513145721.2fbe289b@rex.config> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/vqqjmOp5UPXiEHpcUQEVeRd" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00974.txt.bz2 --MP_/vqqjmOp5UPXiEHpcUQEVeRd Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 865 As per Joseph's suggestion here: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00846.html I am re-posting machine-independent parts of my ARM fixed-point support patches, with explanations as to why each part is necessary. This is the first: on ARM, TARGET_LIB_INT_CMP_BIASED is false for TARGET_BPABI targets (i.e. most currently-interesting cases -- EABI comparison helper functions return -1/0/1 for lt/eq/gt rather than 0/1/2). However the fixed-point helper library uses biased comparisons unconditionally. So, this patch just makes comparisons between fixed-point quantities use the biasing rather than not. (Grepping config/, in practice, this will only affect ARM.) Tested in a series with other fixed-point patches. OK to apply? Julian ChangeLog gcc/ * optabs.c (prepare_cmp_insn): Use correct biasing for fixed-point comparison helpers. --MP_/vqqjmOp5UPXiEHpcUQEVeRd Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=fixed-point-optab-biasing-2.diff Content-length: 919 commit 12efebd5f56358c2d194659570ad05e089bbaaf3 Author: Julian Brown Date: Fri May 13 05:42:15 2011 -0700 Correct biasing for fixed-point optabs. diff --git a/gcc/optabs.c b/gcc/optabs.c index 62e123b..a1b85b8 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3930,11 +3930,13 @@ prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size, result against 1 in the biased case, and zero in the unbiased case. For unsigned comparisons always compare against 1 after biasing the unbiased result by adding 1. This gives us a way to - represent LTU. */ + represent LTU. + The comparisons in the fixed-point helper library are always + biased. */ x = result; y = const1_rtx; - if (!TARGET_LIB_INT_CMP_BIASED) + if (!TARGET_LIB_INT_CMP_BIASED && !ALL_FIXED_POINT_MODE_P (mode)) { if (unsignedp) x = plus_constant (result, 1); --MP_/vqqjmOp5UPXiEHpcUQEVeRd--