From nobody Thu Nov 13 22:06:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=quicinc.com ARC-Seal: i=1; a=rsa-sha256; t=1582909531; cv=none; d=zohomail.com; s=zohoarc; b=EacW67YO3bkPTNlNt6ORXhZypenvYNEzRUL9W9+vZOmda40ZIq2/blRml7UyDSh2NKe3EHGJFv5I6pdjeCRb5wbB4+Lmh5uTcY/P865MErYMM96+pSBDN8Q6qHuXs/fkrS9pcCwLcHW+e9BrBr86anKQHgpu660mNdv4pdOPhZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582909531; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=t6xXNe/O9bZLDo+XDhQ1dg9tj2tE3qhU3jxj5m85RyE=; b=ARHp3+NLa6nES1rYjqIoIkpxARW6Ntzq4AB5jgV4wDxKyP4eK9e2lT3W/z5qY53AA8nDOhM//ottav/Jvz4p1a2U823a9TwrI9x0TlFPrOsZ684ZYxLEdnPjPcoHQ+gI0tijTC66RV2ZxCXATpqFJFuK2bMGhzFfN1oIeOm1xAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@quicinc.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582909531096494.9618595200898; Fri, 28 Feb 2020 09:05:31 -0800 (PST) Received: from localhost ([::1]:50916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7j4r-0001q3-Qu for importer@patchew.org; Fri, 28 Feb 2020 12:05:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7ilK-0004GC-EA for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7ilJ-0006QB-2h for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:18 -0500 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:27049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j7ilI-0005V5-NB for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:45:17 -0500 Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-02.qualcomm.com with ESMTP; 28 Feb 2020 08:44:32 -0800 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg-SD-alpha.qualcomm.com with ESMTP; 28 Feb 2020 08:44:31 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 98E811102; Fri, 28 Feb 2020 10:44:31 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1582908316; x=1614444316; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t6xXNe/O9bZLDo+XDhQ1dg9tj2tE3qhU3jxj5m85RyE=; b=DGiN+5wW9c+SjWcjArPuI/UmNzw8YZKTcYjrcBH3+e0ts23sN364shlv vZPrkzQ4D6oAKsAf1NqFtH523DgtTEv190pvH3dIGQeDvJpATqbRRxki/ Ky9dZ4R9j2Lo/UiuMumu40Ob2PPeHajRkm67HwUS7PC9X/1tBdOGbqT+4 Q=; From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 44/67] Hexagon TCG generation - step 06 Date: Fri, 28 Feb 2020 10:43:40 -0600 Message-Id: <1582908244-304-45-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> References: <1582908244-304-1-git-send-email-tsimpson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Override memop instructions Signed-off-by: Taylor Simpson --- target/hexagon/helper_overrides.h | 60 +++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 60 insertions(+) diff --git a/target/hexagon/helper_overrides.h b/target/hexagon/helper_over= rides.h index a6cbce0..00647cb 100644 --- a/target/hexagon/helper_overrides.h +++ b/target/hexagon/helper_overrides.h @@ -931,4 +931,64 @@ fWRAP_PRED_STORE(fEA_IMM(uiV), fLSBNEWNOT(PvN), \ fGETBYTE(0, hex_new_value[NtX]), 1, NOINC) =20 +/* We have to brute force memops because they have C math in the semantics= */ +#define fWRAP_MEMOP(GENHLPR, SHORTCODE, SIZE, OP) \ + do { \ + TCGv tmp =3D tcg_temp_new(); \ + fEA_RI(RsV, uiV); \ + fLOAD(1, SIZE, s, EA, tmp); \ + OP; \ + fSTORE(1, SIZE, EA, tmp); \ + tcg_temp_free(tmp); \ + } while (0) + +#define fWRAP_L4_add_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_add_tl(tmp, tmp, RtV)) +#define fWRAP_L4_add_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_add_tl(tmp, tmp, RtV)) +#define fWRAP_L4_add_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_add_tl(tmp, tmp, RtV)) +#define fWRAP_L4_sub_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_sub_tl(tmp, tmp, RtV)) +#define fWRAP_L4_sub_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_sub_tl(tmp, tmp, RtV)) +#define fWRAP_L4_sub_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_sub_tl(tmp, tmp, RtV)) +#define fWRAP_L4_and_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_and_tl(tmp, tmp, RtV)) +#define fWRAP_L4_and_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_and_tl(tmp, tmp, RtV)) +#define fWRAP_L4_and_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_and_tl(tmp, tmp, RtV)) +#define fWRAP_L4_or_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_or_tl(tmp, tmp, RtV)) +#define fWRAP_L4_or_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_or_tl(tmp, tmp, RtV)) +#define fWRAP_L4_or_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_or_tl(tmp, tmp, RtV)) +#define fWRAP_L4_iadd_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_addi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_iadd_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_addi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_iadd_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_addi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_isub_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_subi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_isub_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_subi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_isub_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_subi_tl(tmp, tmp, UiV)) +#define fWRAP_L4_iand_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_andi_tl(tmp, tmp, ~(1 << Ui= V))) +#define fWRAP_L4_iand_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_andi_tl(tmp, tmp, ~(1 << Ui= V))) +#define fWRAP_L4_iand_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_andi_tl(tmp, tmp, ~(1 << Ui= V))) +#define fWRAP_L4_ior_memopw_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 4, tcg_gen_ori_tl(tmp, tmp, 1 << UiV)) +#define fWRAP_L4_ior_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_ori_tl(tmp, tmp, 1 << UiV)) +#define fWRAP_L4_ior_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_ori_tl(tmp, tmp, 1 << UiV)) + #endif --=20 2.7.4