From patchwork Tue Feb 11 00:40:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 11374463 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70DEC109A for ; Tue, 11 Feb 2020 00:55:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 429462072C for ; Tue, 11 Feb 2020 00:55:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="J2IyYidd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 429462072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:41738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1JpV-0007lq-BT for patchwork-qemu-devel@patchwork.kernel.org; Mon, 10 Feb 2020 19:55:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33424) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Jcc-000255-MJ for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1JcY-0000hj-Nw 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]:59203) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1JcY-0004tJ-Dh 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=iOQNsCZ4evIQuzTuaS4Cp0fX0eb3+OuF6jTFmobH020=; b=J2IyYiddPCpn4PDt08B2r5DwFBINwuVltsNw1FWtLb2h8Xj1whQJ4bDu n37jW/Vl4hSCLvmqQBA/CPc8aNyIIuYgriVyHxzGmoNm+IESt7bZ6oPr9 Qy8jsjTmxau4TV9/w/29mK5IUSQ/12JOKPVIowapoMa8T8OHRYsLKBlQj k=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) 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 ironmsg05-sd.qualcomm.com with ESMTP; 10 Feb 2020 16:41:01 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 63B581B5B; Mon, 10 Feb 2020 18:41:01 -0600 (CST) From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH 43/66] Hexagon TCG generation - step 06 Date: Mon, 10 Feb 2020 18:40:21 -0600 Message-Id: <1581381644-13678-44-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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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_overrides.h index 9791d33..f023442 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) +/* We have to brute force memops because they have C math in the semantics */ +#define fWRAP_MEMOP(GENHLPR, SHORTCODE, SIZE, OP) \ + do { \ + TCGv tmp = 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 << UiV))) +#define fWRAP_L4_iand_memopb_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 1, tcg_gen_andi_tl(tmp, tmp, ~(1 << UiV))) +#define fWRAP_L4_iand_memoph_io(GENHLPR, SHORTCODE) \ + fWRAP_MEMOP(GENHLPR, SHORTCODE, 2, tcg_gen_andi_tl(tmp, tmp, ~(1 << UiV))) +#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