From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yKkiOT3gCmKragAAWB0awg (envelope-from ) for ; Mon, 14 Feb 2022 18:05:33 -0500 Received: by simark.ca (Postfix, from userid 112) id E7B151F3C5; Mon, 14 Feb 2022 18:05:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 612121EA69 for ; Mon, 14 Feb 2022 18:05:33 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EFE693858432 for ; Mon, 14 Feb 2022 23:05:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EFE693858432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644879933; bh=piH8tKWGOOIFTfGHFxqi9CxY+L5myZ2/D0iTiOjmZyE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=wYkwCVxKAyU0+ZlPFPeT9j6+5seltHdp90Gh3PuDzCfJrkG6UwbEGwqrQPvkEkOLj gGPMswJXVzScteYh6RkVR2xxwcGkfqsTOjkqjPFImi8SARmst2/fStKuXcxyzC2Sk6 xni6LtsatIv7CTb5Bf/+AhJteeqEtXhmgdGIB4Ao= Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 9586A3858D3C for ; Mon, 14 Feb 2022 23:05:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9586A3858D3C To: Subject: [PATCH 08/12] sim cris: Unbreak --disable-sim-hardware builds MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20220214230512.7B80720439@pchp3.se.axis.com> Date: Tue, 15 Feb 2022 00:05:12 +0100 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Hans-Peter Nilsson via Gdb-patches Reply-To: Hans-Peter Nilsson Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" With --disable-sim-hardware (--enable-sim-hardware=no), whose default was changed to --enable-sim-hardware(=yes) in commit 34cf51120683, building for cris-elf fails as sim_hw_parse then doesn't exist. A cris-elf simulator configured for --enable-sim-hardware (or the default after to the mentioned commit) runs about 2.5x slower than one configured --disable-sim-hardware. A further 2-5% performance regression was not investigated. When sim_hw_parse doesn't exist, --cris-900000xx can't be supported. The best action here is to remove it completely, so its absence can be identified through --help, but avoiding littering the code with "#if WITH_HW". sim/cris: * sim-if.c (cris_options) [WITH_HW]: Conditionalize support of option --cris-900000xx. (sim_open) [WITH_HW]: Conditionalize sim_hw_parse call. --- sim/cris/sim-if.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index 63deb467bc07..c72edc752b6f 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -100,9 +100,11 @@ static const OPTION cris_options[] = { {"cris-naked", no_argument, NULL, OPTION_CRIS_NAKED}, '\0', NULL, "Don't set up stack and environment", cris_option_handler, NULL }, +#if WITH_HW { {"cris-900000xx", no_argument, NULL, OPTION_CRIS_900000XXIF}, '\0', NULL, "Define addresses at 0x900000xx with simulator semantics", cris_option_handler, NULL }, +#endif { {"cris-unknown-syscall", required_argument, NULL, OPTION_CRIS_UNKNOWN_SYSCALL}, '\0', "stop|enosys|enosys-quiet", "Action at an unknown system call", @@ -891,8 +893,14 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, startmem, endmem - startmem); /* Allocate simulator I/O managed memory if none specified by user. */ +#if WITH_HW if (cris_have_900000xxif) sim_hw_parse (sd, "/core/%s/reg %#x %i", "cris_900000xx", 0x90000000, 0x100); +#else + /* With the option disabled, nothing should be able to set this variable. + We should "use" it, though, and why not assert that it isn't set. */ + ASSERT (! cris_have_900000xxif); +#endif /* Establish any remaining configuration options. */ if (sim_config (sd) != SIM_RC_OK) -- 2.30.2