From patchwork Tue Feb 11 00:40:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 1236108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcdkim header.b=BFlyoQs6; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48GlBP61jsz9s3x for ; Tue, 11 Feb 2020 12:12:44 +1100 (AEDT) Received: from localhost ([::1]:41992 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1K6S-0000jv-TG for incoming@patchwork.ozlabs.org; Mon, 10 Feb 2020 20:12:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33423) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Jcc-000253-LA for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1JcY-0000cV-9o for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:50 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:59208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1JcY-0004uP-05 for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1581381706; x=1612917706; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OOf7YmXXZVzvja2EyPvn7qqhWVcxZL0Yv2p3ReWTG4c=; b=BFlyoQs601msDVr1Ts9uT0u0iVeBxmYRRhDNmKKthn06w+S1Q0+lI7Mk 7oosg3+E+kYTSHirdyCnnXtHUiGZFIYRUS+DR0d7/dXCyhONIc/Z61+Bc x1vO1akHnIi6fdrlJNaWWKJQq1ZcIRRvTL8u7n0F9O1uMBOwO0lZEEEWF o=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 10 Feb 2020 16:41:02 -0800 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg02-sd.qualcomm.com with ESMTP; 10 Feb 2020 16:41:01 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 51ACE1B42; Mon, 10 Feb 2020 18:41:01 -0600 (CST) From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH 42/66] Hexagon TCG generation - step 05 Date: Mon, 10 Feb 2020 18:40:20 -0600 Message-Id: <1581381644-13678-43-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581381644-13678-1-git-send-email-tsimpson@quicinc.com> References: <1581381644-13678-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 199.106.114.39 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: riku.voipio@iki.fi, richard.henderson@linaro.org, laurent@vivier.eu, Taylor Simpson , philmd@redhat.com, aleksandar.m.mail@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Override predicated store instructions Signed-off-by: Taylor Simpson --- target/hexagon/helper_overrides.h | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/target/hexagon/helper_overrides.h b/target/hexagon/helper_overrides.h index 648fc5d..9791d33 100644 --- a/target/hexagon/helper_overrides.h +++ b/target/hexagon/helper_overrides.h @@ -877,4 +877,58 @@ #define fWRAP_S2_storerinewgp(GENHLPR, SHORTCODE) \ fWRAP_STORE(SHORTCODE) +/* Predicated stores */ +#define fWRAP_PRED_STORE(GET_EA, PRED, SRC, SIZE, INC) \ + do { \ + TCGv LSB = tcg_temp_local_new(); \ + TCGv NEWREG_ST = tcg_temp_local_new(); \ + TCGv BYTE = tcg_temp_local_new(); \ + TCGv HALF = tcg_temp_local_new(); \ + TCGLabel *label = gen_new_label(); \ + GET_EA; \ + PRED; \ + PRED_STORE_CANCEL(LSB, EA); \ + tcg_gen_brcondi_tl(TCG_COND_EQ, LSB, 0, label); \ + INC; \ + fSTORE(1, SIZE, EA, SRC); \ + gen_set_label(label); \ + tcg_temp_free(LSB); \ + tcg_temp_free(NEWREG_ST); \ + tcg_temp_free(BYTE); \ + tcg_temp_free(HALF); \ + } while (0) + +#define NOINC do {} while (0) + +#define fWRAP_S4_pstorerinewfnew_rr(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_RRs(RsV, RuV, uiV), fLSBNEWNOT(PvN), \ + hex_new_value[NtX], 4, NOINC) +#define fWRAP_S2_pstorerdtnew_pi(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \ + RttV, 8, tcg_gen_addi_tl(RxV, RxV, IMMNO(0))) +#define fWRAP_S4_pstorerdtnew_io(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBNEW(PvN), \ + RttV, 8, NOINC) +#define fWRAP_S4_pstorerbtnew_io(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBNEW(PvN), \ + fGETBYTE(0, RtV), 1, NOINC) +#define fWRAP_S2_pstorerhtnew_pi(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \ + fGETHALF(0, RtV), 2, tcg_gen_addi_tl(RxV, RxV, IMMNO(0))) +#define fWRAP_S2_pstoreritnew_pi(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_REG(RxV), fLSBNEW(PvN), \ + RtV, 4, tcg_gen_addi_tl(RxV, RxV, IMMNO(0))) +#define fWRAP_S2_pstorerif_io(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBOLDNOT(PvV), \ + RtV, 4, NOINC) +#define fWRAP_S4_pstorerit_abs(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_IMM(uiV), fLSBOLD(PvV), \ + RtV, 4, NOINC) +#define fWRAP_S2_pstorerinewf_io(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_RI(RsV, uiV), fLSBOLDNOT(PvV), \ + hex_new_value[NtX], 4, NOINC) +#define fWRAP_S4_pstorerbnewfnew_abs(GENHLPR, SHORTCODE) \ + fWRAP_PRED_STORE(fEA_IMM(uiV), fLSBNEWNOT(PvN), \ + fGETBYTE(0, hex_new_value[NtX]), 1, NOINC) + #endif