From patchwork Tue Feb 11 00:40:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 11374649 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 D2401109A for ; Tue, 11 Feb 2020 01:17:51 +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 A9DA620708 for ; Tue, 11 Feb 2020 01:17:51 +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="Y7QcN+fg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9DA620708 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]:42060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1KBS-0007rB-TO for patchwork-qemu-devel@patchwork.kernel.org; Mon, 10 Feb 2020 20:17:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33899) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Jck-0002Mz-6B for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Jci-0001n1-Ra for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:58 -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 1j1Jci-0004uP-H4 for qemu-devel@nongnu.org; Mon, 10 Feb 2020 19:41:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1581381716; x=1612917716; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fX4jiaKRL0KvmyYNfuCszvooVtv6M9+V3zlzTkr/sxI=; b=Y7QcN+fgFEg2ZINQaifuV99RYxyjrZS3Ry8NildaDkpnmm2YhfaDrPV9 RVhzkIEuAKhv4j8IxbvZcfUU7r1+o9fdj2s9aR6CeUky1IO/v2hIhQN7K 1RyHZcKf/vEZjmUu4raMu4g6Vte97raHev2927vFPgam7IXQvUrfzq/Vc Y=; 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 C33FE1BB0; Mon, 10 Feb 2020 18:41:01 -0600 (CST) From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH 48/66] Hexagon TCG generation - step 11 Date: Mon, 10 Feb 2020 18:40:26 -0600 Message-Id: <1581381644-13678-49-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 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_overrides.h index c651bbc..259716f 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) +/* p0 = cmp.eq(r0, #7) */ +#define fWRAP_SA1_cmpeqi(GENHLPR, SHORTCODE) \ + do { \ + TCGv tmp = tcg_temp_new(); \ + gen_comparei(TCG_COND_EQ, tmp, RsV, uiV); \ + gen_log_pred_write(0, tmp); \ + tcg_temp_free(tmp); \ + } while (0) + +/* r0 = add(r29,#8) */ +#define fWRAP_SA1_addsp(GENHLPR, SHORTCODE) \ + tcg_gen_addi_tl(RdV, hex_gpr[HEX_REG_SP], IMMNO(0)) + +/* r0 = 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 = 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 = 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 = 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