From patchwork Thu Oct 26 15:27:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117246 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp900746qgn; Thu, 26 Oct 2017 08:29:04 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Svhpc2PcB95GCA2OwOirxIuabX/Mp3cO+i6puwQk1py3HFjzAsQu1L0AXGIIct+I7Wd/VB X-Received: by 10.129.229.2 with SMTP id s2mr15311379ywl.90.1509031744589; Thu, 26 Oct 2017 08:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509031744; cv=none; d=google.com; s=arc-20160816; b=ziyIEEEE1QYwZYXbCFX28xs0XPX6pqz+EwhX2VDHme/1CDq1d8tt77Y08ML6ZGJrf+ eyNvCwhdj6poxrEhvTPWI019uTAHC9QrhdgrPdTZ4kU2zswJ59G2D+xxqC4dxZ6ST8CC nIvklIFFO6LPTUcxKDT5G+qfT5v3CiX9zFPG61T2+YD3eRvvgCTycEKguIwN4juCEF8X wgtbBCuA0ucDiMNr/jo9iqyuSRH0XgSeB9QwNqgCAyK2YULIqYh+2g7VL+fqB+WiWHFC ttLLv8UWpF/PWhF6PZxHeBpGrcIQQdx7f2t3WaVVfcnDMdkX5lAdeI364XLfYohcvssK XV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=dAUXn4tO6Y/YnlZNqYl9N5BED7eh2hifNvxB112ONJo=; b=IF22Y5kDktt4+wmQd6B0B3ef1d6nHTRvO3T9U2grpBJzq0Cbq/M4OkDZcYvgEeqYMT Qw9cvC0Yxytvfrhyu4yViuvcLDD1YY4nMgtqxHIYnmvn5zBCSk6WdfA4PFjCz61grWYM rUG8kQvRykrbYXieSxZlhtimQozLy7ABTN7WmeEPXB6sP47ELjeEjH7Net98+Q3XeE6g GavS2G1E3KzjEQUkVThYvW5UzIhcVvJPsZ7bwzadU/6g72KWre4BBiztruqxrQ3kIRuu yA0EiUpRx0LxelspOXXFaBhJ6LvpOrhi0USi2i1iqXpyndlPw9M3GsgvTc7lZk7czfPu eZkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OwfMpIKn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d15si843677ybl.7.2017.10.26.08.29.04 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 26 Oct 2017 08:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OwfMpIKn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7k5g-0007bl-41 for patch@linaro.org; Thu, 26 Oct 2017 11:29:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7k3w-0006iJ-QI for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7k3s-0005f8-0t for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:15 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:54238) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7k3r-0005e6-Q2 for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:11 -0400 Received: by mail-wm0-x243.google.com with SMTP id r196so9130506wmf.2 for ; Thu, 26 Oct 2017 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dAUXn4tO6Y/YnlZNqYl9N5BED7eh2hifNvxB112ONJo=; b=OwfMpIKn4kCO5EAy47E/KYXi8go2wd2dbebkSxMDiO8b8i/79WiS76w/FTncZwPMa/ zAKifHiijcH5uCkMPFreuGRkNz83QLz21SB41VJHeQ/1J4jVe20u82/MaR2TuPDrcH0t w5M6S+e53xbNIiJVoCjyN6LCwaEKdbl1g6dsQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dAUXn4tO6Y/YnlZNqYl9N5BED7eh2hifNvxB112ONJo=; b=qoHxx3RJ7NFsnb/KgRO6aqVpko1/vVflqzWZFQw1uN9J0snkf7hZIMvKjLYF1BV9Yw CUA9d5IcGYGueAMAeh+5J4e2289A/pZFrBcf5D/sI9XOCXL3LiKjOq01sF0Q3RwdAwmk Eh7mQ3PnUJJZgP6ghu6KUQJg6FW2Ac6HWMXkykYFtY93xOITS9E4G+Pp6ER67z9kpNKR 9p98eL22k4VzNEiQ5HOUMEM23Vymq7P2pTVHviEbj6L7CoGxfFY1m8p3yAP/QjlIup+S ItSuCn6d4M6I3laejRzJUdjo6ZwUhXe4mUChO3VWgVO4P3/8Ym3nUxPG2WhuAJisswkO ZsYg== X-Gm-Message-State: AMCzsaXD5a2hEEytjh+mY9jLUbpcakcv/blY05F6ZiFEDFDjagYvIEhE CEt1Ey4W0fPFHtqDNBpyCYy3VPrdfTc= X-Received: by 10.28.199.4 with SMTP id x4mr1701547wmf.124.1509031630594; Thu, 26 Oct 2017 08:27:10 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.108]) by smtp.gmail.com with ESMTPSA id k13sm9921825wrd.95.2017.10.26.08.27.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 08:27:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 26 Oct 2017 17:27:03 +0200 Message-Id: <20171026152704.24525-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171026152704.24525-1-richard.henderson@linaro.org> References: <20171026152704.24525-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::243 Subject: [Qemu-devel] [PATCH 1/2] tcg: Allow constant pool entries in the prologue 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: laurent.desnogues@gmail.com, qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Both ARMv6 and AArch64 currently may drop complex guest_base values into the constant pool. But generic code wasn't expecting that, and the pool is not emitted. Correct that. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- tcg/tcg.c | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) -- 2.13.6 Tested-by: Emilio G. Cota Tested-by: Laurent Desnogues diff --git a/tcg/tcg.c b/tcg/tcg.c index 683ff4abb7..c22f1c4441 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -771,12 +771,32 @@ void tcg_prologue_init(TCGContext *s) /* Put the prologue at the beginning of code_gen_buffer. */ buf0 = s->code_gen_buffer; + total_size = s->code_gen_buffer_size; s->code_ptr = buf0; s->code_buf = buf0; + s->data_gen_ptr = NULL; s->code_gen_prologue = buf0; + /* Compute a high-water mark, at which we voluntarily flush the buffer + and start over. The size here is arbitrary, significantly larger + than we expect the code generation for any one opcode to require. */ + s->code_gen_highwater = s->code_gen_buffer + (total_size - TCG_HIGHWATER); + +#ifdef TCG_TARGET_NEED_POOL_LABELS + s->pool_labels = NULL; +#endif + /* Generate the prologue. */ tcg_target_qemu_prologue(s); + +#ifdef TCG_TARGET_NEED_POOL_LABELS + /* Allow the prologue to put e.g. guest_base into a pool entry. */ + { + bool ok = tcg_out_pool_finalize(s); + tcg_debug_assert(ok); + } +#endif + buf1 = s->code_ptr; flush_icache_range((uintptr_t)buf0, (uintptr_t)buf1); @@ -785,21 +805,36 @@ void tcg_prologue_init(TCGContext *s) s->code_gen_ptr = buf1; s->code_gen_buffer = buf1; s->code_buf = buf1; - total_size = s->code_gen_buffer_size - prologue_size; + total_size -= prologue_size; s->code_gen_buffer_size = total_size; - /* Compute a high-water mark, at which we voluntarily flush the buffer - and start over. The size here is arbitrary, significantly larger - than we expect the code generation for any one opcode to require. */ - s->code_gen_highwater = s->code_gen_buffer + (total_size - TCG_HIGHWATER); - tcg_register_jit(s->code_gen_buffer, total_size); #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) { qemu_log_lock(); qemu_log("PROLOGUE: [size=%zu]\n", prologue_size); - log_disas(buf0, prologue_size); + if (s->data_gen_ptr) { + size_t code_size = s->data_gen_ptr - buf0; + size_t data_size = prologue_size - code_size; + size_t i; + + log_disas(buf0, code_size); + + for (i = 0; i < data_size; i += sizeof(tcg_target_ulong)) { + if (sizeof(tcg_target_ulong) == 8) { + qemu_log("0x%08" PRIxPTR ": .quad 0x%016" PRIx64 "\n", + (uintptr_t)s->data_gen_ptr + i, + *(uint64_t *)(s->data_gen_ptr + i)); + } else { + qemu_log("0x%08" PRIxPTR ": .long 0x%08x\n", + (uintptr_t)s->data_gen_ptr + i, + *(uint32_t *)(s->data_gen_ptr + i)); + } + } + } else { + log_disas(buf0, prologue_size); + } qemu_log("\n"); qemu_log_flush(); qemu_log_unlock(); From patchwork Thu Oct 26 15:27:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117245 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp899237qgn; Thu, 26 Oct 2017 08:27:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SGnlFZ4yLCzrcjs5pqKYJT6Z51nGACu6Q4JECnP3J1iyVL+jUfhr8KWEwgiX7qiyDxkkIO X-Received: by 10.13.226.196 with SMTP id l187mr16217008ywe.103.1509031659529; Thu, 26 Oct 2017 08:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509031659; cv=none; d=google.com; s=arc-20160816; b=YifUvsTkmGQNSiP+lsQdl3S12mazqPXH+gkUbR2gT4oEGQrZh2DLE5PfELoZjzHj7/ uODKLiHqUwZPoA80sHu4oHvEBy1Cd/ydPEa5FyAarp2dVzuks6iTO/7KwxmdSgGzWjXj PhZ7rS/yKNZO+JrQC4ol8oYSvbkQJtMQ8lne6k08T30FvI+DH/iQz0QsLpxCD1epm3lA YktpBlaHfkJD15AlZCVvFF5sLNeY+2DoS6NcdaIKA5Scs0qSCOzMAX3JE+RNOrG/riBw 4f1Gn4Fe6FRUc70HfMlrEtkmYjrCec/Qg+pymb2FOCP8Soy2in6lF5pjQ5GDCi02N3D/ 3v1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=+7JADXPJs6prCRjgBK7Jr1opRp0AXyT+/c4kFIOnQi8=; b=ODTE3YyKyVSN9FnpWTkFRt77fWQjVDRAvGYuGEKlbJFbH0caSMFDSKYr65GcGDolOe ydYOze3o1v1g2sK1EawmcIOAiHvenMefIywqV3UYQMnP7QooQbSoRH8WoSt5veXvgtp4 fazlTZ2tIW5KgC0Jypbn8gNDr6u0eOe6ERejasXSjQgYzYw3Mqcu2g1rOPf9ZLa9NpXL nN1Bsw4uhMRdbZdemVzHRqZ7vXS2L5XbRQK47j6xgchmwdrQ5rrocVp1KZLGwe9P17UP LKTt5CtjCNtf/KKxvQc1qsYl4tM3WmOpFbjCl1VcG5p4IZ3MNVxZhGMaBQe+Dxbh1sld H8yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=G+zEgx3h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o6si890697ywi.84.2017.10.26.08.27.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 26 Oct 2017 08:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=G+zEgx3h; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53485 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7k4J-0006k4-2M for patch@linaro.org; Thu, 26 Oct 2017 11:27:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7k3w-0006iK-QH for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7k3t-0005h6-EP for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:15 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:54239) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7k3t-0005g6-8Q for qemu-devel@nongnu.org; Thu, 26 Oct 2017 11:27:13 -0400 Received: by mail-wm0-x242.google.com with SMTP id r196so9130634wmf.2 for ; Thu, 26 Oct 2017 08:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+7JADXPJs6prCRjgBK7Jr1opRp0AXyT+/c4kFIOnQi8=; b=G+zEgx3h61ElgN5vH3hyX3TSIaoYQWzzl/zVd5U/MM8D5fWHLIrFGHYgf8Oxd5XSA6 qcXs/YNTMaFkl7uHb1FWAOKZM0Tn3pSnXd/XT7jl3/jeHehLQ00V+a7N6vus5d1VsHC1 4yeiv1dg7SqBjckkKDgQpfT9dzKPPuQldxZlM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+7JADXPJs6prCRjgBK7Jr1opRp0AXyT+/c4kFIOnQi8=; b=rsspC8AGkbhUlI4fVhJo3M5x7SVbNbRcIvwLhbvoy/C0oh2THp8/NtF2zxt4jdm5bs BYf6sEXG3aIbePgd2eqCWg0Q7tYKh82lP62zXBUyHTBRbCtDvkCBtmB8ulVEsnlvKjvP 1B0OpST+qbWTc/DS95VHbvumaB2gn8Cd9NCAfQu43qngbu07mACGXWlnoVamOdDU9tz+ zFIXB8R9knsaw24yreA76vhFquHGSDUCjkBbuM2gG0LaoAbP+50/XztorBqzJayXNss4 NskIp3Gi37Umew1NX79VHCj0hU/xmIwUUduvYNlo/utEKYxHviqCSdQ+RwIvnCIFVpsk DRPA== X-Gm-Message-State: AMCzsaVvgEoFvmaTkzf7W3hMid3v+SdMghDmTfnQoG64ClpnXbv1g2Hr eZaG4Du29N0eGO3jEgm3aJmyQ1+Kfew= X-Received: by 10.28.137.139 with SMTP id l133mr1729658wmd.123.1509031631961; Thu, 26 Oct 2017 08:27:11 -0700 (PDT) Received: from cloudburst.twiddle.net ([62.168.35.108]) by smtp.gmail.com with ESMTPSA id k13sm9921825wrd.95.2017.10.26.08.27.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Oct 2017 08:27:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 26 Oct 2017 17:27:04 +0200 Message-Id: <20171026152704.24525-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171026152704.24525-1-richard.henderson@linaro.org> References: <20171026152704.24525-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH 2/2] tcg/s390x: Use constant pool for prologue 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: laurent.desnogues@gmail.com, qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Rather than have separate code only used for guest_base, rely on a recent change to handle constant pool entries. Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.inc.c | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) -- 2.13.6 diff --git a/tcg/s390/tcg-target.inc.c b/tcg/s390/tcg-target.inc.c index 38a7cdab75..9af6dcef05 100644 --- a/tcg/s390/tcg-target.inc.c +++ b/tcg/s390/tcg-target.inc.c @@ -555,9 +555,6 @@ static void tcg_out_mov(TCGContext *s, TCGType type, TCGReg dst, TCGReg src) static const S390Opcode lli_insns[4] = { RI_LLILL, RI_LLILH, RI_LLIHL, RI_LLIHH }; -static const S390Opcode ii_insns[4] = { - RI_IILL, RI_IILH, RI_IIHL, RI_IIHH -}; static bool maybe_out_small_movi(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long sval) @@ -647,36 +644,19 @@ static void tcg_out_movi_int(TCGContext *s, TCGType type, TCGReg ret, return; } - /* When allowed, stuff it in the constant pool. */ - if (!in_prologue) { - if (USE_REG_TB) { - tcg_out_insn(s, RXY, LG, ret, TCG_REG_TB, TCG_REG_NONE, 0); - new_pool_label(s, sval, R_390_20, s->code_ptr - 2, - -(intptr_t)s->code_gen_ptr); - } else { - tcg_out_insn(s, RIL, LGRL, ret, 0); - new_pool_label(s, sval, R_390_PC32DBL, s->code_ptr - 2, 2); - } - return; - } - - /* What's left is for the prologue, loading GUEST_BASE, and because - it failed to match above, is known to be a full 64-bit quantity. - We could try more than this, but it probably wouldn't pay off. */ - if (s390_facilities & FACILITY_EXT_IMM) { - tcg_out_insn(s, RIL, LLILF, ret, uval); - tcg_out_insn(s, RIL, IIHF, ret, uval >> 32); + /* Otherwise, stuff it in the constant pool. */ + if (s390_facilities & FACILITY_GEN_INST_EXT) { + tcg_out_insn(s, RIL, LGRL, ret, 0); + new_pool_label(s, sval, R_390_PC32DBL, s->code_ptr - 2, 2); + } else if (USE_REG_TB && !in_prologue) { + tcg_out_insn(s, RXY, LG, ret, TCG_REG_TB, TCG_REG_NONE, 0); + new_pool_label(s, sval, R_390_20, s->code_ptr - 2, + -(intptr_t)s->code_gen_ptr); } else { - const S390Opcode *insns = lli_insns; - int i; - - for (i = 0; i < 4; i++) { - uint16_t part = uval >> (16 * i); - if (part) { - tcg_out_insn_RI(s, insns[i], ret, part); - insns = ii_insns; - } - } + TCGReg base = ret ? ret : TCG_TMP0; + tcg_out_insn(s, RIL, LARL, base, 0); + new_pool_label(s, sval, R_390_PC32DBL, s->code_ptr - 2, 2); + tcg_out_insn(s, RXY, LG, ret, base, TCG_REG_NONE, 0); } }