From patchwork Tue Jun 29 18:54:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468352 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5261046jao; Tue, 29 Jun 2021 12:42:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLMWwTF+J6logiJ9zCLlEVGBx3f1r954/he8u9u7j2D8q0BFqW2r5w1yla9EbfiboWvjIq X-Received: by 2002:ac8:7f87:: with SMTP id z7mr1519642qtj.238.1624995776327; Tue, 29 Jun 2021 12:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624995776; cv=none; d=google.com; s=arc-20160816; b=0mt0quFX726a5oCGT2LkaA7wNaPl3bCQgqlpUD2UhB92/u3PCd97HbT9iJVy5iJFsk MezSV74K4kDjqpkj+eUlaz2Ev7esG89xMsucLMHu99OMfGSyVmDM307i+KFnp7OmCA7l tqm0IxbaqzhpjXE6S/ml1JMqsOABaX4pope//iQm0Wfbzk0HIi9wzHkYSa8IYvL6BiWk +C7qcZDEMEy22S9e5pKsg+Ya0ud5/jm3s+SWTu20Wm5riQRmQmfo1/29u31kVa2bMgBa 852uRLpv1uOPw5S2dGDPJ7ey1Q+VBDTI1IHz6ZDJGAUU+3Xgrf4mVEsrGtoBb9tMOzYj mtxA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=nkUwvYz/H7E5G0Q9SrKLVPmT+1u2d8aWX4+EJ+0VG1o=; b=dicSmLAizdTA0IkLWQRYzSMWO+9a42aGLgCov/Ks8acrjCJ6RvBDRM9yDSovKSPrRV 0FnaEJgJJoIgWMHtw/poOBn3GKrlGfQ2O4fpo02weDr19yalansEyrF++q58JW+IKLsK 7ywF5qR5huslq/ISn3WAP2L8XmWId/2eTay4k9uByLqhrSZ8WGrXiPZGD5NccgbizExC NYd3nhU1JO9FpMfK48/KR4Z8kbzyTlR7eoGtAmf6kVbapa1ZAPvZZz0Vn0fwUBjTetyp LJiz184N9Kdw4UBIk/c5Z7ON2v3jyi+bUqVUdu/2+ONrEsjoXeBMhGo+9MMedLBnEiDY fhBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VK8QqAfD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id w15si13842019qkj.63.2021.06.29.12.42.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:42:56 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VK8QqAfD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:38556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJdH-0006ru-N8 for patch@linaro.org; Tue, 29 Jun 2021 15:42:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyIwD-0003xH-Vz for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:58:26 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:46886) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyIwA-0002wu-TR for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:58:25 -0400 Received: by mail-pj1-x102f.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso3081661pjp.5 for ; Tue, 29 Jun 2021 11:58:22 -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 :mime-version:content-transfer-encoding; bh=nkUwvYz/H7E5G0Q9SrKLVPmT+1u2d8aWX4+EJ+0VG1o=; b=VK8QqAfDxNWf3pwj17kQSMHzB0I7Pr/P3JtXMyAUmY68wabdQvi1VaZ5PB88BWAM9P R0ylYoV8SyOHXxWxnZwuwgBaymk4VAebLb1jC45wSzlD8pZG05g+yJLvAue6gu30hU8E b7cqxiG/x3LEl4IYpsCyRXw0n1EfpI/AZHJBvSkL7dxhcsSrzCye+JmV4DPbavqmvr3v uBsYt8Orq1hPKRdGvXk45QfClFgmAP2XPHRk+46G92Fjfxbi3CqAPX2ZZ0FR3iV71oya 2f+O+rOBe0fYomBRBlqrzQrgkHeDz5izUTDaZPBIszBrH20KOas7+OYicFvy0c8eHX1N EtdA== 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:mime-version:content-transfer-encoding; bh=nkUwvYz/H7E5G0Q9SrKLVPmT+1u2d8aWX4+EJ+0VG1o=; b=Xy+nLWApB6NbatgW91qSFzlepZtSM0wbDHfhQ7bmP7QTwnc52f35r8fPvkVIlRQxAG f0GoLkpHZF+NfRhmd8fuF6xGavp31OLbPtrJhP2LPdGOQDjMgCD0cPDoNyknUwWFB+Ao En0tu5D/fe+EnoRjFOtzME42+ovFEWm9g5y8wk7LMVmXAWGti2fhgMZ0vE6KvVDg/WrZ KCZAky2EsR6kqSMkM8esHVn689C730bHMLp49TqSFchjM7I/QQ6p5HzuPYkhYDVtjJ1j QeLMMOOTxXUrWomL2vRRANVHKidA7GBoUX3rNfwjJsUfo/sp+kLpahIzZlY5l0tg2+Ah 1QiA== X-Gm-Message-State: AOAM5325xpCiJetO4ve5yO14QLomZRZ4niyGPe7ZNVAqpJ0KihxIVeMP veiijcWPY4+qt8x/B3W9w+qQeL/rFm+PMA== X-Received: by 2002:a17:902:c602:b029:127:a3a2:4951 with SMTP id r2-20020a170902c602b0290127a3a24951mr25460046plr.65.1624993101477; Tue, 29 Jun 2021 11:58:21 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id 21sm18002849pfh.103.2021.06.29.11.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:58:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 40/63] tcg/ppc: Split out tcg_out_ext{8,16,32}s Date: Tue, 29 Jun 2021 11:54:32 -0700 Message-Id: <20210629185455.3131172-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?b?YXVkw6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We will shortly require these in other context; make the expansion as clear as possible. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 795701442b..aa35ff8250 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -738,6 +738,21 @@ static inline void tcg_out_rlw(TCGContext *s, int op, TCGReg ra, TCGReg rs, tcg_out32(s, op | RA(ra) | RS(rs) | SH(sh) | MB(mb) | ME(me)); } +static inline void tcg_out_ext8s(TCGContext *s, TCGReg dst, TCGReg src) +{ + tcg_out32(s, EXTSB | RA(dst) | RS(src)); +} + +static inline void tcg_out_ext16s(TCGContext *s, TCGReg dst, TCGReg src) +{ + tcg_out32(s, EXTSH | RA(dst) | RS(src)); +} + +static inline void tcg_out_ext32s(TCGContext *s, TCGReg dst, TCGReg src) +{ + tcg_out32(s, EXTSW | RA(dst) | RS(src)); +} + static inline void tcg_out_ext32u(TCGContext *s, TCGReg dst, TCGReg src) { tcg_out_rld(s, RLDICL, dst, src, 0, 32); @@ -2322,7 +2337,6 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const int const_args[TCG_MAX_OP_ARGS]) { TCGArg a0, a1, a2; - int c; switch (opc) { case INDEX_op_exit_tb: @@ -2390,7 +2404,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_ld8s_i32: case INDEX_op_ld8s_i64: tcg_out_mem_long(s, LBZ, LBZX, args[0], args[1], args[2]); - tcg_out32(s, EXTSB | RS(args[0]) | RA(args[0])); + tcg_out_ext8s(s, args[0], args[0]); break; case INDEX_op_ld16u_i32: case INDEX_op_ld16u_i64: @@ -2728,18 +2742,15 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, case INDEX_op_ext8s_i32: case INDEX_op_ext8s_i64: - c = EXTSB; - goto gen_ext; + tcg_out_ext8s(s, args[0], args[1]); + break; case INDEX_op_ext16s_i32: case INDEX_op_ext16s_i64: - c = EXTSH; - goto gen_ext; + tcg_out_ext16s(s, args[0], args[1]); + break; case INDEX_op_ext_i32_i64: case INDEX_op_ext32s_i64: - c = EXTSW; - goto gen_ext; - gen_ext: - tcg_out32(s, c | RS(args[1]) | RA(args[0])); + tcg_out_ext32s(s, args[0], args[1]); break; case INDEX_op_extu_i32_i64: tcg_out_ext32u(s, args[0], args[1]);