From nobody Thu Nov 13 22:06:42 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=1582910651; cv=none; d=zohomail.com; s=zohoarc; b=d5sgy3tzHMF8Wo9Rx0eo3Dsv5MFaKwprbs4seBaytmOIvfqyDF7H8zePdUFGRQGnGwvNcU5uY4ocgEFdvt675GqD3+xVKsewJG2GEmC6Yi+r40jaZMxkj8SxFLeDarI7pRmPMCr2TEDiW9fq2cBfZnEWRTywbLzmZVI7OILEuWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582910651; 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=iZF4bQY+fkqcnTUcVM+HhNOA6ja9/9SUiXjugV/jlEQ=; b=ZV54LHy7t+71npgLbMzSwmSx/EHDluOgC1ZDIltaHVh9qHTSEvdendSunyPa9+gitUXKeOLeYnzZJ63u4OxxCoH4GlEwCD0+ihgJCrI0X0tyKbWwGUtmpIAoe/4X/QtzDypM4t8jxoS+NhzW85hSoLZ714rvXZOI+VP9+7gqH2w= 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 1582910651666153.144986647177; Fri, 28 Feb 2020 09:24:11 -0800 (PST) Received: from localhost ([::1]:51236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7jMw-000813-6o for importer@patchew.org; Fri, 28 Feb 2020 12:24:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58532) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7imF-0005lo-HZ for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:46:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7imD-0007Ld-U3 for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:46:15 -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 1j7ilU-0005V5-5W for qemu-devel@nongnu.org; Fri, 28 Feb 2020 11:46:13 -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:32 -0800 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 07AC5FCD; Fri, 28 Feb 2020 10:44:32 -0600 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1582908328; x=1614444328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iZF4bQY+fkqcnTUcVM+HhNOA6ja9/9SUiXjugV/jlEQ=; b=Y1mDXTiTEmKUGOeRuFdQ8skrznOQEfyZ942LzQGFPKVw9BSLk9IOex1X Ni09Y5ufq3ibq0ovIM4kyN4boDCzyzVGNfnpO9BiShKkjjep93A8BGNm+ kpxYxiYULmmQdZMB2/+YwX1x1ddlgNaOFFlLehUTrs3w1/J4aksP7wVKj 0=; From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 49/67] Hexagon TCG generation - step 11 Date: Fri, 28 Feb 2020 10:43:45 -0600 Message-Id: <1582908244-304-50-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 compare, transfer, conditional jump instructions Signed-off-by: Taylor Simpson --- target/hexagon/helper_overrides.h | 119 ++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 119 insertions(+) diff --git a/target/hexagon/helper_overrides.h b/target/hexagon/helper_over= rides.h index d3311be..ad9a88c 100644 --- a/target/hexagon/helper_overrides.h +++ b/target/hexagon/helper_overrides.h @@ -1432,4 +1432,123 @@ #define fWRAP_J4_cmpeq_tp0_jump_t(GENHLPR, SHORTCODE) \ gen_cmpnd_cmp_jmp(0, TCG_COND_EQ, true, RsV, RtV, riV) =20 +/* p0 =3D cmp.eq(r0, #7) */ +#define fWRAP_SA1_cmpeqi(GENHLPR, SHORTCODE) \ + do { \ + TCGv tmp =3D tcg_temp_new(); \ + gen_comparei(TCG_COND_EQ, tmp, RsV, uiV); \ + gen_log_pred_write(0, tmp); \ + tcg_temp_free(tmp); \ + } while (0) + +/* r0 =3D add(r29,#8) */ +#define fWRAP_SA1_addsp(GENHLPR, SHORTCODE) \ + tcg_gen_addi_tl(RdV, hex_gpr[HEX_REG_SP], IMMNO(0)) + +/* r0 =3D add(r0, r1) */ +#define fWRAP_SA1_addrx(GENHLPR, SHORTCODE) \ + tcg_gen_add_tl(RxV, RxV, RsV) + +#define fWRAP_A2_add(GENHLPR, SHORTCODE) \ + tcg_gen_add_tl(RdV, RsV, RtV) + +#define fWRAP_A2_sub(GENHLPR, SHORTCODE) \ + tcg_gen_sub_tl(RdV, RtV, RsV) + +/* r0 =3D sub(#10, r1) */ +#define fWRAP_A2_subri(GENHLPR, SHORTCODE) \ + tcg_gen_subfi_tl(RdV, siV, RsV) + +#define fWRAP_A2_addi(GENHLPR, SHORTCODE) \ + tcg_gen_addi_tl(RdV, RsV, siV) + +#define fWRAP_A2_and(GENHLPR, SHORTCODE) \ + tcg_gen_and_tl(RdV, RsV, RtV) + +#define fWRAP_A2_andir(GENHLPR, SHORTCODE) \ + tcg_gen_andi_tl(RdV, RsV, siV) + +#define fWRAP_A2_xor(GENHLPR, SHORTCODE) \ + tcg_gen_xor_tl(RdV, RsV, RtV) + +/* Transfer instructions */ +#define fWRAP_A2_tfr(GENHLPR, SHORTCODE) \ + tcg_gen_mov_tl(RdV, RsV) +#define fWRAP_SA1_tfr(GENHLPR, SHORTCODE) \ + tcg_gen_mov_tl(RdV, RsV) +#define fWRAP_A2_tfrsi(GENHLPR, SHORTCODE) \ + tcg_gen_movi_tl(RdV, siV) +#define fWRAP_A2_tfrcrr(GENHLPR, SHORTCODE) \ + tcg_gen_mov_tl(RdV, CsV) +#define fWRAP_A2_tfrrcr(GENHLPR, SHORTCODE) \ + tcg_gen_mov_tl(CdV, RsV) + +#define fWRAP_A2_nop(GENHLPR, SHORTCODE) \ + do { } while (0) + +/* Compare instructions */ +#define fWRAP_C2_cmpeq(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_EQ, PdV, RsV, RtV) +#define fWRAP_C4_cmpneq(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_NE, PdV, RsV, RtV) +#define fWRAP_C2_cmpgt(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_GT, PdV, RsV, RtV) +#define fWRAP_C2_cmpgtu(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_GTU, PdV, RsV, RtV) +#define fWRAP_C4_cmplte(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_LE, PdV, RsV, RtV) +#define fWRAP_C4_cmplteu(GENHLPR, SHORTCODE) \ + gen_compare(TCG_COND_LEU, PdV, RsV, RtV) +#define fWRAP_C2_cmpeqp(GENHLPR, SHORTCODE) \ + gen_compare_i64(TCG_COND_EQ, PdV, RssV, RttV) +#define fWRAP_C2_cmpgtp(GENHLPR, SHORTCODE) \ + gen_compare_i64(TCG_COND_GT, PdV, RssV, RttV) +#define fWRAP_C2_cmpgtup(GENHLPR, SHORTCODE) \ + gen_compare_i64(TCG_COND_GTU, PdV, RssV, RttV) +#define fWRAP_C2_cmpeqi(GENHLPR, SHORTCODE) \ + gen_comparei(TCG_COND_EQ, PdV, RsV, siV) +#define fWRAP_C2_cmpgti(GENHLPR, SHORTCODE) \ + gen_comparei(TCG_COND_GT, PdV, RsV, siV) +#define fWRAP_C2_cmpgtui(GENHLPR, SHORTCODE) \ + gen_comparei(TCG_COND_GTU, PdV, RsV, uiV) + +#define fWRAP_SA1_zxtb(GENHLPR, SHORTCODE) \ + tcg_gen_ext8u_tl(RdV, RsV) + +#define fWRAP_J2_jump(GENHLPR, SHORTCODE) \ + gen_jump(riV) +#define fWRAP_J2_jumpr(GENHLPR, SHORTCODE) \ + gen_write_new_pc(RsV) + +#define fWRAP_cond_jump(COND) \ + do { \ + TCGv LSB =3D tcg_temp_new(); \ + COND; \ + gen_cond_jump(LSB, riV); \ + tcg_temp_free(LSB); \ + } while (0) + +#define fWRAP_J2_jumpt(GENHLPR, SHORTCODE) \ + fWRAP_cond_jump(fLSBOLD(PuV)) +#define fWRAP_J2_jumpf(GENHLPR, SHORTCODE) \ + fWRAP_cond_jump(fLSBOLDNOT(PuV)) +#define fWRAP_J2_jumpfnewpt(GENHLPR, SHORTCODE) \ + fWRAP_cond_jump(fLSBNEWNOT(PuN)) +#define fWRAP_J2_jumpfnew(GENHLPR, SHORTCODE) \ + fWRAP_cond_jump(fLSBNEWNOT(PuN)) + +#define fWRAP_J2_jumprfnew(GENHLPR, SHORTCODE) \ + do { \ + TCGv LSB =3D tcg_temp_new(); \ + tcg_gen_andi_tl(LSB, PuN, 1); \ + tcg_gen_xori_tl(LSB, LSB, 1); \ + gen_cond_jumpr(LSB, RsV); \ + tcg_temp_free(LSB); \ + } while (0) + +#define fWRAP_J2_jumptnew(GENHLPR, SHORTCODE) \ + gen_cond_jump(PuN, riV) +#define fWRAP_J2_jumptnewpt(GENHLPR, SHORTCODE) \ + gen_cond_jump(PuN, riV) + #endif --=20 2.7.4