From patchwork Mon Oct 23 05:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Frager, Neal" X-Patchwork-Id: 156673 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1094264vqx; Sun, 22 Oct 2023 22:49:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGjC2cMW9+UuI3LlOxZ9tkC2GfUW3iV+fLOaSdKHTLt53Mviy0ZTkbC0aYBExa+TfII+CH5 X-Received: by 2002:ad4:5b85:0:b0:66d:6458:d9f8 with SMTP id 5-20020ad45b85000000b0066d6458d9f8mr11553638qvp.54.1698040165439; Sun, 22 Oct 2023 22:49:25 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1698040165; cv=pass; d=google.com; s=arc-20160816; b=AwCyKSPki+lTJwU5fyJZnj+rhlv0/92V/m5cx2Nyb5wSKq22TC/8jx9xYSsWUEJeGi 0Il3fLhLh//BVDflb6pm57+CFxYA6Sphm6vbCLE2A0dEMLTOzBB7fF0AVuzTGU4ds9la 9JQyN/+i8oXeSnX9QkNI0HOP4sJHZfjbnnbXXLD03RnOI97EJdjVcNhh0KU3CPX8B8U6 WiJgqsdWXxcnGMZEwc4XugB5RK+yg9IE6t0tC3aKd0eLHZFFIgbYG2VOndYk1jUV/r0r kMqjs1yiStcuUSURPYrPt4ZpT8Nxhy/qWKbyoJA35ZUgldT7tS4DlF3S/1w3klT/vkYG DrmA== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=ZAZ2tscjDPTh4z4e9Ph7FhDDDcV98e8W/YT/YS+LqvY=; fh=yRADZcmw/G6ekBwW/4lHPdEw06SO4uLMmcVaZMeeVeM=; b=hcfRWdeYFzkhCkXaGz9tHwUngU7fDEgwEeTbKCipHhUzOAUtP2qaINWTtKJSXi7FVQ l0gWsH96pYaDIEPzUhChXTKqR40HL8qZUsVPOkHoCMXtxfiC/cYk8x4NBVmOnI5Dtxkk U51WC+A+0ogUt31t2So8E9uOOb/ekuYjxTVmTzpbQVqus6ZP5EpTpoeoerbUbMoeEOwx /9Cb4BGZ0HljA1LTd/+mOUCp3oUaWlEEiucXXnEUZOfvloirwhE6hdelvcmSfD7YD0WM brVnrEXJSHMPdWyAY1de8SEew7zXQYfH8+uHrHeLCavPInzrmzTN+jZWn7Uv46I+l2tl A1rg== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5S3hPRL7; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id s19-20020a05622a019300b0041805eb9514si4926967qtw.183.2023.10.22.22.49.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 22:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=5S3hPRL7; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2A64E3857C41 for ; Mon, 23 Oct 2023 05:49:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by sourceware.org (Postfix) with ESMTPS id CD36B3858D39 for ; Mon, 23 Oct 2023 05:48:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CD36B3858D39 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CD36B3858D39 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.223.43 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698040141; cv=pass; b=x4E6fsdYX3t/C15IKYoqTqs5bNGex+4i/TNBxhClXRqhKMO3PHGaJwRej4jF76IzpRsqFvYhoDCDyX/azXkK1tYmDUVGqz728i9H8SzimrtDI3Nq9h4Xci4w3w15UVHVux7CHITiqmf1iFpGOwqUkh6aBf6NEfUMlMLmz42Y02U= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1698040141; c=relaxed/simple; bh=rmA6rb54ndEleHVpflItBWoAmlVvpcqoiA1xKVL+t24=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wNCq2ZnNx8m02zT8sLDGdK+WWRNPLpI/PRmNnmPw3mAxks6Z93xxcZwF7LdVApK9V4uHzZ5mAdklO3hTNmCD6GtI0sdmOexcFt6KC6/RcxeZe0AFYiPoy6lnaE7r0mkJpwHzmoJBKwMeX0qfoEIzlSzAjNDLHrV6mwVmzH3MT/U= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cwRzv4cFBVfWs/tmHF51Tmtz0z5B8dXBJ7MSj/LGsMY8EOE8feme7Oag+Bh8ivcUBT11TKvqh2qDly4tzhNGJewTrU/90CbpVKbPWIwZppHGV0JBAaUDoF6e1nvIYTTO/pP3kj5QziZEaGHH3rt3pTWufUB0pRfZbr/RQl1C5giYC9tKewXFGt+ad6vsWLpC1YxS7mhpiAtiK8DnXDSGvQUxSe52/6que7Xmuw15f2fwrEInoTNo7je5yjTle32chAUrXD5X7mZL/pH1TLmLiujlrmy/GjyuWK+Y5MDAdXkJKY/aDnG80oxiarcUMJGif5VhjjjS4JaX/1vS41+sFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZAZ2tscjDPTh4z4e9Ph7FhDDDcV98e8W/YT/YS+LqvY=; b=XxqWi+g0iWgi07lBJu7ZQV1gTRXXOqn5sFO6pQNaoNKya1+pBNLCYgngS7qR00BN+8AeO1KadrmxMkZsr45IXAx2nsFhA4F30SHqbavIk2zBEuypmYkS/Sds/4J30mAW04Jhrk/XFebVxFWwNae/ItSgAYBMuX28mq4JopbNRsjUu/CFfQtbKvbkkN0bt9IkhCMHFBdCtFoR8QhihuZJxFKHTURTHNmGyU+MLfdHe6izkzzH06FBHDttHbu9I3Id+L78LxlVSTRRrX72pmmsIMR/TCGSWD7nAi5SiHHamDh1X5/AfPLbY5HV5Ov82dW3M8s6XovTulpEkXK1Tee0Pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZAZ2tscjDPTh4z4e9Ph7FhDDDcV98e8W/YT/YS+LqvY=; b=5S3hPRL7HhC7sYA/FbJBjOos9x6eu4cHre3p8jVaBwTbOp+FkrwOxvdw6loAXzbMifBORlQ75bXWhk4MSGBdFxv3HDCpSvX9HvV/fuSBRawkhc/rYcrS13QlnhIWWpH/cZi4egPRY9dCUPYlNTBASGIBornWzqH80WD4Jv+meP4= Received: from DS7PR06CA0015.namprd06.prod.outlook.com (2603:10b6:8:2a::26) by DM6PR12MB4338.namprd12.prod.outlook.com (2603:10b6:5:2a2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33; Mon, 23 Oct 2023 05:48:56 +0000 Received: from DS1PEPF0001709A.namprd05.prod.outlook.com (2603:10b6:8:2a:cafe::57) by DS7PR06CA0015.outlook.office365.com (2603:10b6:8:2a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.33 via Frontend Transport; Mon, 23 Oct 2023 05:48:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0001709A.mail.protection.outlook.com (10.167.18.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Mon, 23 Oct 2023 05:48:56 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 23 Oct 2023 00:48:55 -0500 Received: from xirengwts09.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 23 Oct 2023 00:48:54 -0500 From: Neal Frager To: , , CC: , , , , , , , Neal Frager Subject: [PATCH v1 1/1] gcc: config: microblaze: fix cpu version check Date: Mon, 23 Oct 2023 06:48:51 +0100 Message-ID: <20231023054851.1205436-1-neal.frager@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709A:EE_|DM6PR12MB4338:EE_ X-MS-Office365-Filtering-Correlation-Id: 83b8c531-e9b0-4bb9-dd96-08dbd38bbf21 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w93isffhg1DNryo97HMyAunFd2OIEfe0WkAOZ1/rd7wB8RMgBq7LP23Y/iWkFVO0MlcVSaIpVtomAeAePrsfZKSBtZH+DroLcXCqgINhoKNwvA0gT/eGUzemKn0emk45toMfnZlSBXBVTPb+jvoRPDfJn3Uwur8Jm+R60hWALh+BTDktP0GxeAqKbDeA6Ul7kxbAhYHNmdlDdXis77EOmJ/OLw1V6g7D6Qfyp/xQw7XuPOExEHOdI2slVxDQiD49OYv9CWidDvl6AUm4OXTDDZGYtYHdcdzg9oikBlS3st8+sqh+707063bzIGj2+lLt1uJfAHcbcJveYL9es941HxgQsnkNctNrmWnr34Tv6T6vVigjeP6MHEzuVSsWyWy/cgesWWX6FTRAzQG0yfS1cvlDrU3knsfpCDtQo3HUIeXwgk1gvNKHJFTpuSadafDWo8Bkj6whv8dLVNOhobhTAQSfYBYbzImzmGhOwpXhqgI0ubb7I7xpccUKfe8z6dq3RQvHZrwG7b6NliV6tEv7Iyot9A8+nO7B86qmbqyzztwkrqup57g83OeRq5n1ofcvcQC/WsRpdoOSulV6WXQ4b2iHohAK9e7GZ8z3moLx1CYrBU3lzPWQwobTNy5g1lMXZWfzMI0A5+fn7TLZplrG5RGCeBr6ctPHE9W1BJa9W+ZDIdhvncTAwgP/p9n3tXxry1xZZVOV2aVE7YiLjFOXIq+2l0zzZlZDWh61ytKe+BRWwNWy7i7EE2id36JykJkKimctdEWkHLsP9gVxQSxXl/Pgt1+H7UpY0kLCBC7Yhp0= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(346002)(39860400002)(376002)(136003)(230922051799003)(1800799009)(82310400011)(186009)(64100799003)(451199024)(40470700004)(36840700001)(46966006)(2906002)(110136005)(316002)(54906003)(70586007)(70206006)(356005)(81166007)(82740400003)(26005)(1076003)(478600001)(6666004)(2616005)(40480700001)(47076005)(336012)(426003)(83380400001)(40460700003)(44832011)(41300700001)(5660300002)(36756003)(86362001)(4326008)(8936002)(8676002)(36860700001)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Oct 2023 05:48:56.2858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83b8c531-e9b0-4bb9-dd96-08dbd38bbf21 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709A.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4338 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780524164574391541 X-GMAIL-MSGID: 1780524164574391541 There is a microblaze cpu version 10.0 included in versal. If the minor version is only a single digit, then the version comparison will fail as version 10.0 will appear as 100 compared to version 6.00 or 8.30 which will calculate to values 600 and 830. The issue can be seen when using the '-mcpu=10.0' option. With this fix, versions with a single digit minor number such as 10.0 will be calculated as greater than versions with a smaller major version number, but with two minor version digits. By applying this fix, several incorrect warning messages will no longer be printed when building the versal plm application, such as the warning message below: warning: '-mxl-multiply-high' can be used only with '-mcpu=v6.00.a' or greater Signed-off-by: Neal Frager --- gcc/config/microblaze/microblaze.cc | 164 +++++++++++++--------------- 1 file changed, 76 insertions(+), 88 deletions(-) diff --git a/gcc/config/microblaze/microblaze.cc b/gcc/config/microblaze/microblaze.cc index c9f6c4198cf..6e1555f6eb3 100644 --- a/gcc/config/microblaze/microblaze.cc +++ b/gcc/config/microblaze/microblaze.cc @@ -56,8 +56,6 @@ /* This file should be included last. */ #include "target-def.h" -#define MICROBLAZE_VERSION_COMPARE(VA,VB) strcasecmp (VA, VB) - /* Classifies an address. ADDRESS_INVALID @@ -1297,12 +1295,73 @@ microblaze_expand_block_move (rtx dest, rtx src, rtx length, rtx align_rtx) return false; } +/* Convert a version number of the form "vX.YY.Z" to an integer encoding + for easier range comparison. */ +static int +microblaze_version_to_int (const char *version) +{ + const char *p, *v; + const char *tmpl = "vXX.YY.Z"; + int iver1 =0, iver2 =0, iver3 =0; + + p = version; + v = tmpl; + + while (*p) + { + if (*v == 'X') + { /* Looking for major */ + if (*p == '.') + *v++; + else + { + if (!(*p >= '0' && *p <= '9')) + return -1; + iver1 += (int) (*p - '0'); + iver1 *= 1000; + } + } + else if (*v == 'Y') + { /* Looking for minor */ + if (!(*p >= '0' && *p <= '9')) + return -1; + iver2 += (int) (*p - '0'); + iver2 *= 10; + } + else if (*v == 'Z') + { /* Looking for compat */ + if (!(*p >= 'a' && *p <= 'z')) + return -1; + iver3 = (int) (*p - 'a'); + } + else + { + if (*p != *v) + return -1; + } + + v++; + p++; + } + + if (*p) + return -1; + + return iver1 + iver2 + iver3; +} + static bool microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED, int opno ATTRIBUTE_UNUSED, int *total, bool speed ATTRIBUTE_UNUSED) { int code = GET_CODE (x); + int ver, ver_int; + + if (microblaze_select_cpu == NULL) + microblaze_select_cpu = MICROBLAZE_DEFAULT_CPU; + + ver_int = microblaze_version_to_int (microblaze_select_cpu); switch (code) { @@ -1345,8 +1404,8 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED, { if (TARGET_BARREL_SHIFT) { - if (MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v5.00.a") - >= 0) + ver = ver_int - microblaze_version_to_int("v5.00.a"); + if (ver >= 0) *total = COSTS_N_INSNS (1); else *total = COSTS_N_INSNS (2); @@ -1407,8 +1466,8 @@ microblaze_rtx_costs (rtx x, machine_mode mode, int outer_code ATTRIBUTE_UNUSED, } else if (!TARGET_SOFT_MUL) { - if (MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v5.00.a") - >= 0) + ver = ver_int - microblaze_version_to_int("v5.00.a"); + if (ver >= 0) *total = COSTS_N_INSNS (1); else *total = COSTS_N_INSNS (3); @@ -1681,72 +1740,13 @@ function_arg_partial_bytes (cumulative_args_t cum_v, return 0; } -/* Convert a version number of the form "vX.YY.Z" to an integer encoding - for easier range comparison. */ -static int -microblaze_version_to_int (const char *version) -{ - const char *p, *v; - const char *tmpl = "vXX.YY.Z"; - int iver = 0; - - p = version; - v = tmpl; - - while (*p) - { - if (*v == 'X') - { /* Looking for major */ - if (*p == '.') - { - v++; - } - else - { - if (!(*p >= '0' && *p <= '9')) - return -1; - iver += (int) (*p - '0'); - iver *= 10; - } - } - else if (*v == 'Y') - { /* Looking for minor */ - if (!(*p >= '0' && *p <= '9')) - return -1; - iver += (int) (*p - '0'); - iver *= 10; - } - else if (*v == 'Z') - { /* Looking for compat */ - if (!(*p >= 'a' && *p <= 'z')) - return -1; - iver *= 10; - iver += (int) (*p - 'a'); - } - else - { - if (*p != *v) - return -1; - } - - v++; - p++; - } - - if (*p) - return -1; - - return iver; -} - - static void microblaze_option_override (void) { int i, start; int regno; machine_mode mode; - int ver; + int ver, ver_int; microblaze_section_threshold = (OPTION_SET_P (g_switch_value) ? g_switch_value @@ -1767,29 +1767,22 @@ microblaze_option_override (void) /* Check the MicroBlaze CPU version for any special action to be done. */ if (microblaze_select_cpu == NULL) microblaze_select_cpu = MICROBLAZE_DEFAULT_CPU; - ver = microblaze_version_to_int (microblaze_select_cpu); - if (ver == -1) + ver_int = microblaze_version_to_int (microblaze_select_cpu); + if (ver_int == -1) { error ("%qs is an invalid argument to %<-mcpu=%>", microblaze_select_cpu); } - ver = MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v3.00.a"); + ver = ver_int - microblaze_version_to_int("v3.00.a"); if (ver < 0) { /* No hardware exceptions in earlier versions. So no worries. */ -#if 0 - microblaze_select_flags &= ~(MICROBLAZE_MASK_NO_UNSAFE_DELAY); -#endif microblaze_no_unsafe_delay = 0; microblaze_pipe = MICROBLAZE_PIPE_3; } else if (ver == 0 - || (MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v4.00.b") - == 0)) + || (ver_int == microblaze_version_to_int("v4.00.b"))) { -#if 0 - microblaze_select_flags |= (MICROBLAZE_MASK_NO_UNSAFE_DELAY); -#endif microblaze_no_unsafe_delay = 1; microblaze_pipe = MICROBLAZE_PIPE_3; } @@ -1797,16 +1790,11 @@ microblaze_option_override (void) { /* We agree to use 5 pipe-stage model even on area optimized 3 pipe-stage variants. */ -#if 0 - microblaze_select_flags &= ~(MICROBLAZE_MASK_NO_UNSAFE_DELAY); -#endif microblaze_no_unsafe_delay = 0; microblaze_pipe = MICROBLAZE_PIPE_5; - if (MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v5.00.a") == 0 - || MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, - "v5.00.b") == 0 - || MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, - "v5.00.c") == 0) + if ((ver_int == microblaze_version_to_int("v5.00.a")) + || (ver_int == microblaze_version_to_int("v5.00.b")) + || (ver_int == microblaze_version_to_int("v5.00.c"))) { /* Pattern compares are to be turned on by default only when compiling for MB v5.00.'z'. */ @@ -1814,7 +1802,7 @@ microblaze_option_override (void) } } - ver = MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v6.00.a"); + ver = ver_int - microblaze_version_to_int("v6.00.a"); if (ver < 0) { if (TARGET_MULTIPLY_HIGH) @@ -1823,7 +1811,7 @@ microblaze_option_override (void) "%<-mcpu=v6.00.a%> or greater"); } - ver = MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v8.10.a"); + ver = ver_int - microblaze_version_to_int("v8.10.a"); microblaze_has_clz = 1; if (ver < 0) { @@ -1832,7 +1820,7 @@ microblaze_option_override (void) } /* TARGET_REORDER defaults to 2 if -mxl-reorder not specified. */ - ver = MICROBLAZE_VERSION_COMPARE (microblaze_select_cpu, "v8.30.a"); + ver = ver_int - microblaze_version_to_int("v8.30.a"); if (ver < 0) { if (TARGET_REORDER == 1)