From nobody Mon Feb 9 10:20:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=wdc.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544644438411651.2669706215415; Wed, 12 Dec 2018 11:53:58 -0800 (PST) Received: from localhost ([::1]:47736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXAZx-0000bT-4T for importer@patchew.org; Wed, 12 Dec 2018 14:53:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXAQM-0000t2-R5 for qemu-devel@nongnu.org; Wed, 12 Dec 2018 14:44:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXAQI-0001y8-6i for qemu-devel@nongnu.org; Wed, 12 Dec 2018 14:44:02 -0500 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:30969) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gXAQH-0001xN-SG; Wed, 12 Dec 2018 14:43:58 -0500 Received: from mail-bn3nam01lp2055.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([104.47.33.55]) by ob1.hgst.iphmx.com with ESMTP; 13 Dec 2018 03:44:17 +0800 Received: from MWHPR04MB0401.namprd04.prod.outlook.com (10.173.48.18) by MWHPR04MB0512.namprd04.prod.outlook.com (10.173.49.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Wed, 12 Dec 2018 19:43:46 +0000 Received: from MWHPR04MB0401.namprd04.prod.outlook.com ([fe80::9067:fb44:66b2:7604]) by MWHPR04MB0401.namprd04.prod.outlook.com ([fe80::9067:fb44:66b2:7604%3]) with mapi id 15.20.1425.016; Wed, 12 Dec 2018 19:43:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1544643873; x=1576179873; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Ih4s0j5UAUWM2vvyAEuaXwzWIhBR/JhRlby3oIb/bRg=; b=IoniSDGywWBiqqo0qwoPuYooFFqrfH9su9HG84WsLPLKk3EdNSwA77r7 M+oFgQKOL6CwJ8KSxl1iFAkBTKrPm+iy2PO+N8MK+TMqRIrOniiC5lDvS OEsmpmL/9q7pz7nqbevPMm8DziPdMIBQmwd5FfVWuCbvXEw8KMBNIwWDU 1rjk8Nj6ljYzqtqNPH+WXJMWaH7p1DvgyyggQFaY1/F8/xxKJYatfFtVJ nC4PlBcCynBQEU6yXg9a2LT67v8IHHWp2avCuAmH3sumg+jEVHbn0NVWA FqQnbTbLVDzlf0HU6BoYOXP1g7r1Wl0mgdEzk91HYc/qNKBDEmi69Mymd A==; X-IronPort-AV: E=Sophos;i="5.56,345,1539619200"; d="scan'208";a="194334016" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PMkJjGCCwTgm+EjotCUxyhOgpuzIVBUaKRzpR54mzHE=; b=bxjQ6Iu4THjH6NOQhcKDn5SszVY3/vq0NRyAt+cpy7DCMwn4etnU/+IP45iGB5or6UQJEF5VpF9DfuGQZqLc00VOD3X/q0Nbpj2AwSSwU5dfAE5KIFixGctnXlUYsNaGlD6iVkA8UDsbdbHoxO2v+ZV/+CDButL/WFuTwqe9HEU= From: Alistair Francis To: "qemu-devel@nongnu.org" , "qemu-riscv@nongnu.org" Thread-Topic: [PATCH v1 06/23] riscv: Add the tcg target registers Thread-Index: AQHUklL+Q6CVK/6Ud0OaTrsfg+a07g== Date: Wed, 12 Dec 2018 19:43:46 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.19.1 x-clientproxiedby: BYAPR07CA0009.namprd07.prod.outlook.com (2603:10b6:a02:bc::22) To MWHPR04MB0401.namprd04.prod.outlook.com (2603:10b6:300:70::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.171] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR04MB0512; 6:T9WmrBhXU4LyL2/5Wcw73qzUpq30+/Qs2ofNHVPNPoviu9gy4zO8FwKkBoTNz0xiQOr/Rah7I0UH3VMYzjpJ2wE1xH4xEP+L5j7XH8/0koml3Nh1itqx9txJqjkqGJ7MOlMfuWxv+FboeHqX3vydVHFj4fu6B+88oCNLBuXJuBUysuoPpsD6/2uJ/ZMIMeD0swx/kqkGTm6AObdOMK7DYfb/EOJKY6Va69cEu3PwDoT44Y2g+VnnZtRZvgVtIBxH/tPIplrniLDgvr0an66M0JL4OsChMtYta5wUR9HQ+HRubpYuiwt5HUiPONekOWmlTkBT+NDhWz951Z+OzzSKau/neBXrM1sPSO8qY4wusQ+bzxwynjmFyrDQxKcIYEKOi3zwmSHlw+WjZNgygIqlmqVqMmSsuUa4CdhoP+1hIBiFHWx7aUYleL5xd9NycwyEiL9EDrilsHJefgNx5CdOJg==; 5:dD1b5aq9Iko3KA3YexC6Wh0poQ5iDsDT3ZsZ9T27XiAkwbzDhLDio8/CjxxSzy/5JNfrNkRZhhhcsJE6FH5u+3BbcNF+Xvh8M83sOtpasfHC3GzSeH8y66IJ8MurMRtgXNGJRVyTI9G5btbgHdwSfRR9kIVZCxhodNeLyxYHG78=; 7:2wSJvIeiPwSG+vkkTbYES15yBYEBfhUkFjWnr/lXmHZYuvENwtEjGUOUH7BqDT48CmXozoeyicKKMyi3JI3dQFEvmE9Er99pdceXkTG90RUT11dyp2FnRZ5e5eoAy4g5HKZIsDO19pt1v2+JalC9Jg== x-ms-office365-filtering-correlation-id: 962c477d-4e2a-46ac-ec20-08d6606a211b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:MWHPR04MB0512; x-ms-traffictypediagnostic: MWHPR04MB0512: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230017)(999002)(6040522)(2401047)(5005006)(8121501046)(3231472)(944501520)(52105112)(3002001)(10201501046)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:MWHPR04MB0512; BCL:0; PCL:0; RULEID:; SRVR:MWHPR04MB0512; x-forefront-prvs: 0884AAA693 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(396003)(366004)(136003)(376002)(199004)(189003)(316002)(66066001)(97736004)(71200400001)(2501003)(71190400001)(76176011)(486006)(8936002)(6506007)(386003)(102836004)(118296001)(3846002)(81166006)(44832011)(186003)(25786009)(26005)(11346002)(6436002)(14444005)(6486002)(99286004)(2616005)(105586002)(8676002)(6116002)(81156014)(52116002)(5660300001)(6512007)(478600001)(72206003)(53936002)(68736007)(256004)(50226002)(110136005)(446003)(54906003)(39060400002)(14454004)(36756003)(7736002)(2906002)(476003)(4326008)(86362001)(305945005)(106356001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR04MB0512; H:MWHPR04MB0401.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-microsoft-antispam-message-info: BE+PXw3vhhCg1P24YqEzMTyOHjjz7EAUQsftCaShuzynHN6j0knxvffSoxpCa2igLkZjj4z/ssK0qfc4WwZP0JVOrDWqL5ud/sMYz6uh5HmzmYWN9DLiMDcceXp9s2YjbCR7UiUThdwuHNLX5rXEObv59vKlkV21J9BMxNUgCYi0h4wXPq/vJtJR5oscAQeoT2D+ygC6dX3+nQyRM1uKcSMAk2FCpcBvx/5RY+B6nhWi+J3QR6a7/tA9C0fCJn553wbarPN643HCe30yHP0GAk1/c1kXjySQyyfCx/q7BEuAbGg9EARRN4aU5PBD+qDg spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 962c477d-4e2a-46ac-ec20-08d6606a211b X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Dec 2018 19:43:46.0438 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR04MB0512 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH v1 06/23] riscv: Add the tcg target registers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "alistair23@gmail.com" , "richard.henderson@linaro.org" , Alistair Francis Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) Content-Type: text/plain; charset="utf-8" Signed-off-by: Alistair Francis Signed-off-by: Michael Clark Reviewed-by: Richard Henderson --- tcg/riscv/tcg-target.inc.c | 118 +++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 tcg/riscv/tcg-target.inc.c diff --git a/tcg/riscv/tcg-target.inc.c b/tcg/riscv/tcg-target.inc.c new file mode 100644 index 0000000000..6c969e3973 --- /dev/null +++ b/tcg/riscv/tcg-target.inc.c @@ -0,0 +1,118 @@ +/* + * Tiny Code Generator for QEMU + * + * Copyright (c) 2018 SiFive, Inc + * Copyright (c) 2008-2009 Arnaud Patard + * Copyright (c) 2009 Aurelien Jarno + * Copyright (c) 2008 Fabrice Bellard + * + * Based on i386/tcg-target.c and mips/tcg-target.c + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +#include "tcg-pool.inc.c" + +#ifdef CONFIG_DEBUG_TCG +static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] =3D { + "zero", + "ra", + "sp", + "gp", + "tp", + "t0", + "t1", + "t2", + "s0", + "s1", + "a0", + "a1", + "a2", + "a3", + "a4", + "a5", + "a6", + "a7", + "s2", + "s3", + "s4", + "s5", + "s6", + "s7", + "s8", + "s9", + "s10", + "s11", + "t3", + "t4", + "t5", + "t6" +}; +#endif + +static const int tcg_target_reg_alloc_order[] =3D { + /* Call saved registers */ + /* TCG_REG_S0 reservered for TCG_AREG0 */ + TCG_REG_S1, + TCG_REG_S2, + TCG_REG_S3, + TCG_REG_S4, + TCG_REG_S5, + TCG_REG_S6, + TCG_REG_S7, + TCG_REG_S8, + TCG_REG_S9, + TCG_REG_S10, + TCG_REG_S11, + + /* Call clobbered registers */ + TCG_REG_T0, + TCG_REG_T1, + TCG_REG_T2, + TCG_REG_T3, + TCG_REG_T4, + TCG_REG_T5, + TCG_REG_T6, + + /* Argument registers */ + TCG_REG_A0, + TCG_REG_A1, + TCG_REG_A2, + TCG_REG_A3, + TCG_REG_A4, + TCG_REG_A5, + TCG_REG_A6, + TCG_REG_A7, +}; + +static const int tcg_target_call_iarg_regs[] =3D { + TCG_REG_A0, + TCG_REG_A1, + TCG_REG_A2, + TCG_REG_A3, + TCG_REG_A4, + TCG_REG_A5, + TCG_REG_A6, + TCG_REG_A7, +}; + +static const int tcg_target_call_oarg_regs[] =3D { + TCG_REG_A0, + TCG_REG_A1, +}; --=20 2.19.1