From patchwork Sat Nov 23 19:19:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 293679 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 505802C00CE for ; Sun, 24 Nov 2013 06:26:17 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :content-type:subject:date:message-id:cc:to:mime-version; q=dns; s=default; b=GLlDa2/c8C9LIgP+fNV4K82RI9Xo0e2G0Tz5Vqv3hp3uf9SUC7 ikKTHePq77tEnf0F3M2QOgjfElweYHusg4WAZfbsDDF7TkLcXrQvqPbsoqUIc64b 6hDf1vLvqPVZR9pF21+hjrYd0LQZYqkyye4V/0kvfJdKYikVqMyaLGhuw= 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:from :content-type:subject:date:message-id:cc:to:mime-version; s= default; bh=hS+wCPXpZZMCRfOJdzsG6v7N+Oo=; b=F/QI3uHGy3P8vqAhiqC7 AfcYsDxq2zUzFtVJrTZHKou9X4fTJ1sIZh4Sm7pOpA4KVkcqXNOQbabiK8Qrx2LP jRLNBd7PtDA3loTAllF7oSnCZKaKjTq0Ngp5BtTdubf71hvPhN/yg8ZzkZ1UDbz0 7zOCWs7qVkX95RJGvCnVCvE= Received: (qmail 30886 invoked by alias); 23 Nov 2013 19:21:27 -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 30850 invoked by uid 89); 23 Nov 2013 19:21:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_BL_SPAMCOP_NET, RDNS_NONE, SPF_PASS autolearn=no version=3.3.2 X-HELO: qmta11.emeryville.ca.mail.comcast.net Received: from Unknown (HELO qmta11.emeryville.ca.mail.comcast.net) (76.96.27.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 23 Nov 2013 19:19:55 +0000 Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta11.emeryville.ca.mail.comcast.net with comcast id t6aX1m0050S2fkCAB7Koni; Sat, 23 Nov 2013 19:19:48 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta09.emeryville.ca.mail.comcast.net with comcast id t7KT1m00R0BKwT48V7Ko8T; Sat, 23 Nov 2013 19:19:48 +0000 From: Mike Stump Subject: wide-int, avr Date: Sat, 23 Nov 2013 11:19:48 -0800 Message-Id: <88E5F2DD-2D51-4E14-B13F-D889296EFD21@comcast.net> Cc: Denis Chertykov , Kenneth Zadeck To: "gcc-patches@gcc.gnu.org Patches" Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-IsSubscribed: yes Richi has asked the we break the wide-int patch so that the individual port and front end maintainers can review their parts without have to go through the entire patch. This patch covers the avr port. Ok? * config/avr/avr.c (avr_out_round): Use wide-int interfaces. (avr_fold_builtin): Likewise. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 8d98c81..e94e0d7 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -7550,6 +7550,8 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen) // The smallest fractional bit not cleared by the rounding is 2^(-RP). int fbit = (int) GET_MODE_FBIT (mode); double_int i_add = double_int_zero.set_bit (fbit-1 - INTVAL (xop[2])); + wide_int wi_add = wi::set_bit_in_zero (fbit-1 - INTVAL (xop[2]), + GET_MODE_PRECISION (imode)); // Lengths of PLUS and AND parts. int len_add = 0, *plen_add = plen ? &len_add : NULL; int len_and = 0, *plen_and = plen ? &len_and : NULL; @@ -7579,7 +7581,7 @@ avr_out_round (rtx insn ATTRIBUTE_UNUSED, rtx *xop, int *plen) // Rounding point ^^^^^^^ // Added above ^^^^^^^^^ rtx xreg = simplify_gen_subreg (imode, xop[0], mode, 0); - rtx xmask = immed_double_int_const (-i_add - i_add, imode); + rtx xmask = immed_wide_int_const (-wi_add - wi_add, imode); xpattern = gen_rtx_SET (VOIDmode, xreg, gen_rtx_AND (imode, xreg, xmask)); @@ -12230,7 +12232,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, break; } - tmap = double_int_to_tree (map_type, tree_to_double_int (arg[0])); + tmap = wide_int_to_tree (map_type, arg[0]); map = TREE_INT_CST_LOW (tmap); if (TREE_CODE (tval) != INTEGER_CST @@ -12335,8 +12337,7 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, /* Use map o G^-1 instead of original map to undo the effect of G. */ - tmap = double_int_to_tree (map_type, - double_int::from_uhwi (best_g.map)); + tmap = wide_int_to_tree (map_type, best_g.map); return build_call_expr (fndecl, 3, tmap, tbits, tval); } /* AVR_BUILTIN_INSERT_BITS */