From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24087 invoked by alias); 9 Dec 2016 13:40:54 -0000 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 Received: (qmail 24069 invoked by uid 89); 9 Dec 2016 13:40:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Dec 2016 13:40:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8BC87152D; Fri, 9 Dec 2016 05:40:49 -0800 (PST) Received: from localhost (e105548-lin.manchester.arm.com [10.45.32.67]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3705B3F477 for ; Fri, 9 Dec 2016 05:40:49 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [66/67] Add a scalar_mode_pod class References: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> Date: Fri, 09 Dec 2016 13:40:00 -0000 In-Reply-To: <87h96dp8u6.fsf@e105548-lin.cambridge.arm.com> (Richard Sandiford's message of "Fri, 09 Dec 2016 12:48:01 +0000") Message-ID: <87k2b9dxuo.fsf@e105548-lin.cambridge.arm.com> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2016-12/txt/msg00843.txt.bz2 This patch adds a scalar_mode_pod class and uses it for fixed_value, instead of machine_mode_enum. gcc/ 2016-11-24 Richard Sandiford Alan Hayward David Sherwood * coretypes.h (scalar_mode_pod): New typedef. * machmode.h (gt_ggc_mx, gt_pch_nx): New functions. * fixed-value.h (fixed_value::mode): Change type to scalar_mode_pod. * fold-const.c (fold_convert_const_int_from_fixed): Use scalar_mode. * tree-streamer-in.c (unpack_ts_fixed_cst_value_fields): Use as_a . diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 0fdd025..564d7fe 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -64,6 +64,7 @@ typedef opt_mode opt_scalar_mode; typedef opt_mode opt_scalar_int_mode; typedef opt_mode opt_scalar_float_mode; template class pod_mode; +typedef pod_mode scalar_mode_pod; typedef pod_mode scalar_int_mode_pod; /* Subclasses of rtx_def, using indentation to show the class diff --git a/gcc/fixed-value.h b/gcc/fixed-value.h index 78df6e6..5e75f66 100644 --- a/gcc/fixed-value.h +++ b/gcc/fixed-value.h @@ -22,8 +22,8 @@ along with GCC; see the file COPYING3. If not see struct GTY(()) fixed_value { - double_int data; /* Store data up to 2 wide integers. */ - machine_mode_enum mode; /* Use machine mode to know IBIT and FBIT. */ + double_int data; /* Store data up to 2 wide integers. */ + scalar_mode_pod mode; /* Use machine mode to know IBIT and FBIT. */ }; #define FIXED_VALUE_TYPE struct fixed_value diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 3876883..7c6e0d9 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -1919,7 +1919,7 @@ fold_convert_const_int_from_fixed (tree type, const_tree arg1) { tree t; double_int temp, temp_trunc; - machine_mode mode; + scalar_mode mode; /* Right shift FIXED_CST to temp by fbit. */ temp = TREE_FIXED_CST (arg1).data; diff --git a/gcc/machmode.h b/gcc/machmode.h index 1dae146..fe62965 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -902,4 +902,22 @@ namespace mode_iterator mode_iterator::iterate_p (&(ITERATOR)); \ mode_iterator::get_2xwider (&(ITERATOR))) +template +void +gt_ggc_mx (pod_mode *) +{ +} + +template +void +gt_pch_nx (pod_mode *) +{ +} + +template +void +gt_pch_nx (pod_mode *, void (*) (void *, void *), void *) +{ +} + #endif /* not HAVE_MACHINE_MODES */ diff --git a/gcc/tree-streamer-in.c b/gcc/tree-streamer-in.c index 3d8a7bb..d1e7f96 100644 --- a/gcc/tree-streamer-in.c +++ b/gcc/tree-streamer-in.c @@ -208,7 +208,7 @@ static void unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr) { FIXED_VALUE_TYPE *fp = ggc_alloc (); - fp->mode = bp_unpack_machine_mode (bp); + fp->mode = as_a (bp_unpack_machine_mode (bp)); fp->data.low = bp_unpack_var_len_int (bp); fp->data.high = bp_unpack_var_len_int (bp); TREE_FIXED_CST_PTR (expr) = fp;