From patchwork Mon Jun 13 23:58:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9174747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB1216044F for ; Tue, 14 Jun 2016 00:17:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9368C27D45 for ; Tue, 14 Jun 2016 00:17:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8743727E78; Tue, 14 Jun 2016 00:17:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F97627D45 for ; Tue, 14 Jun 2016 00:17:10 +0000 (UTC) Received: from localhost ([::1]:60082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCc2X-0001xZ-6U for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 Jun 2016 20:17:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCblB-0002M3-4e for qemu-devel@nongnu.org; Mon, 13 Jun 2016 19:59:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCblA-0004Ua-0B for qemu-devel@nongnu.org; Mon, 13 Jun 2016 19:59:13 -0400 Received: from mail-qg0-x243.google.com ([2607:f8b0:400d:c04::243]:33995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCbl9-0004UW-SJ for qemu-devel@nongnu.org; Mon, 13 Jun 2016 19:59:11 -0400 Received: by mail-qg0-x243.google.com with SMTP id 92so3184916qgg.1 for ; Mon, 13 Jun 2016 16:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=3ll/BhqSqb0dIfyfpNFhj//vWrtu1dcowHqycOj6UOE=; b=slRjfZaNAVWl+75jw/4yrOt3/1XV1lrvfcxNeMd7lhS1A26zGERine35obt1OtHKAB rlIVTno/RG/3jIDOjB0efnp8VfUOLEP1cMQAQP5x899foD89quvMCOkDtyq6hvGJOVD/ 9eRrfeSJQrlrDvJQ20gpdsSH9onyJIPHsEcG2bkKPs+RT0zbD2PxfQvREhAvtHBbutvH YdkSEpmasq1T9CxTVkkrZJwSG7c3HzlT+7jLy1apP8WVP7u7yRHlYlu748pqs7qVkW76 HbbFojNKZrCALrttn4Qgf5JqKIBkhd3nhnWGv+j2ye1/Amu0ljWfEAwa0pYX9WDHZcb1 P3Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=3ll/BhqSqb0dIfyfpNFhj//vWrtu1dcowHqycOj6UOE=; b=mCb6c/qCHzlCPXwLxAKpR+1tv3hpTvyiyEY7vojCeQgeKfGzoxgrCqRTncb/f3PNVU Ifqc0R8Uou/hBJtfdrRBIpZM1m6R2lbjtOlj8no77EN/Jmab5rnGjGDMo8pYXJ4hwvOO n5130oqv3/VW5WCqABzSZMz+o0Nf5YQmNf3clVHTpbfh87Gv/USFvi6wceLWVdK8smrp 6DWajVlKYKehoSIKbpjpbN6nt7IlpTvBsQsdUj9S1rcUCUy5uB6eGCXRJeH+3zNff7Wa iEegvlWbsrYywWOTxYjcz8WLTcxOpHftvXlSkQB5QF25EGUDnhR4FPKSVcAYTlIa32w0 JVEg== X-Gm-Message-State: ALyK8tLWaoUo1VmyAUT4c6eGMoc1vdDYoc2ZBnfHojwoEpNdOEZ1kayXYI0UZi4BXGTa+w== X-Received: by 10.140.109.198 with SMTP id l64mr16163353qgf.65.1465862351433; Mon, 13 Jun 2016 16:59:11 -0700 (PDT) Received: from bigtime.com (71-37-54-227.tukw.qwest.net. [71.37.54.227]) by smtp.gmail.com with ESMTPSA id q200sm7547234qke.31.2016.06.13.16.59.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jun 2016 16:59:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 13 Jun 2016 16:58:18 -0700 Message-Id: <1465862305-14090-19-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465862305-14090-1-git-send-email-rth@twiddle.net> References: <1465862305-14090-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c04::243 Subject: [Qemu-devel] [PATCH 18/25] target-openrisc: Implement l.adrp 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Not part of the v1.1 standard, but a proposed extension to vastly simplify both PIC and 64-bit mode. Signed-off-by: Richard Henderson --- target-openrisc/translate.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c index 0ad0c39..7804edd 100644 --- a/target-openrisc/translate.c +++ b/target-openrisc/translate.c @@ -709,7 +709,7 @@ static void dec_misc(DisasContext *dc, uint32_t insn) uint32_t ra, rb, rd; uint32_t L6, K5; uint32_t K16, K5_11; - int32_t I16, I5_11, N26; + int32_t I16, I5_11, N21, N26; TCGMemOp mop; TCGv t0; @@ -722,6 +722,7 @@ static void dec_misc(DisasContext *dc, uint32_t insn) K5 = extract32(insn, 0, 5); K16 = extract32(insn, 0, 16); I16 = (int16_t)K16; + N21 = sextract32(insn, 0, 21); N26 = sextract32(insn, 0, 26); K5_11 = (extract32(insn, 21, 5) << 11) | extract32(insn, 0, 11); I5_11 = (int16_t)K5_11; @@ -737,6 +738,11 @@ static void dec_misc(DisasContext *dc, uint32_t insn) gen_jump(dc, N26, 0, op0); break; + case 0x02: /* l.adrp */ + LOG_DIS("l.adrp r%d,%d\n", rd, N21); + tcg_gen_movi_tl(cpu_R[rd], ((dc->pc >> 13) + N21) << 13); + break; + case 0x03: /* l.bnf */ LOG_DIS("l.bnf %d\n", N26); gen_jump(dc, N26, 0, op0);