From patchwork Fri Jun 4 20:11:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454158 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp725792jae; Fri, 4 Jun 2021 13:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxux7wGu77xODrvZ1IBOfHSXHzQA7n1r9tGm5NvTDMm7ugKLdjO+eHJSyQKpL5dVOQB6xQs X-Received: by 2002:a6b:720f:: with SMTP id n15mr2511369ioc.209.1622837601213; Fri, 04 Jun 2021 13:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837601; cv=none; d=google.com; s=arc-20160816; b=JYcbvxtKKzMhKlx2+B2NYEByb0Le1Q0GQ1JiygRe8CGfS+ItGQpptNQ4wFE6SWqt5q Hs2faBZf7yHYM6Sym9SdXNRpMb0aE1+UG6jRpl9tWMMe+cHHFGYQaSlJEq0PzIbZG5aC 5FRJiVFM7kx0YiZ8trunK7v6vrEEClRwLzM9Q7KCRQj/MPAY0Q8GbIX2OgUv9P5VC6v0 JN0Nv0/XwZvHX+n8dxoZ7rJc/pLfnGsljazDynV5xKf+hHvWYORvXxGQ8Wxx0vHezT7P pEx7A1ZW4j7uaV+8ZH0vLeeTDZUmbXGdLPCq/DKNZo5Vu0zHKfJPstD/6zaegI0HwqBk wPOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=l2UwELGiZnIKpdCkZaYqqVJXOdc/mS9I96df+41M4E4=; b=N700HQ/8S/zDl8vnGp0Ak/KJ1Rl//GeOGp2wXeV5S4RFBTBOaxGL3NzBXJkQ+vyKuR /Y8ZR6rLrbNJ8wMocFzz+U5pc6//fzoi6QAQYcxIOHAhCVyL249NDyyeSq8WwLIsP9/e 7LZaycbSNhq/lXtDAAX73yfstBz/Vhl+zvXvVqMlcfXsThJPaet3IFwFqqWKHkhqHe3d qnmc1L3V//unQvdOgv/3LD7fNsdCPD/hYlfwMVBIguAmRguKXkPFEaRWGztD0MGUSqhC 0emteMVPGslx6io6huD4pIeNt38BFyU1tz1ZlrEMHU+Gr0xiLn2gyxvC2vrKsz8DHRV+ CLhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DOYKphav; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p20si8431093ilc.83.2021.06.04.13.13.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DOYKphav; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGC0-0005cy-Kh for patch@linaro.org; Fri, 04 Jun 2021 16:13:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGAw-0005cW-WC for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:15 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:40607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAv-0005H5-0x for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:14 -0400 Received: by mail-pj1-x1031.google.com with SMTP id jz2-20020a17090b14c2b0290162cf0b5a35so8035251pjb.5 for ; Fri, 04 Jun 2021 13:12:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l2UwELGiZnIKpdCkZaYqqVJXOdc/mS9I96df+41M4E4=; b=DOYKphavfnwBWqRQ3EmJkxvc/IcP9akw0ENodpKSGPFANTZUNNIzhhlXS/zfa1qudJ sSqy4lDq7TYMsZj8JAN6tFmASgDGSD8KyqYk/fZ0Mx/MLDKe2BXRKwSZudsyw/Mqn07a hCpAgmTCXjSMEgzUMj65g8cPJfhIR2npD54Prlhy8TOPY/uJiOw/nNkKp6GQyT8sdSab J7QUCTxpv7RDh8Ty/q5Bki8mtfQrt+d8nB+pNzL9QcRha5BqLvFN8glN/sF1qBmeLbjW Q72coPVkUHQ+8f/3zGg+XQKDUpQF7Jiw+S7qkOyGAtyP5EPTqvzX97GUkJPCUuLrvley +2bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=l2UwELGiZnIKpdCkZaYqqVJXOdc/mS9I96df+41M4E4=; b=d9mbHqckxHmume8MQfWp4OeCM7DgZzdS7izcSZOFxO7KJ1shidDDu3xHIlU0soMY1S CcVAvho2eThD6wv5EypAzbRzAMT7oLapF+nQddIQcrxZpZmLqi844cWqj/ix0Gm3G6YW mryQ6SidP6zQy6o7CKPpsLRkhGZc2PCcb51VmuUOWnsS1Qd36sJfS/N9/ONjCY+BPVT2 Bm3UsHjTOKPXV8Xn8ENyhejJFfGbYkwJpqTZXvOojc0fdc4lCchk0C8jpyl7T4OYE1qL Ew3/6W4vNk62rFb1zACMOAOA01JMVnyf1sM/SDEiFmJR3rQSQ12RUVqQ4DRyjtEvAqRL 0JMQ== X-Gm-Message-State: AOAM531YpAYVWUffGmXtZQoDL8quQjz7RB+5ScRKvmngo7MEGFsU4j6q 7XLfOkYsPE6UI0k2PoCtOkp/l/WqJlVSTg== X-Received: by 2002:a17:902:b58a:b029:fe:735f:ddbf with SMTP id a10-20020a170902b58ab02900fe735fddbfmr5852830pls.68.1622837531497; Fri, 04 Jun 2021 13:12:11 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 01/15] tcg: Change parameters for tcg_target_const_match Date: Fri, 4 Jun 2021 13:11:56 -0700 Message-Id: <20210604201210.920136-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Change the return value to bool, because that's what is should have been from the start. Pass the ct mask instead of the whole TCGArgConstraint, as that's the only part that's relevant. Change the value argument to int64_t. We will need the extra width for 32-bit hosts wanting to match vector constants. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tcg.c | 5 ++--- tcg/aarch64/tcg-target.c.inc | 5 +---- tcg/arm/tcg-target.c.inc | 5 +---- tcg/i386/tcg-target.c.inc | 4 +--- tcg/mips/tcg-target.c.inc | 5 +---- tcg/ppc/tcg-target.c.inc | 4 +--- tcg/riscv/tcg-target.c.inc | 4 +--- tcg/s390/tcg-target.c.inc | 5 +---- tcg/sparc/tcg-target.c.inc | 5 +---- tcg/tci/tcg-target.c.inc | 6 ++---- 10 files changed, 12 insertions(+), 36 deletions(-) -- 2.25.1 diff --git a/tcg/tcg.c b/tcg/tcg.c index db806a6658..0dc271aac9 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -148,8 +148,7 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, static bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, TCGReg base, intptr_t ofs); static void tcg_out_call(TCGContext *s, const tcg_insn_unit *target); -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct); +static bool tcg_target_const_match(int64_t val, TCGType type, int ct); #ifdef TCG_TARGET_NEED_LDST_LABELS static int tcg_out_ldst_finalize(TCGContext *s); #endif @@ -4078,7 +4077,7 @@ static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) ts = arg_temp(arg); if (ts->val_type == TEMP_VAL_CONST - && tcg_target_const_match(ts->val, ts->type, arg_ct)) { + && tcg_target_const_match(ts->val, ts->type, arg_ct->ct)) { /* constant is OK for instruction */ const_args[i] = 1; new_args[i] = ts->val; diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 5bd366f2d4..27cde314a9 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -277,11 +277,8 @@ static bool is_shimm1632(uint32_t v32, int *cmode, int *imm8) } } -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; - if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 8457108a87..eb4f42e53d 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -301,11 +301,8 @@ static inline int check_fit_imm(uint32_t imm) * mov operand2: values represented with x << (2 * y), x < 0x100 * add, sub, eor...: ditto */ -static inline int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct; - ct = arg_ct->ct; if (ct & TCG_CT_CONST) { return 1; } else if ((ct & TCG_CT_CONST_ARM) && check_fit_imm(val)) { diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 415c5c0796..34113388ef 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -210,10 +210,8 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, } /* test if a constant matches the constraint */ -static inline int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc index 8b16726242..5944448b2a 100644 --- a/tcg/mips/tcg-target.c.inc +++ b/tcg/mips/tcg-target.c.inc @@ -193,11 +193,8 @@ static inline bool is_p2m1(tcg_target_long val) } /* test if a constant matches the constraint */ -static inline int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct; - ct = arg_ct->ct; if (ct & TCG_CT_CONST) { return 1; } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) { diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 838ccfa42d..795701442b 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -238,10 +238,8 @@ static bool reloc_pc14(tcg_insn_unit *src_rw, const tcg_insn_unit *target) } /* test if a constant matches the constraint */ -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index ef43147040..da7eecafc5 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -145,10 +145,8 @@ static inline tcg_target_long sextreg(tcg_target_long val, int pos, int len) } /* test if a constant matches the constraint */ -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/s390/tcg-target.c.inc b/tcg/s390/tcg-target.c.inc index af8dfe81ac..5fe073f09a 100644 --- a/tcg/s390/tcg-target.c.inc +++ b/tcg/s390/tcg-target.c.inc @@ -417,11 +417,8 @@ static bool patch_reloc(tcg_insn_unit *src_rw, int type, } /* Test if a constant matches the constraint. */ -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; - if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/sparc/tcg-target.c.inc b/tcg/sparc/tcg-target.c.inc index 3d50f985c6..ce39ac2d86 100644 --- a/tcg/sparc/tcg-target.c.inc +++ b/tcg/sparc/tcg-target.c.inc @@ -341,11 +341,8 @@ static bool patch_reloc(tcg_insn_unit *src_rw, int type, } /* test if a constant matches the constraint */ -static inline int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - int ct = arg_ct->ct; - if (ct & TCG_CT_CONST) { return 1; } diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc index ee6cdfec71..823ecd5d35 100644 --- a/tcg/tci/tcg-target.c.inc +++ b/tcg/tci/tcg-target.c.inc @@ -789,11 +789,9 @@ static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, } /* Test if a constant matches the constraint. */ -static int tcg_target_const_match(tcg_target_long val, TCGType type, - const TCGArgConstraint *arg_ct) +static bool tcg_target_const_match(int64_t val, TCGType type, int ct) { - /* No need to return 0 or 1, 0 or != 0 is good enough. */ - return arg_ct->ct & TCG_CT_CONST; + return ct & TCG_CT_CONST; } static void tcg_target_init(TCGContext *s) From patchwork Fri Jun 4 20:11:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454157 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp725505jae; Fri, 4 Jun 2021 13:12:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXspVHUtPyW8NW+hRfKh7wegmEiyFp1q+v1RmMI+ciE04+N/ZuCPCE+bQp8xqE9tRPN6aZ X-Received: by 2002:a05:6638:38a8:: with SMTP id b40mr5607685jav.37.1622837570131; Fri, 04 Jun 2021 13:12:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837570; cv=none; d=google.com; s=arc-20160816; b=JAZTAmUpzz8w36RNpiLCckqPhHbF7sQWRf5pk83AWz1UcAcWxTvkU2ZI+vJ8q6I2C/ I9ZSdhNP9EZUThdAyAFORxJ3vVvEfAlrm8w0Vs0KICZECwwYnKvNyZb+0ONzZc1iPEWj N358A4rOWHNmSTz8v215ZBOEGztgknJKpP/5Mn/S/uX5ZBWmT/4jqrS5th07Vso5WlMf OnbUY41uoMAYMAvvo2S2TqFAez4e7SwZlyYNdTDmROWeHAM/FJjbjlxRZJgvTqHyD8sQ pMD9QSV5gcn0/SHcVO/FgxRYctFx/Q2heDJWaUVQvb5WnxMgFzmJJPiUHH38HIvCSNim TRWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=uhnv3DU/ab7lvFoOWhro8SY6YuqOZ4zZG1TsE9eSUIo=; b=GIGEu4N6u8I3vZrvv7YYZjQNx6wq5DYSIR5EEXRyipvpuR+FWhslmuw0srlrk14ret 0xdf0PjkteIrDlbYKS3VzenNa2IbUfU423iKCopnzu3Hzfx8O5c4knqrutDd3+40Her8 498d1GYGGRShhNVmh1odPqxED+qB4sDAAH/cQQNwbvZL7ZHndFFkdToFu/Qg4iJpNQVp zYv/Y94Ly6GMJpCxOzFxaJ6pRw6GdfqXEmBJPG5I6Q0qZeUQBzw1Ssg/Hfezc9E+IcRy dq8vNOnxYd+u/Qc1U9Oh2hqVG14jGLqanvrwlDmL3zZzx5IrFBJ6/yLzT1c6cFUcF82r cjdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsnID9M0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k21si7407780ioh.78.2021.06.04.13.12.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:12:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsnID9M0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGBV-0005jU-E7 for patch@linaro.org; Fri, 04 Jun 2021 16:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGAz-0005d2-1v for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:17 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:46887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAv-0005Hn-E3 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:16 -0400 Received: by mail-pj1-x1033.google.com with SMTP id pi6-20020a17090b1e46b029015cec51d7cdso6475962pjb.5 for ; Fri, 04 Jun 2021 13:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uhnv3DU/ab7lvFoOWhro8SY6YuqOZ4zZG1TsE9eSUIo=; b=LsnID9M0mQbsIrOv6l8JaAX0UXp3Xcnb9vzhFbMQyk1KQ5ADFLtmd1uOFLoYGENCOO wpwbsVqklpozFJBKSmgXbqaR71zRlBI58wloJV4azRQezKPnL3j7omJX+5aVSJUmF9cy MMlcTdfSpFmpLpLgUQptFa/Fz+sf8BVA1Mx8RihoqCi7Qm+c/7IpTEAy4m34//28WU9e qRB5dacvjIrtJAGKYdwe5rQ8o+PBwlWvb87nXrRxVI+V9jlk3eFlkKYATZ+BOk0xZrQE ZHaWb28rP7W4uuJr1Mv3Ts95Ah8wKqrkn6fckNl4iA/ToYJeXTSC3/uMTsdcd64YBAy3 GK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uhnv3DU/ab7lvFoOWhro8SY6YuqOZ4zZG1TsE9eSUIo=; b=b02a/CkEw1folffFY8Uy4A3FIDw3ykazKDF0NW+pUfn76qH6sUwUHeWlTJIVa1H8GA 2KLvSDXvfkPsSlqtsBIAIaH+fF5aLN//pHwLOx2mflXAj/OK/gX8WcHEXD4Ec97ucju6 +w34suRGG6uMbiBdWFOPtV8SYK6rTubGwMPClwBzM4AjnXaQExgD/+qT26H+IceNMhot vQs7i8heeHuhR/Hpnp5Ea2rKqsIMe8+h7m8+iyhIywsxImYBmvCbSJ7arLM2eGA0nFes qTPf3w5kNjepSaMMTMyysn9T7W2uqBLsZ2QAP+/tmm6iGTjWgVQORLJ179ZTNg/arQJ8 WzTQ== X-Gm-Message-State: AOAM533kF0TQXZHP1HqrOihBPSK2KhnM7fpWno46Zn2WuPEVVfVN/owB 4vJtrGLSXrOC1vkiGGub/+MgkVcsI4hBlg== X-Received: by 2002:a17:902:a50b:b029:f7:820f:fd1c with SMTP id s11-20020a170902a50bb02900f7820ffd1cmr6018701plq.69.1622837532033; Fri, 04 Jun 2021 13:12:12 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 02/15] tcg/arm: Add host vector framework Date: Fri, 4 Jun 2021 13:11:57 -0700 Message-Id: <20210604201210.920136-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add registers and function stubs. The functionality is disabled via use_neon_instructions defined to 0. We must still include results for the mandatory opcodes in tcg_target_op_def, as all opcodes are checked during tcg init. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-con-set.h | 4 ++ tcg/arm/tcg-target-con-str.h | 1 + tcg/arm/tcg-target.h | 48 ++++++++++++-- tcg/arm/tcg-target.opc.h | 12 ++++ tcg/arm/tcg-target.c.inc | 117 +++++++++++++++++++++++++++++------ 5 files changed, 158 insertions(+), 24 deletions(-) create mode 100644 tcg/arm/tcg-target.opc.h -- 2.25.1 diff --git a/tcg/arm/tcg-target-con-set.h b/tcg/arm/tcg-target-con-set.h index ab63e089c2..27aced5391 100644 --- a/tcg/arm/tcg-target-con-set.h +++ b/tcg/arm/tcg-target-con-set.h @@ -13,11 +13,14 @@ C_O0_I1(r) C_O0_I2(r, r) C_O0_I2(r, rIN) C_O0_I2(s, s) +C_O0_I2(w, r) C_O0_I3(s, s, s) C_O0_I4(r, r, rI, rI) C_O0_I4(s, s, s, s) C_O1_I1(r, l) C_O1_I1(r, r) +C_O1_I1(w, r) +C_O1_I1(w, wr) C_O1_I2(r, 0, rZ) C_O1_I2(r, l, l) C_O1_I2(r, r, r) @@ -26,6 +29,7 @@ C_O1_I2(r, r, rIK) C_O1_I2(r, r, rIN) C_O1_I2(r, r, ri) C_O1_I2(r, rZ, rZ) +C_O1_I2(w, w, w) C_O1_I4(r, r, r, rI, rI) C_O1_I4(r, r, rIN, rIK, 0) C_O2_I1(r, r, l) diff --git a/tcg/arm/tcg-target-con-str.h b/tcg/arm/tcg-target-con-str.h index a0ab7747db..255a1ae0e2 100644 --- a/tcg/arm/tcg-target-con-str.h +++ b/tcg/arm/tcg-target-con-str.h @@ -11,6 +11,7 @@ REGS('r', ALL_GENERAL_REGS) REGS('l', ALL_QLOAD_REGS) REGS('s', ALL_QSTORE_REGS) +REGS('w', ALL_VECTOR_REGS) /* * Define constraint letters for constants: diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 8d1fee6327..a9dc09bd08 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -78,19 +78,38 @@ typedef enum { TCG_REG_R13, TCG_REG_R14, TCG_REG_PC, + + TCG_REG_Q0, + TCG_REG_Q1, + TCG_REG_Q2, + TCG_REG_Q3, + TCG_REG_Q4, + TCG_REG_Q5, + TCG_REG_Q6, + TCG_REG_Q7, + TCG_REG_Q8, + TCG_REG_Q9, + TCG_REG_Q10, + TCG_REG_Q11, + TCG_REG_Q12, + TCG_REG_Q13, + TCG_REG_Q14, + TCG_REG_Q15, + + TCG_AREG0 = TCG_REG_R6, + TCG_REG_CALL_STACK = TCG_REG_R13, } TCGReg; -#define TCG_TARGET_NB_REGS 16 +#define TCG_TARGET_NB_REGS 32 #ifdef __ARM_ARCH_EXT_IDIV__ #define use_idiv_instructions 1 #else extern bool use_idiv_instructions; #endif - +#define use_neon_instructions 0 /* used for function call generation */ -#define TCG_REG_CALL_STACK TCG_REG_R13 #define TCG_TARGET_STACK_ALIGN 8 #define TCG_TARGET_CALL_ALIGN_ARGS 1 #define TCG_TARGET_CALL_STACK_OFFSET 0 @@ -128,9 +147,26 @@ extern bool use_idiv_instructions; #define TCG_TARGET_HAS_direct_jump 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 -enum { - TCG_AREG0 = TCG_REG_R6, -}; +#define TCG_TARGET_HAS_v64 use_neon_instructions +#define TCG_TARGET_HAS_v128 use_neon_instructions +#define TCG_TARGET_HAS_v256 0 + +#define TCG_TARGET_HAS_andc_vec 0 +#define TCG_TARGET_HAS_orc_vec 0 +#define TCG_TARGET_HAS_not_vec 0 +#define TCG_TARGET_HAS_neg_vec 0 +#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_roti_vec 0 +#define TCG_TARGET_HAS_rots_vec 0 +#define TCG_TARGET_HAS_rotv_vec 0 +#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shs_vec 0 +#define TCG_TARGET_HAS_shv_vec 0 +#define TCG_TARGET_HAS_mul_vec 0 +#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_minmax_vec 0 +#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_cmpsel_vec 0 #define TCG_TARGET_DEFAULT_MO (0) #define TCG_TARGET_HAS_MEMORY_BSWAP 1 diff --git a/tcg/arm/tcg-target.opc.h b/tcg/arm/tcg-target.opc.h new file mode 100644 index 0000000000..7a4578e9b4 --- /dev/null +++ b/tcg/arm/tcg-target.opc.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2019 Linaro + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * (at your option) any later version. + * + * See the COPYING file in the top-level directory for details. + * + * Target-specific opcodes for host vector expansion. These will be + * emitted by tcg_expand_vec_op. For those familiar with GCC internals, + * consider these to be UNSPEC with names. + */ diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index eb4f42e53d..4770d0c537 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -40,22 +40,10 @@ bool use_idiv_instructions; #ifdef CONFIG_DEBUG_TCG static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = { - "%r0", - "%r1", - "%r2", - "%r3", - "%r4", - "%r5", - "%r6", - "%r7", - "%r8", - "%r9", - "%r10", - "%r11", - "%r12", - "%r13", - "%r14", - "%pc", + "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", + "%r8", "%r9", "%r10", "%r11", "%r12", "%sp", "%r14", "%pc", + "%q0", "%q1", "%q2", "%q3", "%q4", "%q5", "%q6", "%q7", + "%q8", "%q9", "%q10", "%q11", "%q12", "%q13", "%q14", "%q15", }; #endif @@ -75,6 +63,20 @@ static const int tcg_target_reg_alloc_order[] = { TCG_REG_R3, TCG_REG_R12, TCG_REG_R14, + + TCG_REG_Q0, + TCG_REG_Q1, + TCG_REG_Q2, + TCG_REG_Q3, + /* Q4 - Q7 are call-saved, and skipped. */ + TCG_REG_Q8, + TCG_REG_Q9, + TCG_REG_Q10, + TCG_REG_Q11, + TCG_REG_Q12, + TCG_REG_Q13, + TCG_REG_Q14, + TCG_REG_Q15, }; static const int tcg_target_call_iarg_regs[4] = { @@ -85,6 +87,7 @@ static const int tcg_target_call_oarg_regs[2] = { }; #define TCG_REG_TMP TCG_REG_R12 +#define TCG_VEC_TMP TCG_REG_Q15 enum arm_cond_code_e { COND_EQ = 0x0, @@ -238,6 +241,7 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, #define TCG_CT_CONST_ZERO 0x800 #define ALL_GENERAL_REGS 0xffffu +#define ALL_VECTOR_REGS 0xffff0000u /* * r0-r2 will be overwritten when reading the tlb entry (softmmu only) @@ -2117,6 +2121,22 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_qemu_st_i64: return TARGET_LONG_BITS == 32 ? C_O0_I3(s, s, s) : C_O0_I4(s, s, s, s); + case INDEX_op_st_vec: + return C_O0_I2(w, r); + case INDEX_op_ld_vec: + case INDEX_op_dupm_vec: + return C_O1_I1(w, r); + case INDEX_op_dup_vec: + return C_O1_I1(w, wr); + case INDEX_op_dup2_vec: + case INDEX_op_add_vec: + case INDEX_op_sub_vec: + case INDEX_op_xor_vec: + case INDEX_op_or_vec: + case INDEX_op_and_vec: + case INDEX_op_cmp_vec: + return C_O1_I2(w, w, w); + default: g_assert_not_reached(); } @@ -2126,12 +2146,18 @@ static void tcg_target_init(TCGContext *s) { /* Only probe for the platform and capabilities if we havn't already determined maximum values at compile time. */ -#ifndef use_idiv_instructions +#if !defined(use_idiv_instructions) || !defined(use_neon_instructions) { unsigned long hwcap = qemu_getauxval(AT_HWCAP); +#ifndef use_idiv_instructions use_idiv_instructions = (hwcap & HWCAP_ARM_IDIVA) != 0; +#endif +#ifndef use_neon_instructions + use_neon_instructions = (hwcap & HWCAP_ARM_NEON) != 0; +#endif } #endif + if (__ARM_ARCH < 7) { const char *pl = (const char *)qemu_getauxval(AT_PLATFORM); if (pl != NULL && pl[0] == 'v' && pl[1] >= '4' && pl[1] <= '9') { @@ -2139,7 +2165,7 @@ static void tcg_target_init(TCGContext *s) } } - tcg_target_available_regs[TCG_TYPE_I32] = 0xffff; + tcg_target_available_regs[TCG_TYPE_I32] = ALL_GENERAL_REGS; tcg_target_call_clobber_regs = 0; tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R0); @@ -2149,10 +2175,29 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R12); tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_R14); + if (use_neon_instructions) { + tcg_target_available_regs[TCG_TYPE_V64] = ALL_VECTOR_REGS; + tcg_target_available_regs[TCG_TYPE_V128] = ALL_VECTOR_REGS; + + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q0); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q1); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q2); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q3); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q8); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q9); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q10); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q11); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q12); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q13); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q14); + tcg_regset_set_reg(tcg_target_call_clobber_regs, TCG_REG_Q15); + } + s->reserved_regs = 0; tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); tcg_regset_set_reg(s->reserved_regs, TCG_REG_TMP); tcg_regset_set_reg(s->reserved_regs, TCG_REG_PC); + tcg_regset_set_reg(s->reserved_regs, TCG_VEC_TMP); } static inline void tcg_out_ld(TCGContext *s, TCGType type, TCGReg arg, @@ -2186,6 +2231,42 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type, tcg_out_movi32(s, COND_AL, ret, arg); } +static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg rd, TCGReg rs) +{ + g_assert_not_reached(); +} + +static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg rd, TCGReg base, intptr_t offset) +{ + g_assert_not_reached(); +} + +static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg rd, int64_t v64) +{ + g_assert_not_reached(); +} + +static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, + unsigned vecl, unsigned vece, + const TCGArg *args, const int *const_args) +{ + g_assert_not_reached(); +} + +int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) +{ + return 0; +} + +void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, + TCGArg a0, ...) +{ + g_assert_not_reached(); +} + static void tcg_out_nop_fill(tcg_insn_unit *p, int count) { int i; From patchwork Fri Jun 4 20:11:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454156 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp725492jae; Fri, 4 Jun 2021 13:12:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDMwkoiO6eay209b/6ki5J32j0c8u85PM+WfCBbSuW3B8goDQYYC71dZv0oPfJfHq2udZI X-Received: by 2002:a05:6638:294:: with SMTP id c20mr5503101jaq.86.1622837568695; Fri, 04 Jun 2021 13:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837568; cv=none; d=google.com; s=arc-20160816; b=RvOvj8lRNnL/CeiqelZCpBpfmM3cx6mmZbPStiuJjSTRwzEaa3qympvIZ2bBH5N4EF dKi9mG0Kmy02SSnYmvoiGFpPcGuFZxdtbyvP6jNr8z0EQ5UNSDzt65IZEqn61H9l62Ha 0a33/LQFyJgNny5zzjqAdcdxfOc3O6rn0tTEbBdUHFgeswsN8ayl+xHBBFw5GkbMbtQ+ SWfRbjvZTi/dmRS3Y8w5rPzO09VwPkli9B3/YpRhXUQcSK++FTOsrT28XMS0gLlTDsKa aFpvcA8ly51Wbs7f9ly7fnbHE/0ajVx+5Gc8WnDSWKCX0HQu6yDm5e1eQ9DJiL3AOa0D QOjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=7WBmKaaDBnqx8/b/uuVnTF9efjpwsBpvtLLAQjoYELA=; b=e5FJXEfhaA68pU+sCyfreZdCnaPkRCFX6IX+I2jlRjS+yc6riTZjV1cT+khC4X31l8 D0Ezb1nRAVYHVget0A/NgXurP9t6oNIYmre8LFQIwNTnpqPvRYDW/WmxcGqZ4ewZZ3lR ghGdqxhAwapHpuszTmUHWuRcOjVbHKscL4DTPENi1td6AhoNuHDjtySIRVzQVxTtL9z3 XCAHd9Lr27Oa/YAEv/9iry/yP8J/Q99rn7L4HtXQ+y/wysrdpRc0YxbAL0uo+CM9gjjQ e5Y7pKNnf8EmIjU8I6fLDdQp7HOLwBw3KcCOotQisAe8fslkMvZSTdEqCA+mqTZdyK4P k5ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XdEORA1R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f16si6944218iox.100.2021.06.04.13.12.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XdEORA1R; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGBU-0005gQ-5n for patch@linaro.org; Fri, 04 Jun 2021 16:12:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGAy-0005cn-Hf for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:16 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:43941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAv-0005IR-Vq for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:16 -0400 Received: by mail-pf1-x431.google.com with SMTP id t28so8234733pfg.10 for ; Fri, 04 Jun 2021 13:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7WBmKaaDBnqx8/b/uuVnTF9efjpwsBpvtLLAQjoYELA=; b=XdEORA1RyO62HcVC+8uicyaXd2SRLNJrFk/ZMpJcOJ6a32JoDtuQaX8/gljsb/CqMl DNZf/kv9vk0E4VVhNpZsdu2LTHets3gdRhfvfZSEG24mk88ZsJNXv0OkQRFd3ePazyGg Br0vcw94cMCDM2EtWyReNxgtfEcfCV6gBHaJJ+xapSpKOceCQb/fmAgkovdE6SeuJp2G ixgeSshRFPzQZzK1+xYROVrlooEPFCkeZ/TNTGXop7/nIHgxNDYSmJRNw9uqdfv9F4Y/ nsse8DNRODswdX2i0sWpqeTaa36RIev7pKtrJzBPFbzCx6Tb5QSrbV6cQC4trxkNEQ1E qvBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7WBmKaaDBnqx8/b/uuVnTF9efjpwsBpvtLLAQjoYELA=; b=GVfqKeuaOtjoVhp8NLUvs7y6Y/Se0Uqxo2afs5rzcI9xyHnULEzKWTD5S3eQKgSdJx I9uk0i/0T25E1wlOyaRBvuMuQdDIv8LpbT8SDpGHCm2c3ITCf9wT8PJc6M99D0qG4pJp 1Aiy/N1fkb8C1OM5f8atP4ZyJWAfIpya5neHVC2KMoJHdgCQ5c66G+eWJJhj3RkjOcYf nesr7YBGGNltBWElCQsaLpHBvakNnex2bU2kJPd6sl1jl8Avx0xyyWSGzqIpgzaGhysh 2nsdvZ6o9FgGgm9q8Da0JSZQNPfOvt9PKJAr/Yb5isk4xL7sTecO8+IblkQ2ebWtspc5 oH+g== X-Gm-Message-State: AOAM533SHWniYZtOkGEdbM4hWLsoEAO4+D5wJw/2dlnr0AweBcPDLdge tDZa7VRyVqODZtKLQu7PHp/HoLyN3C9w0g== X-Received: by 2002:a65:6291:: with SMTP id f17mr6560512pgv.280.1622837532677; Fri, 04 Jun 2021 13:12:12 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/15] tcg/arm: Implement tcg_out_ld/st for vector types Date: Fri, 4 Jun 2021 13:11:58 -0700 Message-Id: <20210604201210.920136-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 70 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 4770d0c537..c6cfb83308 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -172,6 +172,9 @@ typedef enum { INSN_NOP_v6k = 0xe320f000, /* Otherwise the assembler uses mov r0,r0 */ INSN_NOP_v4 = (COND_AL << 28) | ARITH_MOV, + + INSN_VLD1 = 0xf4200000, /* VLD1 (multiple single elements) */ + INSN_VST1 = 0xf4000000, /* VST1 (multiple single elements) */ } ARMInsn; #define INSN_NOP (use_armv7_instructions ? INSN_NOP_v6k : INSN_NOP_v4) @@ -1093,6 +1096,33 @@ static TCGCond tcg_out_cmp2(TCGContext *s, const TCGArg *args, } } +/* + * Note that TCGReg references Q-registers. + * Q-regno = 2 * D-regno, so shift left by 1 whlie inserting. + */ +static uint32_t encode_vd(TCGReg rd) +{ + tcg_debug_assert(rd >= TCG_REG_Q0); + return (extract32(rd, 3, 1) << 22) | (extract32(rd, 0, 3) << 13); +} + +static void tcg_out_vldst(TCGContext *s, ARMInsn insn, + TCGReg rd, TCGReg rn, int offset) +{ + if (offset != 0) { + if (check_fit_imm(offset) || check_fit_imm(-offset)) { + tcg_out_dat_rIN(s, COND_AL, ARITH_ADD, ARITH_SUB, + TCG_REG_TMP, rn, offset, true); + } else { + tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_TMP, offset); + tcg_out_dat_reg(s, COND_AL, ARITH_ADD, + TCG_REG_TMP, TCG_REG_TMP, rn, 0); + } + rn = TCG_REG_TMP; + } + tcg_out32(s, insn | (rn << 16) | encode_vd(rd) | 0xf); +} + #ifdef CONFIG_SOFTMMU #include "../tcg-ldst.c.inc" @@ -2200,16 +2230,44 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_VEC_TMP); } -static inline void tcg_out_ld(TCGContext *s, TCGType type, TCGReg arg, - TCGReg arg1, intptr_t arg2) +static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg arg, + TCGReg arg1, intptr_t arg2) { - tcg_out_ld32u(s, COND_AL, arg, arg1, arg2); + switch (type) { + case TCG_TYPE_I32: + tcg_out_ld32u(s, COND_AL, arg, arg1, arg2); + return; + case TCG_TYPE_V64: + /* regs 1; size 8; align 8 */ + tcg_out_vldst(s, INSN_VLD1 | 0x7d0, arg, arg1, arg2); + return; + case TCG_TYPE_V128: + /* regs 2; size 8; align 16 */ + tcg_out_vldst(s, INSN_VLD1 | 0xae0, arg, arg1, arg2); + return; + default: + g_assert_not_reached(); + } } -static inline void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, - TCGReg arg1, intptr_t arg2) +static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, + TCGReg arg1, intptr_t arg2) { - tcg_out_st32(s, COND_AL, arg, arg1, arg2); + switch (type) { + case TCG_TYPE_I32: + tcg_out_st32(s, COND_AL, arg, arg1, arg2); + return; + case TCG_TYPE_V64: + /* regs 1; size 8; align 8 */ + tcg_out_vldst(s, INSN_VST1 | 0x7d0, arg, arg1, arg2); + return; + case TCG_TYPE_V128: + /* regs 2; size 8; align 16 */ + tcg_out_vldst(s, INSN_VST1 | 0xae0, arg, arg1, arg2); + return; + default: + g_assert_not_reached(); + } } static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, From patchwork Fri Jun 4 20:11:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454162 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp726917jae; Fri, 4 Jun 2021 13:15:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz59s6XNPKLY0yIGCehTLY3MT82pfqy1WjECTeq1i9MSvA9HvysK3qhpjABCpR0OF4/Dz6m X-Received: by 2002:a92:dc10:: with SMTP id t16mr5081542iln.75.1622837733793; Fri, 04 Jun 2021 13:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837733; cv=none; d=google.com; s=arc-20160816; b=Xazhndp8ztu2bkBN0kzZLyayXszlawVIvfzKE6j6T9BD3YDPa8eBzeAvd4+UHeh8Jy TlfHQM8h9IiDKM0JMwcvwDljkVyqkGlQH85HwBiqkly8omOMNbP13I4aUJMURJXn6qCR 2ToqHHJwVzB9QvcKK8wp2Myp37SkK5I9LayF39mY0b+swnU+JdE/wF0VO+7xOlV70Rcs 603x69zDU6fNAu5Z2sq7C2yHanoHiHqJwP7qE+U4d2jmpA/JBRZX7o/wx89Q6gOB1D8i uQivMRmTkYSYB75YBsHHSx3/8erIb3S1FAkmu3QyWE82LyAubB4O0eUjfEK9v4sQ4d40 J/uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=R9nwVKNOQ71e/mfsdQAKgcoJg5Q6skMHW8VAyFqbJYY=; b=USff9YW6cZm01gHcUKTsMRk+AnOypYfgL3k1H0ZTnuKbLo7mlmM7Qv7RrSLp3+5kqk IeH5X4ynbP6vM/CwvAhhi94C+FVg8EnZtgZmdFkjwjyTPDNiuY+8uUlM4GR0ih7Zn87I IQNkTOmuwaI+nCyvblBHldx8FnRaDr6BNIx78wvAVshRsRiqw9T+yw9hHG1y5pNZ1Bvv U3tAaw60d46HUyjN4ovq5cJ5w3BxVW6PVbMH3kLFtj5QUNPBGGIZjtI+g5Aap26ksXPd +cxoID+kqY4ejrVN/di2tJ+/LOGQKQ6LGSUdw9PJqyKrlTsNA3W4oj3pMQHaVStyIU6Q cyHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x1vhqERh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b25si6862817ioh.80.2021.06.04.13.15.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:15:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=x1vhqERh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54550 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGE9-0002ws-6z for patch@linaro.org; Fri, 04 Jun 2021 16:15:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB0-0005i9-S9 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:18 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:33712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAw-0005IX-Cn for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:18 -0400 Received: by mail-pj1-x1031.google.com with SMTP id k22-20020a17090aef16b0290163512accedso5708572pjz.0 for ; Fri, 04 Jun 2021 13:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R9nwVKNOQ71e/mfsdQAKgcoJg5Q6skMHW8VAyFqbJYY=; b=x1vhqERhq7PJubItn3B/7lTJktovQErHCSTNSSKlHKwvwLQMqZzhsQZ9fl+HbGOeOr D+XWdQoRQw0fNhgHl9Ddd+EwHm1h9Y1fy3ZoLINFvK67lVky/vnN50ylsMY4rm5jp9DJ 22OA+ZnJOi56SAQELdBT5DQ/JhpbY14QC0Io3K4raPxO5j83o16UQ9vF/IGbf9Homn6X NrLXtIEagmIYt2EGgrweZmoRsfXNvePJuuIH2LkxGU6RwQywmw+YAhOh3kZhKD7H5+IH OUKqzUknufLLaEfFX3PD6KZ99qS+1di1Ijlxay9c1OKXMAPPqRk4LHtKa6Bw6Ec+HBg0 i/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R9nwVKNOQ71e/mfsdQAKgcoJg5Q6skMHW8VAyFqbJYY=; b=cpvyX21rfc3+LKHAxRA1uamxkFibRFIpoYqyUGP/1+BcN/Jb+ePXT2zZOjJvMPidz/ m1youncUT4NtH0DFY4TYg95ydfIVXFJ6FIF9dlPjewhhwI0bd3NTlkGuAF47S3xPO896 pLz+/lACgf84/wkBsqEUxzCZRfQSImAgrJYxzlSRFOlK7nuLwdhLJIZFEuKMG4JiQvKb cRYX47yvJeMGrecBhmnwVbkLRJgg8QaTja0KRX0csxud9DppmEArqksswRRN8laOGqOe omLGo0tgiJhoqVRFDpVrfnh+nsp33cQw9J9sWCBvalm10OBYUdlVrOaViowUggOX63OV HMZw== X-Gm-Message-State: AOAM531krEHGiiFf6TFMpwInApuANxY9vl1hl9HDJyUQv4XrqaQ5672T dcKu8xSweRyqMNYA1zYjm5FN5eUPIFDdjA== X-Received: by 2002:a17:90b:1991:: with SMTP id mv17mr706895pjb.109.1622837533281; Fri, 04 Jun 2021 13:12:13 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 04/15] tcg/arm: Implement tcg_out_mov for vector types Date: Fri, 4 Jun 2021 13:11:59 -0700 Message-Id: <20210604201210.920136-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 52 +++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index c6cfb83308..a802d4b585 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -173,6 +173,8 @@ typedef enum { /* Otherwise the assembler uses mov r0,r0 */ INSN_NOP_v4 = (COND_AL << 28) | ARITH_MOV, + INSN_VORR = 0xf2200110, + INSN_VLD1 = 0xf4200000, /* VLD1 (multiple single elements) */ INSN_VST1 = 0xf4000000, /* VST1 (multiple single elements) */ } ARMInsn; @@ -1106,6 +1108,25 @@ static uint32_t encode_vd(TCGReg rd) return (extract32(rd, 3, 1) << 22) | (extract32(rd, 0, 3) << 13); } +static uint32_t encode_vn(TCGReg rn) +{ + tcg_debug_assert(rn >= TCG_REG_Q0); + return (extract32(rn, 3, 1) << 7) | (extract32(rn, 0, 3) << 17); +} + +static uint32_t encode_vm(TCGReg rm) +{ + tcg_debug_assert(rm >= TCG_REG_Q0); + return (extract32(rm, 3, 1) << 5) | (extract32(rm, 0, 3) << 1); +} + +static void tcg_out_vreg3(TCGContext *s, ARMInsn insn, int q, int vece, + TCGReg d, TCGReg n, TCGReg m) +{ + tcg_out32(s, insn | (vece << 20) | (q << 6) | + encode_vd(d) | encode_vn(n) | encode_vm(m)); +} + static void tcg_out_vldst(TCGContext *s, ARMInsn insn, TCGReg rd, TCGReg rn, int offset) { @@ -2276,16 +2297,35 @@ static inline bool tcg_out_sti(TCGContext *s, TCGType type, TCGArg val, return false; } -static inline bool tcg_out_mov(TCGContext *s, TCGType type, - TCGReg ret, TCGReg arg) +static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) { - tcg_out_mov_reg(s, COND_AL, ret, arg); - return true; + if (ret == arg) { + return true; + } + switch (type) { + case TCG_TYPE_I32: + if (ret < TCG_REG_Q0 && arg < TCG_REG_Q0) { + tcg_out_mov_reg(s, COND_AL, ret, arg); + return true; + } + return false; + + case TCG_TYPE_V64: + case TCG_TYPE_V128: + /* "VMOV D,N" is an alias for "VORR D,N,N". */ + tcg_out_vreg3(s, INSN_VORR, type - TCG_TYPE_V64, 0, ret, arg, arg); + return true; + + default: + g_assert_not_reached(); + } } -static inline void tcg_out_movi(TCGContext *s, TCGType type, - TCGReg ret, tcg_target_long arg) +static void tcg_out_movi(TCGContext *s, TCGType type, + TCGReg ret, tcg_target_long arg) { + tcg_debug_assert(type == TCG_TYPE_I32); + tcg_debug_assert(ret < TCG_REG_Q0); tcg_out_movi32(s, COND_AL, ret, arg); } From patchwork Fri Jun 4 20:12:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454160 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp726629jae; Fri, 4 Jun 2021 13:15:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQZgq0iQRttrpasRB0F5gTX7EIaF7c3FRVOJfjz5Sj5KGQmsQjvKHdl1bRrdqZzxYMX+su X-Received: by 2002:a05:6638:b84:: with SMTP id b4mr5503248jad.122.1622837702275; Fri, 04 Jun 2021 13:15:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837702; cv=none; d=google.com; s=arc-20160816; b=S5tmMwbgJ860QAF1xx3xHP9K5tlFal53bxVF/gElJlBg4kD4Q0pzIIF3t4Rt5Wa3nb 43eH/FTV3yEJ1dlDB00qkMiG8SgdCiFrVMGCSid4RY3UEl7JqnjAv8Y4mB6/5k6zSB2J XeHgVn3HBIyopXi+G4KSZBUn7ww92hhbmRR8x9yKhwspq7FekMSwFHL99r555JnkeqoJ eKDpkKzk4uYcL4bSer7GBLH/MfN7meqOXmHaSEN6DVleaCIXdZw8YVeZ8NcfVxztSU2l zeqHGufeZNu3GnmKqz9/8IslLFGhYEEKq/I8OM47D/rApLI42PRpBH6Im6cPmH65Oet2 szRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=MwMT4g661OuIuWUPCyqmD08NJzkdukWBX0Iri09MsUw=; b=sJEyCOCJ16Cc14AJek7ZlAMhXKGMRBaBT6krD9Qd6NsnbZxE4QcRNEpgCSbyhc5eR6 bI2LNkrOrbQBMOdQ3xYjLG2VPgxkZXrLvaaQ+mHmZQO07lukSONgOYJiD5sRhVNxHBZb S5FOHdT3l9JJcovF7fK6RM9QWGbMX2plAdfWNDMyDPTaEtp8VdF0A1urk42Uj0CVktHQ x5pJ11JIiczpSJIkHTzEAydvbihzOZkC5y+TxLe39m2aTMOKIGddLuFm4BGM3HHgyTOK dL23lRWaOZNFGYE/WEhe/trs+ZOdP3q8HO/pPq6XuYryQWy3gMsAPNvX6CvZAcvksh+f fAIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WbbC2a/C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q3si7782907ilu.88.2021.06.04.13.15.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:15:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="WbbC2a/C"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGDd-0003j9-EF for patch@linaro.org; Fri, 04 Jun 2021 16:15:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB2-0005nz-4a for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:20 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:55111) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAx-0005Il-DG for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:19 -0400 Received: by mail-pj1-x1032.google.com with SMTP id g24so6145527pji.4 for ; Fri, 04 Jun 2021 13:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MwMT4g661OuIuWUPCyqmD08NJzkdukWBX0Iri09MsUw=; b=WbbC2a/CLWBGu3MptnquopdL+ZUbSgUwAnPZ3a8xkL9poy3Q4OjEiLBTVZ6YL2yOis NFL2KeszDytg9e/fvr+lWPVfDCPXfDGaescPLVGcDGV3awXdwEbdbsI2iMVlMvB9yFv8 oOXwUKinr85bzlu0g4iSPff+tASjgOv3vIa/m6msLuJhJt7lDcR82T5cjFJignjLOqoW zN6t0cWwYS9r8WnKxJDS01B7b57m/Kz2YXt3eZbvOxCJlbEWVSis7NzYFeEid4JtuP9X 8ObvRr8CKF1spH9F4w1nkLUBgH2xPAVBHD1sce2R79MUG6O8Qc2kThblKJUJweh2/Pt5 XNnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MwMT4g661OuIuWUPCyqmD08NJzkdukWBX0Iri09MsUw=; b=m2C66MeHpanmkH7xbP/Kr2VUnkx47B9vQSby0+cB2YU6EyqHCcc18QgV+Onta1hoK5 ocyColz5aqAc8zciuG3YA7dJK0w/z8wAECncW6nN2jrJ3TO9XQ56rbDL9s8zvqilOuHc qwCOLu3QPy/TZAaQpv57R11v8+vgz8Li6ARm/iDSmW/SriYyWGYyLbPQpQsgVcu9N6bP wxSUstfSs/SUv4j+chFW0R//13jCLPJ5ooIRqi5/H8tgFAfKF20mpJHBN4TPmS5x0IXm +2kLSL1pPCpxduJRAYuXwX69aUMXugCdKViD5IrZCRUFByOkei+Ks8YnWmu6yWQ/tphk jSHg== X-Gm-Message-State: AOAM533rNqRuNqwjubiPV9TG4I7m67OAzkuIYG75BoyKMG0pHnk+AUpv t5aZo5TTdS1fpq1tiYHa4/pwJ3v7KMYB2A== X-Received: by 2002:a17:902:ec8e:b029:105:5ab8:609e with SMTP id x14-20020a170902ec8eb02901055ab8609emr6019007plg.55.1622837533947; Fri, 04 Jun 2021 13:12:13 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:13 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 05/15] tcg/arm: Implement tcg_out_dup*_vec Date: Fri, 4 Jun 2021 13:12:00 -0700 Message-Id: <20210604201210.920136-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Most of dupi is copied from tcg/aarch64, which has the same encoding for AdvSimdExpandImm. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 283 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 275 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index a802d4b585..1707214b46 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -175,8 +175,13 @@ typedef enum { INSN_VORR = 0xf2200110, + INSN_VDUP_G = 0xee800b10, /* VDUP (ARM core register) */ + INSN_VDUP_S = 0xf3b00c00, /* VDUP (scalar) */ + INSN_VLDR_D = 0xed100b00, /* VLDR.64 */ INSN_VLD1 = 0xf4200000, /* VLD1 (multiple single elements) */ + INSN_VLD1R = 0xf4a00c00, /* VLD1 (single element to all lanes) */ INSN_VST1 = 0xf4000000, /* VST1 (multiple single elements) */ + INSN_VMOVI = 0xf2800010, /* VMOV (immediate) */ } ARMInsn; #define INSN_NOP (use_armv7_instructions ? INSN_NOP_v6k : INSN_NOP_v4) @@ -195,6 +200,14 @@ static const uint8_t tcg_cond_to_arm_cond[] = { [TCG_COND_GTU] = COND_HI, }; +static int encode_imm(uint32_t imm); + +/* TCG private relocation type: add with pc+imm8 */ +#define R_ARM_PC8 11 + +/* TCG private relocation type: vldr with imm8 << 2 */ +#define R_ARM_PC11 12 + static bool reloc_pc24(tcg_insn_unit *src_rw, const tcg_insn_unit *target) { const tcg_insn_unit *src_rx = tcg_splitwx_to_rx(src_rw); @@ -226,16 +239,52 @@ static bool reloc_pc13(tcg_insn_unit *src_rw, const tcg_insn_unit *target) return false; } +static bool reloc_pc11(tcg_insn_unit *src_rw, const tcg_insn_unit *target) +{ + const tcg_insn_unit *src_rx = tcg_splitwx_to_rx(src_rw); + ptrdiff_t offset = (tcg_ptr_byte_diff(target, src_rx) - 8) / 4; + + if (offset >= -0xff && offset <= 0xff) { + tcg_insn_unit insn = *src_rw; + bool u = (offset >= 0); + if (!u) { + offset = -offset; + } + insn = deposit32(insn, 23, 1, u); + insn = deposit32(insn, 0, 8, offset); + *src_rw = insn; + return true; + } + return false; +} + +static bool reloc_pc8(tcg_insn_unit *src_rw, const tcg_insn_unit *target) +{ + const tcg_insn_unit *src_rx = tcg_splitwx_to_rx(src_rw); + ptrdiff_t offset = tcg_ptr_byte_diff(target, src_rx) - 8; + int rot = encode_imm(offset); + + if (rot >= 0) { + *src_rw = deposit32(*src_rw, 0, 12, rol32(offset, rot) | (rot << 7)); + return true; + } + return false; +} + static bool patch_reloc(tcg_insn_unit *code_ptr, int type, intptr_t value, intptr_t addend) { tcg_debug_assert(addend == 0); - - if (type == R_ARM_PC24) { + switch (type) { + case R_ARM_PC24: return reloc_pc24(code_ptr, (const tcg_insn_unit *)value); - } else if (type == R_ARM_PC13) { + case R_ARM_PC13: return reloc_pc13(code_ptr, (const tcg_insn_unit *)value); - } else { + case R_ARM_PC11: + return reloc_pc11(code_ptr, (const tcg_insn_unit *)value); + case R_ARM_PC8: + return reloc_pc8(code_ptr, (const tcg_insn_unit *)value); + default: g_assert_not_reached(); } } @@ -275,7 +324,7 @@ static inline uint32_t rotl(uint32_t val, int n) /* ARM immediates for ALU instructions are made of an unsigned 8-bit right-rotated by an even amount between 0 and 30. */ -static inline int encode_imm(uint32_t imm) +static int encode_imm(uint32_t imm) { int shift; @@ -302,6 +351,79 @@ static inline int check_fit_imm(uint32_t imm) return encode_imm(imm) >= 0; } +/* Return true if v16 is a valid 16-bit shifted immediate. */ +static bool is_shimm16(uint16_t v16, int *cmode, int *imm8) +{ + if (v16 == (v16 & 0xff)) { + *cmode = 0x8; + *imm8 = v16 & 0xff; + return true; + } else if (v16 == (v16 & 0xff00)) { + *cmode = 0xa; + *imm8 = v16 >> 8; + return true; + } + return false; +} + +/* Return true if v32 is a valid 32-bit shifted immediate. */ +static bool is_shimm32(uint32_t v32, int *cmode, int *imm8) +{ + if (v32 == (v32 & 0xff)) { + *cmode = 0x0; + *imm8 = v32 & 0xff; + return true; + } else if (v32 == (v32 & 0xff00)) { + *cmode = 0x2; + *imm8 = (v32 >> 8) & 0xff; + return true; + } else if (v32 == (v32 & 0xff0000)) { + *cmode = 0x4; + *imm8 = (v32 >> 16) & 0xff; + return true; + } else if (v32 == (v32 & 0xff000000)) { + *cmode = 0x6; + *imm8 = v32 >> 24; + return true; + } + return false; +} + +/* Return true if v32 is a valid 32-bit shifting ones immediate. */ +static bool is_soimm32(uint32_t v32, int *cmode, int *imm8) +{ + if ((v32 & 0xffff00ff) == 0xff) { + *cmode = 0xc; + *imm8 = (v32 >> 8) & 0xff; + return true; + } else if ((v32 & 0xff00ffff) == 0xffff) { + *cmode = 0xd; + *imm8 = (v32 >> 16) & 0xff; + return true; + } + return false; +} + +/* + * Return non-zero if v32 can be formed by MOVI+ORR. + * Place the parameters for MOVI in (cmode, imm8). + * Return the cmode for ORR; the imm8 can be had via extraction from v32. + */ +static int is_shimm32_pair(uint32_t v32, int *cmode, int *imm8) +{ + int i; + + for (i = 6; i > 0; i -= 2) { + /* Mask out one byte we can add with ORR. */ + uint32_t tmp = v32 & ~(0xffu << (i * 4)); + if (is_shimm32(tmp, cmode, imm8) || + is_soimm32(tmp, cmode, imm8)) { + break; + } + } + return i; +} + /* Test if a constant matches the constraint. * TODO: define constraints for: * @@ -1127,6 +1249,15 @@ static void tcg_out_vreg3(TCGContext *s, ARMInsn insn, int q, int vece, encode_vd(d) | encode_vn(n) | encode_vm(m)); } +static void tcg_out_vmovi(TCGContext *s, TCGReg rd, + int q, int op, int cmode, uint8_t imm8) +{ + tcg_out32(s, INSN_VMOVI | encode_vd(rd) | (q << 6) | (op << 5) + | (cmode << 8) | extract32(imm8, 0, 4) + | (extract32(imm8, 4, 3) << 16) + | (extract32(imm8, 7, 1) << 24)); +} + static void tcg_out_vldst(TCGContext *s, ARMInsn insn, TCGReg rd, TCGReg rn, int offset) { @@ -2329,22 +2460,158 @@ static void tcg_out_movi(TCGContext *s, TCGType type, tcg_out_movi32(s, COND_AL, ret, arg); } +/* Type is always V128, with I64 elements. */ +static void tcg_out_dup2_vec(TCGContext *s, TCGReg rd, TCGReg rl, TCGReg rh) +{ + /* Move high element into place first. */ + /* VMOV Dd+1, Ds */ + tcg_out_vreg3(s, INSN_VORR | (1 << 12), 0, 0, rd, rh, rh); + /* Move low element into place; tcg_out_mov will check for nop. */ + tcg_out_mov(s, TCG_TYPE_V64, rd, rl); +} + static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg rd, TCGReg rs) { - g_assert_not_reached(); + int q = type - TCG_TYPE_V64; + + if (vece == MO_64) { + if (type == TCG_TYPE_V128) { + tcg_out_dup2_vec(s, rd, rs, rs); + } else { + tcg_out_mov(s, TCG_TYPE_V64, rd, rs); + } + } else if (rs < TCG_REG_Q0) { + int b = (vece == MO_8); + int e = (vece == MO_16); + tcg_out32(s, INSN_VDUP_G | (b << 22) | (q << 21) | (e << 5) | + encode_vn(rd) | (rs << 12)); + } else { + int imm4 = 1 << vece; + tcg_out32(s, INSN_VDUP_S | (imm4 << 16) | (q << 6) | + encode_vd(rd) | encode_vm(rs)); + } + return true; } static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg rd, TCGReg base, intptr_t offset) { - g_assert_not_reached(); + if (vece == MO_64) { + tcg_out_ld(s, TCG_TYPE_V64, rd, base, offset); + if (type == TCG_TYPE_V128) { + tcg_out_dup2_vec(s, rd, rd, rd); + } + } else { + int q = type - TCG_TYPE_V64; + tcg_out_vldst(s, INSN_VLD1R | (vece << 6) | (q << 5), + rd, base, offset); + } + return true; } static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg rd, int64_t v64) { - g_assert_not_reached(); + int q = type - TCG_TYPE_V64; + int cmode, imm8, i; + + /* Test all bytes equal first. */ + if (vece == MO_8) { + tcg_out_vmovi(s, rd, q, 0, 0xe, v64); + return; + } + + /* + * Test all bytes 0x00 or 0xff second. This can match cases that + * might otherwise take 2 or 3 insns for MO_16 or MO_32 below. + */ + for (i = imm8 = 0; i < 8; i++) { + uint8_t byte = v64 >> (i * 8); + if (byte == 0xff) { + imm8 |= 1 << i; + } else if (byte != 0) { + goto fail_bytes; + } + } + tcg_out_vmovi(s, rd, q, 1, 0xe, imm8); + return; + fail_bytes: + + /* + * Tests for various replications. For each element width, if we + * cannot find an expansion there's no point checking a larger + * width because we already know by replication it cannot match. + */ + if (vece == MO_16) { + uint16_t v16 = v64; + + if (is_shimm16(v16, &cmode, &imm8)) { + tcg_out_vmovi(s, rd, q, 0, cmode, imm8); + return; + } + if (is_shimm16(~v16, &cmode, &imm8)) { + tcg_out_vmovi(s, rd, q, 1, cmode, imm8); + return; + } + + /* + * Otherwise, all remaining constants can be loaded in two insns: + * rd = v16 & 0xff, rd |= v16 & 0xff00. + */ + tcg_out_vmovi(s, rd, q, 0, 0x8, v16 & 0xff); + tcg_out_vmovi(s, rd, q, 0, 0xb, v16 >> 8); /* VORRI */ + return; + } + + if (vece == MO_32) { + uint32_t v32 = v64; + + if (is_shimm32(v32, &cmode, &imm8) || + is_soimm32(v32, &cmode, &imm8)) { + tcg_out_vmovi(s, rd, q, 0, cmode, imm8); + return; + } + if (is_shimm32(~v32, &cmode, &imm8) || + is_soimm32(~v32, &cmode, &imm8)) { + tcg_out_vmovi(s, rd, q, 1, cmode, imm8); + return; + } + + /* + * Restrict the set of constants to those we can load with + * two instructions. Others we load from the pool. + */ + i = is_shimm32_pair(v32, &cmode, &imm8); + if (i) { + tcg_out_vmovi(s, rd, q, 0, cmode, imm8); + tcg_out_vmovi(s, rd, q, 0, i | 1, extract32(v32, i * 4, 8)); + return; + } + i = is_shimm32_pair(~v32, &cmode, &imm8); + if (i) { + tcg_out_vmovi(s, rd, q, 1, cmode, imm8); + tcg_out_vmovi(s, rd, q, 1, i | 1, extract32(~v32, i * 4, 8)); + return; + } + } + + /* + * As a last resort, load from the constant pool. + */ + if (!q || vece == MO_64) { + new_pool_l2(s, R_ARM_PC11, s->code_ptr, 0, v64, v64 >> 32); + /* VLDR Dd, [pc + offset] */ + tcg_out32(s, INSN_VLDR_D | encode_vd(rd) | (0xf << 16)); + if (q) { + tcg_out_dup2_vec(s, rd, rd, rd); + } + } else { + new_pool_label(s, (uint32_t)v64, R_ARM_PC8, s->code_ptr, 0); + /* add tmp, pc, offset */ + tcg_out_dat_imm(s, COND_AL, ARITH_ADD, TCG_REG_TMP, TCG_REG_PC, 0); + tcg_out_dupm_vec(s, type, MO_32, rd, TCG_REG_TMP, 0); + } } static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, From patchwork Fri Jun 4 20:12:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454161 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp726840jae; Fri, 4 Jun 2021 13:15:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSFudTYAlORqsI7MzUbGYfIWeoCuC+t32cJmjuy9y4XeRSD1DYKx5z4vugW3MZZJnxD0Pk X-Received: by 2002:a05:6638:11:: with SMTP id z17mr5479841jao.102.1622837724429; Fri, 04 Jun 2021 13:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837724; cv=none; d=google.com; s=arc-20160816; b=xrBQJh5SvdcEvg3xfZIBCdYrEDeZy+HrZnIZPwsf3KmBfVLWEfeQ/JObRzAbEJRcT5 U/OFu8Mc3w/++dbUPQFlX6eIUIk7JNfSm5Ihq8SzRqUi8jfyVb0JTcMEtVnfWZSfYMIB L9XgSAhnd/WYICbD8LSEkiq2x8iSD3rJzX9nqh/MLZdEe6Mu39I20I/q4Vm5eYt1CNDU OMikH7+wQ6tBf7MMKNH4D+Fc/pvzjQnDk7EmubmfVlDMX56+Qw7hWyVfUMWycxP4zx/c WXHVBVSbrmgYq52pgFHGmPMnZ6e4YrxTnRTfgavYL8kGpbZkHC0RFQiOiJsp7tNk2bLQ mh0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=LDlM422z5SO6k8OWgD29hM0sU+EvDSOzJI7eetHAmZg=; b=Fu9rxdczDB/JmLreWmN2xPRyBbFSWQoJM3rrnXGvwpcdYMyR9r5A1Yq8Un4T6enCEf 7aGwXpJkZ3xhtnvzg70bOIecbRp8IfvKCqM3aJkbGJvarTmx1aK6WS4gOv2x67oT9wwr A+ca6V0jynZ//2sSiGir8IWo9t26h6mTCr7Ay9G8gh4ID3p/4ndPTHZ1t5YrF65ZHkvn 1MvftFXaisG2ip2ll7ZC/JZbpV6fsG1Bqbn0dTKqMKj47V8BcNGRdmlgdUJQzhmeb+4h kDgpPkV+h916LV4zJlcDwBv79m2XNuPUXb+gToktyMaWUqisITyDIHNRKu1wQJYIgGvP hWVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fVC738h3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h6si1062157iow.71.2021.06.04.13.15.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:15:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fVC738h3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGDz-0004Ax-Qk for patch@linaro.org; Fri, 04 Jun 2021 16:15:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB0-0005hI-GB for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:18 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:38884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAx-0005JT-Ra for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:18 -0400 Received: by mail-pj1-x102f.google.com with SMTP id m13-20020a17090b068db02901656cc93a75so8072098pjz.3 for ; Fri, 04 Jun 2021 13:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LDlM422z5SO6k8OWgD29hM0sU+EvDSOzJI7eetHAmZg=; b=fVC738h3yskgRU02lvgZDySjiXucN9zVl23NJhdg3TpCi84oCFfKbtLKtXq4k7E3sT lCRH9vjwhqE/61FgSJhv0gy/XEWAA0xIwRoDPiUpBSSKikoqDBciq4oSbK4cnofH/8xp pMZa6Y0SxNCrjs/hfzLZotRSsQDoOOmm1KgwYbttwwfyd+avoUxbOEdKRAvoFI3P1jsI xPuy9DW0awqk6F0dibl1u5gkpnT41JnayaJy50IssiotXeGa7VXu05BaNrytgup40uQB IGoXAQkEF7D/ux/8aZl3x6bbwhyyKLuzIQFIBFvhvPC6ZQdCpycOCkgTXnUdqKfvAKK6 BBag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LDlM422z5SO6k8OWgD29hM0sU+EvDSOzJI7eetHAmZg=; b=Q/i5vetJMkuH3G/3c8Tk2Qffhy2TEzz7M2RNQOgk2yTpb6jdxM0vJTSmL7IUSmfwrN AiGnxR4QtOoOjNZOLj0TmvqOIv39d+jCnPHHlA0o53cGFrVt8qazRzQlfgjD1jnIzOo7 gBSKz6yfejfHqsC4Z9nNAyWqTDo07qKsgfyv20wycUcNIFeUEGN1LvhKPXjhQezchdDi tVm3JcfIsMQ8YVHhRY+IHpoYfB13Mat2g88xjw43UFaKlbofdxPfuyhf/zDigOKCOQUa 9EAoLedS8iz3qB+MD+VDWX1EX6dSasUmSCSTtzU96UNEuDHvoASJRKzwnOpcSHOpx10X ei0A== X-Gm-Message-State: AOAM5305LPk5OfBXT8zZA8xtmUh2WG8ad5rrcVH5TJiCyu/5+dyBOJME 4Cf9CPdzhl/BikMT2QiLeMwxuZBFVz91rg== X-Received: by 2002:a17:90a:4dc1:: with SMTP id r1mr6677590pjl.192.1622837534564; Fri, 04 Jun 2021 13:12:14 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 06/15] tcg/arm: Implement minimal vector operations Date: Fri, 4 Jun 2021 13:12:01 -0700 Message-Id: <20210604201210.920136-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Implementing dup2, add, sub, and, or, xor as the minimal set. This allows us to actually enable neon in the header file. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-con-set.h | 3 + tcg/arm/tcg-target-con-str.h | 2 + tcg/arm/tcg-target.h | 6 +- tcg/arm/tcg-target.c.inc | 201 +++++++++++++++++++++++++++++++++-- 4 files changed, 204 insertions(+), 8 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target-con-set.h b/tcg/arm/tcg-target-con-set.h index 27aced5391..f30b3900e0 100644 --- a/tcg/arm/tcg-target-con-set.h +++ b/tcg/arm/tcg-target-con-set.h @@ -30,6 +30,9 @@ C_O1_I2(r, r, rIN) C_O1_I2(r, r, ri) C_O1_I2(r, rZ, rZ) C_O1_I2(w, w, w) +C_O1_I2(w, w, wO) +C_O1_I2(w, w, wV) +C_O1_I2(w, w, wZ) C_O1_I4(r, r, r, rI, rI) C_O1_I4(r, r, rIN, rIK, 0) C_O2_I1(r, r, l) diff --git a/tcg/arm/tcg-target-con-str.h b/tcg/arm/tcg-target-con-str.h index 255a1ae0e2..8f501149e1 100644 --- a/tcg/arm/tcg-target-con-str.h +++ b/tcg/arm/tcg-target-con-str.h @@ -20,4 +20,6 @@ REGS('w', ALL_VECTOR_REGS) CONST('I', TCG_CT_CONST_ARM) CONST('K', TCG_CT_CONST_INV) CONST('N', TCG_CT_CONST_NEG) +CONST('O', TCG_CT_CONST_ORRI) +CONST('V', TCG_CT_CONST_ANDI) CONST('Z', TCG_CT_CONST_ZERO) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index a9dc09bd08..48993636ea 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -107,7 +107,11 @@ typedef enum { #else extern bool use_idiv_instructions; #endif -#define use_neon_instructions 0 +#ifdef __ARM_NEON__ +#define use_neon_instructions 1 +#else +extern bool use_neon_instructions; +#endif /* used for function call generation */ #define TCG_TARGET_STACK_ALIGN 8 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 1707214b46..ab98fa1381 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -30,6 +30,9 @@ int arm_arch = __ARM_ARCH; #ifndef use_idiv_instructions bool use_idiv_instructions; #endif +#ifndef use_neon_instructions +bool use_neon_instructions; +#endif /* ??? Ought to think about changing CONFIG_SOFTMMU to always defined. */ #ifdef CONFIG_SOFTMMU @@ -173,7 +176,27 @@ typedef enum { /* Otherwise the assembler uses mov r0,r0 */ INSN_NOP_v4 = (COND_AL << 28) | ARITH_MOV, + INSN_VADD = 0xf2000800, + INSN_VAND = 0xf2000110, + INSN_VEOR = 0xf3000110, INSN_VORR = 0xf2200110, + INSN_VSUB = 0xf3000800, + + INSN_VMVN = 0xf3b00580, + + INSN_VCEQ0 = 0xf3b10100, + INSN_VCGT0 = 0xf3b10000, + INSN_VCGE0 = 0xf3b10080, + INSN_VCLE0 = 0xf3b10180, + INSN_VCLT0 = 0xf3b10200, + + INSN_VCEQ = 0xf3000810, + INSN_VCGE = 0xf2000310, + INSN_VCGT = 0xf2000300, + INSN_VCGE_U = 0xf3000310, + INSN_VCGT_U = 0xf3000300, + + INSN_VTST = 0xf2000810, INSN_VDUP_G = 0xee800b10, /* VDUP (ARM core register) */ INSN_VDUP_S = 0xf3b00c00, /* VDUP (scalar) */ @@ -293,6 +316,8 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type, #define TCG_CT_CONST_INV 0x200 #define TCG_CT_CONST_NEG 0x400 #define TCG_CT_CONST_ZERO 0x800 +#define TCG_CT_CONST_ORRI 0x1000 +#define TCG_CT_CONST_ANDI 0x2000 #define ALL_GENERAL_REGS 0xffffu #define ALL_VECTOR_REGS 0xffff0000u @@ -424,6 +449,16 @@ static int is_shimm32_pair(uint32_t v32, int *cmode, int *imm8) return i; } +/* Return true if V is a valid 16-bit or 32-bit shifted immediate. */ +static bool is_shimm1632(uint32_t v32, int *cmode, int *imm8) +{ + if (v32 == deposit32(v32, 16, 16, v32)) { + return is_shimm16(v32, cmode, imm8); + } else { + return is_shimm32(v32, cmode, imm8); + } +} + /* Test if a constant matches the constraint. * TODO: define constraints for: * @@ -444,9 +479,26 @@ static bool tcg_target_const_match(int64_t val, TCGType type, int ct) return 1; } else if ((ct & TCG_CT_CONST_ZERO) && val == 0) { return 1; - } else { - return 0; } + + switch (ct & (TCG_CT_CONST_ORRI | TCG_CT_CONST_ANDI)) { + case 0: + break; + case TCG_CT_CONST_ANDI: + val = ~val; + /* fallthru */ + case TCG_CT_CONST_ORRI: + if (val == deposit64(val, 32, 32, val)) { + int cmode, imm8; + return is_shimm1632(val, &cmode, &imm8); + } + break; + default: + /* Both bits should not be set for the same insn. */ + g_assert_not_reached(); + } + + return 0; } static inline void tcg_out_b(TCGContext *s, int cond, int32_t offset) @@ -1242,6 +1294,13 @@ static uint32_t encode_vm(TCGReg rm) return (extract32(rm, 3, 1) << 5) | (extract32(rm, 0, 3) << 1); } +static void tcg_out_vreg2(TCGContext *s, ARMInsn insn, int q, int vece, + TCGReg d, TCGReg m) +{ + tcg_out32(s, insn | (vece << 18) | (q << 6) | + encode_vd(d) | encode_vm(m)); +} + static void tcg_out_vreg3(TCGContext *s, ARMInsn insn, int q, int vece, TCGReg d, TCGReg n, TCGReg m) { @@ -2314,10 +2373,13 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_add_vec: case INDEX_op_sub_vec: case INDEX_op_xor_vec: - case INDEX_op_or_vec: - case INDEX_op_and_vec: - case INDEX_op_cmp_vec: return C_O1_I2(w, w, w); + case INDEX_op_or_vec: + return C_O1_I2(w, w, wO); + case INDEX_op_and_vec: + return C_O1_I2(w, w, wV); + case INDEX_op_cmp_vec: + return C_O1_I2(w, w, wZ); default: g_assert_not_reached(); @@ -2614,16 +2676,141 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, unsigned vece, } } +static const ARMInsn vec_cmp_insn[16] = { + [TCG_COND_EQ] = INSN_VCEQ, + [TCG_COND_GT] = INSN_VCGT, + [TCG_COND_GE] = INSN_VCGE, + [TCG_COND_GTU] = INSN_VCGT_U, + [TCG_COND_GEU] = INSN_VCGE_U, +}; + +static const ARMInsn vec_cmp0_insn[16] = { + [TCG_COND_EQ] = INSN_VCEQ0, + [TCG_COND_GT] = INSN_VCGT0, + [TCG_COND_GE] = INSN_VCGE0, + [TCG_COND_LT] = INSN_VCLT0, + [TCG_COND_LE] = INSN_VCLE0, +}; + static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl, unsigned vece, const TCGArg *args, const int *const_args) { - g_assert_not_reached(); + TCGType type = vecl + TCG_TYPE_V64; + unsigned q = vecl; + TCGArg a0, a1, a2; + int cmode, imm8; + + a0 = args[0]; + a1 = args[1]; + a2 = args[2]; + + switch (opc) { + case INDEX_op_ld_vec: + tcg_out_ld(s, type, a0, a1, a2); + return; + case INDEX_op_st_vec: + tcg_out_st(s, type, a0, a1, a2); + return; + case INDEX_op_dupm_vec: + tcg_out_dupm_vec(s, type, vece, a0, a1, a2); + return; + case INDEX_op_dup2_vec: + tcg_out_dup2_vec(s, a0, a1, a2); + return; + case INDEX_op_add_vec: + tcg_out_vreg3(s, INSN_VADD, q, vece, a0, a1, a2); + return; + case INDEX_op_sub_vec: + tcg_out_vreg3(s, INSN_VSUB, q, vece, a0, a1, a2); + return; + case INDEX_op_xor_vec: + tcg_out_vreg3(s, INSN_VEOR, q, 0, a0, a1, a2); + return; + + case INDEX_op_and_vec: + if (const_args[2]) { + is_shimm1632(~a2, &cmode, &imm8); + if (a0 == a1) { + tcg_out_vmovi(s, a0, q, 1, cmode | 1, imm8); /* VBICI */ + return; + } + tcg_out_vmovi(s, a0, q, 1, cmode, imm8); /* VMVNI */ + a2 = a0; + } + tcg_out_vreg3(s, INSN_VAND, q, 0, a0, a1, a2); + return; + + case INDEX_op_or_vec: + if (const_args[2]) { + is_shimm1632(a2, &cmode, &imm8); + if (a0 == a1) { + tcg_out_vmovi(s, a0, q, 0, cmode | 1, imm8); /* VORRI */ + return; + } + tcg_out_vmovi(s, a0, q, 0, cmode, imm8); /* VMOVI */ + a2 = a0; + } + tcg_out_vreg3(s, INSN_VORR, q, 0, a0, a1, a2); + return; + + case INDEX_op_cmp_vec: + { + TCGCond cond = args[3]; + + if (cond == TCG_COND_NE) { + if (const_args[2]) { + tcg_out_vreg3(s, INSN_VTST, q, vece, a0, a1, a1); + } else { + tcg_out_vreg3(s, INSN_VCEQ, q, vece, a0, a1, a2); + tcg_out_vreg2(s, INSN_VMVN, q, 0, a0, a0); + } + } else { + ARMInsn insn; + + if (const_args[2]) { + insn = vec_cmp0_insn[cond]; + if (insn) { + tcg_out_vreg2(s, insn, q, vece, a0, a1); + return; + } + tcg_out_dupi_vec(s, type, MO_8, TCG_VEC_TMP, 0); + a2 = TCG_VEC_TMP; + } + insn = vec_cmp_insn[cond]; + if (insn == 0) { + TCGArg t; + t = a1, a1 = a2, a2 = t; + cond = tcg_swap_cond(cond); + insn = vec_cmp_insn[cond]; + tcg_debug_assert(insn != 0); + } + tcg_out_vreg3(s, insn, q, vece, a0, a1, a2); + } + } + return; + + case INDEX_op_mov_vec: /* Always emitted via tcg_out_mov. */ + case INDEX_op_dup_vec: /* Always emitted via tcg_out_dup_vec. */ + default: + g_assert_not_reached(); + } } int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) { - return 0; + switch (opc) { + case INDEX_op_add_vec: + case INDEX_op_sub_vec: + case INDEX_op_and_vec: + case INDEX_op_or_vec: + case INDEX_op_xor_vec: + return 1; + case INDEX_op_cmp_vec: + return vece < MO_64; + default: + return 0; + } } void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, From patchwork Fri Jun 4 20:12:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454163 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp728027jae; Fri, 4 Jun 2021 13:17:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAHIt5gi0W+uVH2yr43RRW/byc1ol0YVzDDoVAIDm1tQXnGkKtdBYiGq3QayWeZh48RxvV X-Received: by 2002:a5d:94d5:: with SMTP id y21mr5202861ior.110.1622837846651; Fri, 04 Jun 2021 13:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837846; cv=none; d=google.com; s=arc-20160816; b=rh44SwehBy+SFsm24qg5h+TvJK0rKR/qV8xXN8d736QDHU6DIkW/RA1+zOT3qjUA5A ds31WOeWC5LcBml5zQa3707CPI7gHdc8sfLQtuGy0wBxs1KPM2dg2or4pxfi7SHJa6nR ROK1ynJ9z9ZAMMGIYEGyhnuMSlpJkJdQl646Q4Ao5LZQeDK1yk8nICj3KbOQEzuBbcsy hIx1v/RtdeJOSkDMYpGXu96/W2r2Q68K67gvWbIr0VGgFj75jl1ek5/qEB42W8Fn7N/Y MpHoNLvBzEcppfTVQzp3VESeN0dJSmRqZ6CpJVj5LeuPWOKSP66wdhoP3RF5vU2X2tKv RBYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=cKgVv+rtw4u2zZTA0Jt80fDcSryskqJxy9a7wDy5O70=; b=nzzXPiJpvVXQS3Xito+aVxGlNaEIl9l5eRwZDIwNfBHGen7WDJnDgKZ/PACvlgkZnv Hxdwy73NoCVgv8GBJgwNpGiCIc3QONI0AIXd4NdyiP74xUWEhm7zRqFGwN93OW1aRwWT kLboUmpsTknY95O1QVA4lfqpndQoH5lKxkiCPOmbIwZjja6uWM8FwU2PFFGcANa2b/Sj 9h3s7tiK7fgofl4sj766FDUZLdRA9mDF68wbmpwoUCbu+KMOjRqyhvM775qXyj5+yt5O rbQNILtJ7QeN4GoL0qdMOskaMckO7nf+X6iR77pg1lAc3ny3oRKStblNYUEaaBt8mLmA GwRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HO5aPrAz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b5si8309633ile.22.2021.06.04.13.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:17:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HO5aPrAz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGFx-0001aS-UA for patch@linaro.org; Fri, 04 Jun 2021 16:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB1-0005kh-JQ for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:19 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:34520) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAy-0005KE-Dv for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:19 -0400 Received: by mail-pl1-x629.google.com with SMTP id u9so5156395plr.1 for ; Fri, 04 Jun 2021 13:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cKgVv+rtw4u2zZTA0Jt80fDcSryskqJxy9a7wDy5O70=; b=HO5aPrAz5/pjUjRa8aRqaLynfZ5f6wwIrI+Hoy6fVH8afZ72h6UrsufU0PMRxs0p8i z+H2Mi8X/FZfe/7Z0kGEby98I0j+Getiji2mlH9+sptmbZbSllX2RZgssgUqXy/Tthwn bAk9tbCXha+CX+DUzLO1ASH7kY7cSaKJxo7QnO+a+DX9DarOBtawfPQ2/KdT+UmK5E3l /t4Dudit1N/L9I/Ek7oZv/XbFY9C5q40YmoPy3WMb4QH5ZZ9rfqc/b2d6nah7i2yALnx 3Lm6rG9hzwQ0zm6jJIwZmV7PPxyYVghzghytyOvXisCngbhVEliPoUUK7Dk+TuBZqbaD b7nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cKgVv+rtw4u2zZTA0Jt80fDcSryskqJxy9a7wDy5O70=; b=Yu0/irCKl8WhGMbTeMrz8uEImXoqAXT10/a+Fhc/9BlT2m2SERXrBr7dS+7t7oC2am +m9gO6eIXsF9vM2l+hhTRQzdSeS6eKcC3sEzI+R/yy6SiG/ptT2QCkcWxA7DBv4V6ble zevKPT9jWYwMr9JSjScHWBQGQdayniFQaoSBKq+MPJII1N74I66J4Jo1Mr9R5qDRE6p0 d1s0nW/OoYC+st7Da9FodLGX3BgrGGTj7+H/BWxHhKpJYX2H8HPZ34yEj8bT2RWmpZhj ZSZ/WQLJo1BWF3ILh7DhMpB+l+XAK6b4yRW0MYcR60QIatr5abXgwO+h+ZPphd07UX2e YjBg== X-Gm-Message-State: AOAM533U+dwnWqJRDBcrzd2bxfGNW2JpIxpZi3/A2s8eCCBzppikANKR o8XfoEjrEYM6ypoDJN68DrZIMvnBwhnHRg== X-Received: by 2002:a17:90a:b294:: with SMTP id c20mr18382827pjr.236.1622837535159; Fri, 04 Jun 2021 13:12:15 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 07/15] tcg/arm: Implement andc, orc, abs, neg, not vector operations Date: Fri, 4 Jun 2021 13:12:02 -0700 Message-Id: <20210604201210.920136-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These logical and arithmetic operations are optional, but are trivial to accomplish with the existing infrastructure. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-con-set.h | 1 + tcg/arm/tcg-target.h | 10 +++++----- tcg/arm/tcg-target.c.inc | 38 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target-con-set.h b/tcg/arm/tcg-target-con-set.h index f30b3900e0..cc006f99cd 100644 --- a/tcg/arm/tcg-target-con-set.h +++ b/tcg/arm/tcg-target-con-set.h @@ -20,6 +20,7 @@ C_O0_I4(s, s, s, s) C_O1_I1(r, l) C_O1_I1(r, r) C_O1_I1(w, r) +C_O1_I1(w, w) C_O1_I1(w, wr) C_O1_I2(r, 0, rZ) C_O1_I2(r, l, l) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 48993636ea..6ac9fc6b9b 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -155,11 +155,11 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_v128 use_neon_instructions #define TCG_TARGET_HAS_v256 0 -#define TCG_TARGET_HAS_andc_vec 0 -#define TCG_TARGET_HAS_orc_vec 0 -#define TCG_TARGET_HAS_not_vec 0 -#define TCG_TARGET_HAS_neg_vec 0 -#define TCG_TARGET_HAS_abs_vec 0 +#define TCG_TARGET_HAS_andc_vec 1 +#define TCG_TARGET_HAS_orc_vec 1 +#define TCG_TARGET_HAS_not_vec 1 +#define TCG_TARGET_HAS_neg_vec 1 +#define TCG_TARGET_HAS_abs_vec 1 #define TCG_TARGET_HAS_roti_vec 0 #define TCG_TARGET_HAS_rots_vec 0 #define TCG_TARGET_HAS_rotv_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index ab98fa1381..2286e0aa09 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -178,11 +178,15 @@ typedef enum { INSN_VADD = 0xf2000800, INSN_VAND = 0xf2000110, + INSN_VBIC = 0xf2100110, INSN_VEOR = 0xf3000110, + INSN_VORN = 0xf2300110, INSN_VORR = 0xf2200110, INSN_VSUB = 0xf3000800, + INSN_VABS = 0xf3b10300, INSN_VMVN = 0xf3b00580, + INSN_VNEG = 0xf3b10380, INSN_VCEQ0 = 0xf3b10100, INSN_VCGT0 = 0xf3b10000, @@ -2369,14 +2373,20 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I1(w, r); case INDEX_op_dup_vec: return C_O1_I1(w, wr); + case INDEX_op_abs_vec: + case INDEX_op_neg_vec: + case INDEX_op_not_vec: + return C_O1_I1(w, w); case INDEX_op_dup2_vec: case INDEX_op_add_vec: case INDEX_op_sub_vec: case INDEX_op_xor_vec: return C_O1_I2(w, w, w); case INDEX_op_or_vec: + case INDEX_op_andc_vec: return C_O1_I2(w, w, wO); case INDEX_op_and_vec: + case INDEX_op_orc_vec: return C_O1_I2(w, w, wV); case INDEX_op_cmp_vec: return C_O1_I2(w, w, wZ); @@ -2718,6 +2728,15 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_dup2_vec: tcg_out_dup2_vec(s, a0, a1, a2); return; + case INDEX_op_abs_vec: + tcg_out_vreg2(s, INSN_VABS, q, vece, a0, a1); + return; + case INDEX_op_neg_vec: + tcg_out_vreg2(s, INSN_VNEG, q, vece, a0, a1); + return; + case INDEX_op_not_vec: + tcg_out_vreg2(s, INSN_VMVN, q, 0, a0, a1); + return; case INDEX_op_add_vec: tcg_out_vreg3(s, INSN_VADD, q, vece, a0, a1, a2); return; @@ -2728,6 +2747,13 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, tcg_out_vreg3(s, INSN_VEOR, q, 0, a0, a1, a2); return; + case INDEX_op_andc_vec: + if (!const_args[2]) { + tcg_out_vreg3(s, INSN_VBIC, q, 0, a0, a1, a2); + return; + } + a2 = ~a2; + /* fall through */ case INDEX_op_and_vec: if (const_args[2]) { is_shimm1632(~a2, &cmode, &imm8); @@ -2741,6 +2767,13 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, tcg_out_vreg3(s, INSN_VAND, q, 0, a0, a1, a2); return; + case INDEX_op_orc_vec: + if (!const_args[2]) { + tcg_out_vreg3(s, INSN_VORN, q, 0, a0, a1, a2); + return; + } + a2 = ~a2; + /* fall through */ case INDEX_op_or_vec: if (const_args[2]) { is_shimm1632(a2, &cmode, &imm8); @@ -2803,10 +2836,15 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_add_vec: case INDEX_op_sub_vec: case INDEX_op_and_vec: + case INDEX_op_andc_vec: case INDEX_op_or_vec: + case INDEX_op_orc_vec: case INDEX_op_xor_vec: + case INDEX_op_not_vec: return 1; + case INDEX_op_abs_vec: case INDEX_op_cmp_vec: + case INDEX_op_neg_vec: return vece < MO_64; default: return 0; From patchwork Fri Jun 4 20:12:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454159 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp726538jae; Fri, 4 Jun 2021 13:14:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOcujzqA9mxeIfdSLuQPmi9ss1i63Nmk1JHQVHYhSuK0FOX41PS+LWwWzSz1RF49W1lI2i X-Received: by 2002:a6b:7d03:: with SMTP id c3mr5350867ioq.2.1622837691803; Fri, 04 Jun 2021 13:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837691; cv=none; d=google.com; s=arc-20160816; b=ye3LkXD60U2UQL5XZp5glzSF10/0owy1Br9N/8J3rk8IZS7KrKqvYGDcKOX/wRlOVm WN3JBlapSti0XqCfJDqeQNDr6Ot5qW8Q66z/t/wynoNHXRO3uNE+TtcJRiitqK6kFduL 80ukwHM4eYZF+XZ2pE6dbwndmfZpzBiw/P+P28RS0feudygehxUjUEAUd3y1fc25DHju ofjTu4Cy3tHPTbTgnAR5TDIFqlbe+aq+ffG3/AJaw0RPQaMW3gmOdWYdHkt71UMfxFv6 u6vO+qELuwsDQMrzFVHSoCIKFHTLsjErNi0okmieZzW73bzlgzELdLbz06Sx4+nvjnRa iHcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=t8FC7U3mh7b5gil8pz0tCvspjOEtbOrrXBksja+JNWs=; b=gC564VA7iNMdUqK6zeXfPm5S3XkKPszc4JXfhvhCf9n8K59eVuOULmLAVUhlvQAzf2 x7dZiSyj5fAFIiM8O7U5xHD3qsjzLZeqlQKdCiR+UT7mNJn6OhD41bCUDqPAP2hkvg4+ qVBSspFINRZxPQM8zMATGO7ITcQJFm2OAFZM/6TIKxCcS+Iaj/+2mE+rFWiGCx+z/yoE /zdzVxbCD+0J/BtHMrU/OdnktsY9Z/wLAiotoWujlhR0VSUJuRhZpHRI3MySejr9yDa+ JXi6U7AFXT4ApRl6aFEX2fFIqdhcaadJH1ONRrnjPHOn+FZG70NUTHOQfAnA0OHYZkH2 WGeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YfC1mgZs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u4si7431257jak.4.2021.06.04.13.14.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:14:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YfC1mgZs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGDT-00034r-8Z for patch@linaro.org; Fri, 04 Jun 2021 16:14:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB1-0005j4-3J for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:19 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:38460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAy-0005Ku-W2 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:18 -0400 Received: by mail-pl1-x62d.google.com with SMTP id 69so5223401plc.5 for ; Fri, 04 Jun 2021 13:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t8FC7U3mh7b5gil8pz0tCvspjOEtbOrrXBksja+JNWs=; b=YfC1mgZs1PDpD+r2D81lpezdFbMd4tRzLZZqxihcocb6HwEveGq3N6f7Ee0d1A2lwN i4F2R3CIBzSaC+Oq2RUKeP4DyLXCLh+Zs0GndRwGrsKVzhF4M6BYvxHHZYxCXMM3nAOB YbH4laA+UNP61RaHlYMlzZWXACntmKC6J6j5bspUgXjVBa1+Oww1oioFBhWGWWgddHlK TA64sn2yjg+JqVTD4Vo1DoiQPm4d/3fT9p7HCT20YSw1lPn165dmiino/cBpM3Dz0/lk JTaJMVqknzFAnrqXe9ZWWdo3+Y6Fx0vGPTiaHZThmbr/u1MtfyqOWpcFF4NwnLyU42Xe VYTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t8FC7U3mh7b5gil8pz0tCvspjOEtbOrrXBksja+JNWs=; b=B0BaTTh/iUylYOmJK10z5ed3hHHUin12XKuYnj6ZCXJrM9miP0PwcOL/8OzKqVdGoG T8KYN8WCp0I89MRkouLudBQl4XXF5gsSD/AK+eCiQtAUgRyHxu6Sy8tE7azC2tSkx7+h cHtK8DAzZFiVG9/RmTPQgT5eQx1BfmVmCq4XvbwzK50kDm2lefWvmiUBF4h3aoRrqbXM pWU6Rv+a+g4nPsnn68l7l2B7A1sYZAEWiwaRAa9LaEUGE1L2SL5MX6CNpNhWKQDFZ/qB 5g7jqLOq34WmRcIbw2oaV5TuZlHX4BV29ISavyQeU7zinwtwLJEnxOS14I7QDmV1U4YI jHVg== X-Gm-Message-State: AOAM5335dXh/vZ098jaeGBv/4cqpSlj1SOtfZ0z2EumQjqMxWaagyYY6 GK6CGLDWqM015WNDM8rquEyCOF/eTEJp+Q== X-Received: by 2002:a17:90a:5b17:: with SMTP id o23mr6607177pji.14.1622837535805; Fri, 04 Jun 2021 13:12:15 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 08/15] tcg/arm: Implement TCG_TARGET_HAS_shi_vec Date: Fri, 4 Jun 2021 13:12:03 -0700 Message-Id: <20210604201210.920136-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This consists of the three immediate shifts: shli, shri, sari. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 6ac9fc6b9b..cfbadad72c 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -163,7 +163,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_roti_vec 0 #define TCG_TARGET_HAS_rots_vec 0 #define TCG_TARGET_HAS_rotv_vec 0 -#define TCG_TARGET_HAS_shi_vec 0 +#define TCG_TARGET_HAS_shi_vec 1 #define TCG_TARGET_HAS_shs_vec 0 #define TCG_TARGET_HAS_shv_vec 0 #define TCG_TARGET_HAS_mul_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 2286e0aa09..d21aaab6f7 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -200,6 +200,10 @@ typedef enum { INSN_VCGE_U = 0xf3000310, INSN_VCGT_U = 0xf3000300, + INSN_VSHLI = 0xf2800510, /* VSHL (immediate) */ + INSN_VSARI = 0xf2800010, /* VSHR.S */ + INSN_VSHRI = 0xf3800010, /* VSHR.U */ + INSN_VTST = 0xf2000810, INSN_VDUP_G = 0xee800b10, /* VDUP (ARM core register) */ @@ -1321,6 +1325,14 @@ static void tcg_out_vmovi(TCGContext *s, TCGReg rd, | (extract32(imm8, 7, 1) << 24)); } +static void tcg_out_vshifti(TCGContext *s, ARMInsn insn, int q, + TCGReg rd, TCGReg rm, int l_imm6) +{ + tcg_out32(s, insn | (q << 6) | encode_vd(rd) | encode_vm(rm) | + (extract32(l_imm6, 6, 1) << 7) | + (extract32(l_imm6, 0, 6) << 16)); +} + static void tcg_out_vldst(TCGContext *s, ARMInsn insn, TCGReg rd, TCGReg rn, int offset) { @@ -2376,6 +2388,9 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_abs_vec: case INDEX_op_neg_vec: case INDEX_op_not_vec: + case INDEX_op_shli_vec: + case INDEX_op_shri_vec: + case INDEX_op_sari_vec: return C_O1_I1(w, w); case INDEX_op_dup2_vec: case INDEX_op_add_vec: @@ -2746,6 +2761,15 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_xor_vec: tcg_out_vreg3(s, INSN_VEOR, q, 0, a0, a1, a2); return; + case INDEX_op_shli_vec: + tcg_out_vshifti(s, INSN_VSHLI, q, a0, a1, a2 + (8 << vece)); + return; + case INDEX_op_shri_vec: + tcg_out_vshifti(s, INSN_VSHRI, q, a0, a1, (16 << vece) - a2); + return; + case INDEX_op_sari_vec: + tcg_out_vshifti(s, INSN_VSARI, q, a0, a1, (16 << vece) - a2); + return; case INDEX_op_andc_vec: if (!const_args[2]) { @@ -2841,6 +2865,9 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_orc_vec: case INDEX_op_xor_vec: case INDEX_op_not_vec: + case INDEX_op_shli_vec: + case INDEX_op_shri_vec: + case INDEX_op_sari_vec: return 1; case INDEX_op_abs_vec: case INDEX_op_cmp_vec: From patchwork Fri Jun 4 20:12:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454164 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp728184jae; Fri, 4 Jun 2021 13:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF+7Q0+FFOu6RW8ugVLf3ENq2D/C82h5nLQd8dkOzFhrMDRMGmf+TGekfH+mBLp8bvanVi X-Received: by 2002:a92:dd89:: with SMTP id g9mr5470705iln.209.1622837862473; Fri, 04 Jun 2021 13:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837862; cv=none; d=google.com; s=arc-20160816; b=IQdwDMtJEnzpHdJ5uAkc2ABJb9yhCzwcvWq2RvTWX6xQ9DrQLecxMJxAoqK945rOgq gmbJflpHFLggMlXcfIg2qw7qpH3AcXZ0BeZGV+ysGY0lalnBsIx/jpMvNRyYgX5j5uo2 C0mQ/omwKheoRG0ZLXS0NGnlZS7YfrDqYd5iiZ3Uryfl+yG2WegWlVpYkCUJiEvCnQRo vqzhjTRyyj0MgNm/b0K7sbi/AAPiGYBIZ5/lY8XUyG0X4jDKwSEprBY3KLuox4AH4EFL h00d9pAYO0kbnAegIwBbVrBw2eYG4hxjl0wM7KIaQr8948MS1263mqoluLY7ggh7X9lI iJbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=E/xFspLGGmMrOSgKi+b5ozdnb0WY/ec8JsV2Fe/tYvQ=; b=VBUEdHFQCQ7WPnUIkme7SMBrsKvjOTX3C5R9WpyfhxwAJeRKaTLKgkYDDU2PCr819M c7zOuuZK46m+ZzYF2TRinHUvltvN6qKJxweo6J1E4XpBGNbBgKhgGZ5igTm0NtQ1Swnu ZH/9f5Neun8H/3X3ltuaEimXgWgUv9/E2lDl4xyB5IE8r++Q7qJVfnMefBnymhJyqnC5 KYZOCC+sK0uih7iozNZsLGgboYkc7izqXiQ7uZcWX3y/VccB37JQTYL6LNjVeyUzrhZ2 nlO2yTlLzrMcAOUqu2GXMZGa/6TudDyzc9vi04vcMpxNu8FdWvrClmZZPxnJn5v0SHVN YeZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czDZaoN5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g16si7953601jat.43.2021.06.04.13.17.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:17:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czDZaoN5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGGD-0000LR-U6 for patch@linaro.org; Fri, 04 Jun 2021 16:17:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB2-0005qu-Om for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:22 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:44545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGAz-0005L3-Jh for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:20 -0400 Received: by mail-pj1-x1036.google.com with SMTP id h12-20020a17090aa88cb029016400fd8ad8so6510079pjq.3 for ; Fri, 04 Jun 2021 13:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E/xFspLGGmMrOSgKi+b5ozdnb0WY/ec8JsV2Fe/tYvQ=; b=czDZaoN50Bdic6v/y4WhcxFavXDdkPA7MuOspwBC9LOjlL3zwDsMcCdieZoXszcumE 4B7Z1bENY/pnbp8/e+11H+8IUQXvi3AgFvQmnVU1uKhNgM2G/4FSmiDd0eEsBIwezKKh GWuTW+Ozgp7YvUITNJBujjjvxI9SGvQylWYBr9biJvh4aZ/a/5LDx5hPCOElN//UQ1Jk JLLryk+E/FQ3YKsVvzjfrTb62XLX4IXV1v/8FBk8bNgx4/969FrdYPGNo2g4innEoNLC P002iCHpnRjAfevc+4BDux46uyD9ecaEacJuHSobR1/3sALyramOybcWFUpru2ceetC2 xPdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/xFspLGGmMrOSgKi+b5ozdnb0WY/ec8JsV2Fe/tYvQ=; b=fcfTzYJU1zTKjUEhQnmG/vgwrAHinb+EE5cuFgoyXjNfH9BR3Z0QuBu5/7Ob5/evWW RZ7NYvlFbYM+54mZ8YSae92S9/CBRjrB/W2vPuf/yAMDjw702GK00kIW4nRu679lVsaU toRwXxrdi0XRc+GwnLu+EmX3UyyyPm7EdJdbw2VsOyk5RyLdAlCG3l0b8d1UEx66OTC7 UQHlC5BJsiU6bLvBfE0PsAGDJHZAqHyIroh3VR7g8xHIVl3um1csiSKthJnPbqF2b1RA +aBmFWn8D259VWyYVW2MNQ/wo1flCztut3pDMV4cN8Kf2NDKPDA0Ho6h1ey9gvt1TuFn m3Mg== X-Gm-Message-State: AOAM53107R6FS6A+sKGZLkH7ZAuIMuQ9RRIoCbFbs70ei7LKJodTE+W6 QqNPg0nM8ZwbaLGlJfesH5MK7TlozKqHMA== X-Received: by 2002:a17:90a:6e07:: with SMTP id b7mr18360065pjk.7.1622837536352; Fri, 04 Jun 2021 13:12:16 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 09/15] tcg/arm: Implement TCG_TARGET_HAS_mul_vec Date: Fri, 4 Jun 2021 13:12:04 -0700 Message-Id: <20210604201210.920136-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index cfbadad72c..94d768f249 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -166,7 +166,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_shi_vec 1 #define TCG_TARGET_HAS_shs_vec 0 #define TCG_TARGET_HAS_shv_vec 0 -#define TCG_TARGET_HAS_mul_vec 0 +#define TCG_TARGET_HAS_mul_vec 1 #define TCG_TARGET_HAS_sat_vec 0 #define TCG_TARGET_HAS_minmax_vec 0 #define TCG_TARGET_HAS_bitsel_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index d21aaab6f7..b94e6ed0f3 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -183,6 +183,7 @@ typedef enum { INSN_VORN = 0xf2300110, INSN_VORR = 0xf2200110, INSN_VSUB = 0xf3000800, + INSN_VMUL = 0xf2000910, INSN_VABS = 0xf3b10300, INSN_VMVN = 0xf3b00580, @@ -2394,6 +2395,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I1(w, w); case INDEX_op_dup2_vec: case INDEX_op_add_vec: + case INDEX_op_mul_vec: case INDEX_op_sub_vec: case INDEX_op_xor_vec: return C_O1_I2(w, w, w); @@ -2755,6 +2757,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_add_vec: tcg_out_vreg3(s, INSN_VADD, q, vece, a0, a1, a2); return; + case INDEX_op_mul_vec: + tcg_out_vreg3(s, INSN_VMUL, q, vece, a0, a1, a2); + return; case INDEX_op_sub_vec: tcg_out_vreg3(s, INSN_VSUB, q, vece, a0, a1, a2); return; @@ -2871,6 +2876,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) return 1; case INDEX_op_abs_vec: case INDEX_op_cmp_vec: + case INDEX_op_mul_vec: case INDEX_op_neg_vec: return vece < MO_64; default: From patchwork Fri Jun 4 20:12:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454165 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp728330jae; Fri, 4 Jun 2021 13:17:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdKC/Y7Cq2LkqpWBMe/HRbGSQAY1d6FzzD93yeXCKCYQxTXBk3mpY6/aKmCdPP389gBKEv X-Received: by 2002:a5e:c310:: with SMTP id a16mr5265412iok.21.1622837879285; Fri, 04 Jun 2021 13:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837879; cv=none; d=google.com; s=arc-20160816; b=IIccorS2qeGU9TJTz/zzKL7lHObP65AdOOh53JYsgd6ITuq1zOeuI+5QPF2l5xbzLn aoxVZK90feyssuduSOCq3eBiNxwSkG17NV09ar3OIDqHXGjSHP6V6Tusz74CJC0XyGpt rxHRPSUomcH30a8tea5OPaU9pLXnxvghyz85LDKXoGTsCjV5ordRxzuADCKJ2Lh2lQ3E RbRLKpkdzWVu7Cl/h8tUrGvRXTN3T8y81leHfjCvCVMdFhTpfIXCuMH3OJZ2Ua0IIJ8b KZyAW9POqTSyBr5QqEqWxggM39STXthx4Kt5kkG7F8H2Anz+11gXzs0Ggl3SCNHnK+TC hqkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+sAN0meenMh4DAuS0nymFIAbCzzpfLEfqhPYhd4qWa8=; b=ErckY/TPfG4ieSrW2iaZCZPjnnOYGM8OZSXqxQWGjpGMZ5sKYVXLmydJq5Y3zwHvCm Yprd2V0V8L1tMu4l+Ua0fCgGlw7iPrfNeguLY9hq1E1q1Cs5As6BymXQw9l6Ica97Hmu p2Cji63U2/aaQotevhrJpx1UuXcrdI6sabuyf1I77fEc9AIpRJKWUTcY1+xTTGJh7vZz n66BcNSz4IBvKy6S8LjnHz/DCBqfDMLmiuC4raKTz1Yhdd+BlNRmFXNnp0SonNpFd6AN ail3OOaZm+yYLzipRy+ItLoc8nMb0TWo654/XVZQL+0J+5+QJZRjesSM4HxjKIC05PQl ijmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zSmZSk3+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l21si7645454iow.25.2021.06.04.13.17.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:17:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zSmZSk3+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGGU-000173-Mq for patch@linaro.org; Fri, 04 Jun 2021 16:17:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB2-0005pP-EG for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:20 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:36702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB0-0005LH-9H for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:20 -0400 Received: by mail-pj1-x1035.google.com with SMTP id d5-20020a17090ab305b02901675357c371so7742459pjr.1 for ; Fri, 04 Jun 2021 13:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+sAN0meenMh4DAuS0nymFIAbCzzpfLEfqhPYhd4qWa8=; b=zSmZSk3+VlU2xz87ET02h8atbN2acT1Mzrztn0kQhaRfIlpHmNrMhbBajMfilXbbzr xRa0Cyp7B/PRCwvHfhjaaZVvcKh9Bbe1k2hWkeCeeNG0i6QKEy4evXiSJYunicGY3f7o pZJFsDlIuB3eMK8KwUEWHjkRm4Jucp41Q9f4TxCbeVUl7Cyrzo5O8VEDVlN4QXMBJPUj JzklFxBmPpAV0piO5h7giwGV0RZN+jTe8Z5EUtlkqyXqWSLDIQTguoqc/BpDzjtELaS/ Rd28CNW7BmBJ7ZyVZ2L7IYaM9Yf5jZQeOAindMvbVbNDgSADuxUxP7GITRqpnViNA0R3 geGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+sAN0meenMh4DAuS0nymFIAbCzzpfLEfqhPYhd4qWa8=; b=f8ixETvh7Lrxv98V0Vw9pi66ZqU6WWJ4eXXT2YEHJB6vwbpYbxNY5Ysq4AMxKvbIDg QiOiAn/gVfNRaVIhwUT2c+g5JsB01Vc9PHFbeRLzolOgNe8OupLHb34bbOyiYQXGVPDQ wgFIzJGGeYtfwhUOKWiZ7PrsiRzfETMMJgTETP0mxUGbk2nh5VCjqxxCGGY+vEJTnznt e7HftqNSxTMZb7TE8+0Ppk63aW2ackP8ShxGo5ICLVYmV/oEKWfPI34ON6fXTlRWr3O3 L8PKqC1hoNzegJs0cE1e04uhEHjRBqcrGrH/BEUowMN21zghuJ3qLMkPv3BSbj5/mvFv UCag== X-Gm-Message-State: AOAM531z+Ozaz6hX0o3+UQfZ3bDAyJ/RB8ZOSxTrUgZr9q0t0YOLHIKw rwLRNHzRpHi2w4DsmJG6W7DZrrA4+LfLMQ== X-Received: by 2002:a17:902:da8a:b029:f1:f2a1:cfe4 with SMTP id j10-20020a170902da8ab02900f1f2a1cfe4mr6015864plx.46.1622837536981; Fri, 04 Jun 2021 13:12:16 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 10/15] tcg/arm: Implement TCG_TARGET_HAS_sat_vec Date: Fri, 4 Jun 2021 13:12:05 -0700 Message-Id: <20210604201210.920136-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is saturating add and subtract, signed and unsigned. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 94d768f249..71621f28e9 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -167,7 +167,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_shs_vec 0 #define TCG_TARGET_HAS_shv_vec 0 #define TCG_TARGET_HAS_mul_vec 1 -#define TCG_TARGET_HAS_sat_vec 0 +#define TCG_TARGET_HAS_sat_vec 1 #define TCG_TARGET_HAS_minmax_vec 0 #define TCG_TARGET_HAS_bitsel_vec 0 #define TCG_TARGET_HAS_cmpsel_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index b94e6ed0f3..f0cfed7700 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -184,6 +184,10 @@ typedef enum { INSN_VORR = 0xf2200110, INSN_VSUB = 0xf3000800, INSN_VMUL = 0xf2000910, + INSN_VQADD = 0xf2000010, + INSN_VQADD_U = 0xf3000010, + INSN_VQSUB = 0xf2000210, + INSN_VQSUB_U = 0xf3000210, INSN_VABS = 0xf3b10300, INSN_VMVN = 0xf3b00580, @@ -2396,7 +2400,11 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_dup2_vec: case INDEX_op_add_vec: case INDEX_op_mul_vec: + case INDEX_op_ssadd_vec: + case INDEX_op_sssub_vec: case INDEX_op_sub_vec: + case INDEX_op_usadd_vec: + case INDEX_op_ussub_vec: case INDEX_op_xor_vec: return C_O1_I2(w, w, w); case INDEX_op_or_vec: @@ -2763,6 +2771,18 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_sub_vec: tcg_out_vreg3(s, INSN_VSUB, q, vece, a0, a1, a2); return; + case INDEX_op_ssadd_vec: + tcg_out_vreg3(s, INSN_VQADD, q, vece, a0, a1, a2); + return; + case INDEX_op_sssub_vec: + tcg_out_vreg3(s, INSN_VQSUB, q, vece, a0, a1, a2); + return; + case INDEX_op_usadd_vec: + tcg_out_vreg3(s, INSN_VQADD_U, q, vece, a0, a1, a2); + return; + case INDEX_op_ussub_vec: + tcg_out_vreg3(s, INSN_VQSUB_U, q, vece, a0, a1, a2); + return; case INDEX_op_xor_vec: tcg_out_vreg3(s, INSN_VEOR, q, 0, a0, a1, a2); return; @@ -2873,6 +2893,10 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_shli_vec: case INDEX_op_shri_vec: case INDEX_op_sari_vec: + case INDEX_op_ssadd_vec: + case INDEX_op_sssub_vec: + case INDEX_op_usadd_vec: + case INDEX_op_ussub_vec: return 1; case INDEX_op_abs_vec: case INDEX_op_cmp_vec: From patchwork Fri Jun 4 20:12:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454167 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp729224jae; Fri, 4 Jun 2021 13:19:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqU/9PHQzB8FihYbNYyiaCQQyRhES5cU2YcHh4wOhDR1YR57bIUMtxTmf5zycfBLEwWGJ0 X-Received: by 2002:a05:6e02:216b:: with SMTP id s11mr5472875ilv.267.1622837961385; Fri, 04 Jun 2021 13:19:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837961; cv=none; d=google.com; s=arc-20160816; b=qMp6JAh1+ejB+e0OAXqHur6XMdnMBulPxS9xyc3yjQtye90NUMJdaNiZvwZxsBh0ly oPcSumi3uffKG71qG/8EQtA92TLrGYeu1EGCNSr3GocOkZxXDHOEbFZDt64wo8nT3LNI 5wDL+nJTtZyExbV8T1QmQHuS4BBZE2ytGqQ1ZSpycTXdkfHGgZcu/07ivEKfT7UIz+wq 43xBe5oandy7mbRdMgNUy5YTi0tKX8u4m2pbKmhduolHPyHpi4luWKu9nBJy/C52hyDU vCWYeoqmPv8e04kgkSWx15fFPWcCS9W64EHlzNddEVIcJw8g8RBvwgT6ZHODbC82AMu1 uuvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=oE9WPeWzJzp1roD0xrVris7cr5AWOROn9KzKLGw6R8jQ9DL3jwCrZq08QmCxMI1tNJ 0WLAmUeC1kXsC9mmONSzvmwfCxf/ny9n8TVBwepGdmhxTdajpB5j2FSvpPlxc5JwLmce WCzGEKq3loGlU0dkORZyr58RmDPHbnhxhBS2FnjD1HW32JfNhuw7dayHtq7bhiO6rz5E ZE6kzQu3xX1mzplqvCkKS0qHjzDeDQm9rfa2Zax/rRtEbB6YFapNM2pZSwtYJGPOn1ge PCmfrHODW9X/TQCA18L/MtXxOv7x0+eIqzjPM1houpfUQJo2RFkTKpyku5AFYJP9CLc0 J6DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WHBuM6Y3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i19si7456566ilj.131.2021.06.04.13.19.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:19:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WHBuM6Y3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGHo-00061W-RA for patch@linaro.org; Fri, 04 Jun 2021 16:19:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB5-0005rK-Ng for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:24 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:40684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB0-0005LT-MW for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:23 -0400 Received: by mail-pl1-x629.google.com with SMTP id e7so5222221plj.7 for ; Fri, 04 Jun 2021 13:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=WHBuM6Y3pHT9kL5PVWkcFXqXpLgQaz8zHM0EHE1rNoMT/oiH2YDuQM8eeNjPlP1Jhd 2KN3RLIiNinC+Y4qj/nxi8A2n8xYHRmswy4dqJB2gfw3UfNqh5KngmFN5cWNjncFyw/S FCQOmZB2B+TUqILs+Y962hpFdWsAZpaj51zXI//BT7ArFjBaDt+pYE8ZH6IgVvd2zDlt jdPgKICL5J7LE/ksmN9CKx+jLGf6iDUiYIPHdeAY7Zd9tjccq7L4D6Po63BZYX1QY4AM isGWecP/RNPSyhUwqguHSvLziVGBkkWSbNkrDCp/ipv6Hz2l/uhVxS34lEPYfP2g1YML bQTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CxYpmIwPsuqyedl4XSakQYdgXzRY6daTbDUsC28Mn8E=; b=j1qypnEnMSGTtW3nAk6kYTB+Z9Rrt7tmRS+11QVOb/+52Q2QCmEebom+DD+0RWQGMi BmCUQyuLdslpUQE+JNrkk/DXwX7jfkSczfKHPmzqNDrPxOIvYbiNn/lZxF28pa0uF/WL 7VNgalTJfr/7p+c4tjuZp+DGBKOL8ZKvI4bES3kjA6fSkqeHl0pVJkT6/JDcUS2EgldO eWLaDeajFsFwoHrGBMbPUk0xH2NcT5GJCbIQne5loGvTwTq7LqVv088NaSl5fKVD4Azf FnmmC5ZyQjODw3fY5juP67XDjwIogtqmA4yfxQ5l82+Cml1Lap9hO1V/AaDiNkQAsuh7 E+2g== X-Gm-Message-State: AOAM533eGQbTtTXiXMLKrs2YQR+xQVnCTNYVe+TFZo5pHmwkc/GdQNU0 9sGToOXcPDC2jwojGk4lXLG+AGhHrxZWFQ== X-Received: by 2002:a17:90a:549:: with SMTP id h9mr19440686pjf.158.1622837537496; Fri, 04 Jun 2021 13:12:17 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 11/15] tcg/arm: Implement TCG_TARGET_HAS_minmax_vec Date: Fri, 4 Jun 2021 13:12:06 -0700 Message-Id: <20210604201210.920136-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is minimum and maximum, signed and unsigned. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 71621f28e9..4815a34e75 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -168,7 +168,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_shv_vec 0 #define TCG_TARGET_HAS_mul_vec 1 #define TCG_TARGET_HAS_sat_vec 1 -#define TCG_TARGET_HAS_minmax_vec 0 +#define TCG_TARGET_HAS_minmax_vec 1 #define TCG_TARGET_HAS_bitsel_vec 0 #define TCG_TARGET_HAS_cmpsel_vec 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index f0cfed7700..8193d768d6 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -188,6 +188,10 @@ typedef enum { INSN_VQADD_U = 0xf3000010, INSN_VQSUB = 0xf2000210, INSN_VQSUB_U = 0xf3000210, + INSN_VMAX = 0xf2000600, + INSN_VMAX_U = 0xf3000600, + INSN_VMIN = 0xf2000610, + INSN_VMIN_U = 0xf3000610, INSN_VABS = 0xf3b10300, INSN_VMVN = 0xf3b00580, @@ -2400,9 +2404,13 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_dup2_vec: case INDEX_op_add_vec: case INDEX_op_mul_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: case INDEX_op_ssadd_vec: case INDEX_op_sssub_vec: case INDEX_op_sub_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: case INDEX_op_xor_vec: @@ -2768,6 +2776,12 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_mul_vec: tcg_out_vreg3(s, INSN_VMUL, q, vece, a0, a1, a2); return; + case INDEX_op_smax_vec: + tcg_out_vreg3(s, INSN_VMAX, q, vece, a0, a1, a2); + return; + case INDEX_op_smin_vec: + tcg_out_vreg3(s, INSN_VMIN, q, vece, a0, a1, a2); + return; case INDEX_op_sub_vec: tcg_out_vreg3(s, INSN_VSUB, q, vece, a0, a1, a2); return; @@ -2777,6 +2791,12 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_sssub_vec: tcg_out_vreg3(s, INSN_VQSUB, q, vece, a0, a1, a2); return; + case INDEX_op_umax_vec: + tcg_out_vreg3(s, INSN_VMAX_U, q, vece, a0, a1, a2); + return; + case INDEX_op_umin_vec: + tcg_out_vreg3(s, INSN_VMIN_U, q, vece, a0, a1, a2); + return; case INDEX_op_usadd_vec: tcg_out_vreg3(s, INSN_VQADD_U, q, vece, a0, a1, a2); return; @@ -2902,6 +2922,10 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_cmp_vec: case INDEX_op_mul_vec: case INDEX_op_neg_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: return vece < MO_64; default: return 0; From patchwork Fri Jun 4 20:12:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454169 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp730323jae; Fri, 4 Jun 2021 13:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjxisIKay5SYfEWruUeToqbuJgBtWFhgaPxNP+9wiaR1+gajdK8JgrEkreQ6mdQ9mgdOn9 X-Received: by 2002:a92:cacb:: with SMTP id m11mr5138280ilq.133.1622838077526; Fri, 04 Jun 2021 13:21:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622838077; cv=none; d=google.com; s=arc-20160816; b=ZyLxsxyx1v3csQdyxmwWbIavgImeeMZB/+ew6GyBTEOCTcLKhEJJwU9bJWjRJgirO2 6jXPbH3wcgxHq/0iKIZPaVhfVJZzuF2z3GEldV/DI94/YzpxQpfB1x5Bv9HpNgPBHoaW d8h16MUQP5xYT3SvtC0qt+T+pPg8QnmJT91clZWcBBBhqA34jp4KAyvJH378N87ZaQr0 pUqO2Wa8BCt99ZJyf+FP3lBI25B/Vx6Euhz1JXULGts3qqKrwF6Z7HS+0QeoKKC1c+yU GUt/c4B2CWmF5rFZjndJUDs1Cx9J0aokteoaCv7synGwCGt8pow3I6fwMmTWa/ewUwSC XcsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=9jk5jd4GgRdQNaOXBNRlXkKpYthjcQtoi0Q/kjOejxw=; b=bKiM4aqQnWSjb0b7WgEaK31OKEV0QuOa5Y/Hg0r38DTU9jGBOArUC3Br8Q25/mFv95 8o5CgURYe+wwMEwB95k3m/jrfTa79vetpFRzseT3JxEj6HoARxufX6IgtxRi1N3kSpOG h1tZpEMgq/poD8jT+wAJb/cODPbvmTE8eWxZ2F8YTpbZGSGmrVylkU5pSZfycwDgBr/V uyr3xy047HyDOO4m8NTTZ4CT3HAMsA0cj6ZwnB6xM2Q1KA3+qB51FvYmj4NbAKDe+NXI lytpftc2N1zzgsKr2t+vJr2+u8NniYRqNOSVhReoEdVEV59oxpAlxTREk9HPQcsrCwHF AZtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6UYXJgC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d12si7642778jam.9.2021.06.04.13.21.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I6UYXJgC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGJg-0000of-VG for patch@linaro.org; Fri, 04 Jun 2021 16:21:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB3-0005r4-Uk for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:24 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]:44925) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB1-0005Lv-9a for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:21 -0400 Received: by mail-pg1-x531.google.com with SMTP id y11so589367pgp.11 for ; Fri, 04 Jun 2021 13:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9jk5jd4GgRdQNaOXBNRlXkKpYthjcQtoi0Q/kjOejxw=; b=I6UYXJgCKILvBtbJ06JeGEQFRAB0lQ3fHDh95lCi1pf8ZdfiTWMI3N4x47Lxyzn5R7 z7UuHUsamTwlnOoGXgTT+7y3u5o10cSRjV3IQpNjunnPR6LmFHukq8sQYQwTMA3OUSc3 FamcO+OYf80b3k8411oCnGqjXUtxAAxudUbPlV2VRYKpXRfhO8N1wEh4H3HZW8oiW2+l lRXetFhbKPllkL9L5LOYvXEoscBmi+DgJ1i2cB0hm3Ze3oyf97lXwip2c8gbwOvcfnvo 2htKh9PdYswy4cvp5U8rs2OJR9Sa2967y4ZkbulmD5dnamr3l4rsWZujP1mT47iEuo9g eMjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9jk5jd4GgRdQNaOXBNRlXkKpYthjcQtoi0Q/kjOejxw=; b=EE2ljZptK5gFDytJCs0m94Eoyb40cJ03IqzRgR/g2xGsvtNGn+rR/OPj5esrK4H63d 5FSK/y5D6oOfgyLyjQnqyHzc8200v6U3ss4vw0UxNbbTx5A8yM8uGPqZm0qUKCOJHHgC /TKjrECEoq19Z3ibb27NKvQYJWdScD+OvaudYzm4nwSorv/WI2fZe7EpI7n7bh3xpoVS 9l4xUOOMZnArtSy3P/NP+kc2doS0kVqPWKFVDfhmz882K0O0JGenFukAP+o78ZBRyrK+ IeMGF/TLmZmrzhNSGlyJltFcuZ5oRp71mmZQpsrLiV+/JQhfGqfb6WhdP8TE8Nhz+oYl fnAQ== X-Gm-Message-State: AOAM531zf3oUUGVb2XW+EKQrDoPV/jMyt6cnnFKS9W3MVtkGALZfr5Qj QzpocrRX7mpF/jyB02qNW6AVajLN9w+7nw== X-Received: by 2002:a62:784d:0:b029:2e9:a58e:8006 with SMTP id t74-20020a62784d0000b02902e9a58e8006mr5990838pfc.22.1622837537969; Fri, 04 Jun 2021 13:12:17 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/15] tcg/arm: Implement TCG_TARGET_HAS_bitsel_vec Date: Fri, 4 Jun 2021 13:12:07 -0700 Message-Id: <20210604201210.920136-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" NEON has 3 instructions implementing this 4 argument operation, with each insn overlapping a different logical input onto the destination register. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-con-set.h | 1 + tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target-con-set.h b/tcg/arm/tcg-target-con-set.h index cc006f99cd..d02797cbf4 100644 --- a/tcg/arm/tcg-target-con-set.h +++ b/tcg/arm/tcg-target-con-set.h @@ -34,6 +34,7 @@ C_O1_I2(w, w, w) C_O1_I2(w, w, wO) C_O1_I2(w, w, wV) C_O1_I2(w, w, wZ) +C_O1_I3(w, w, w, w) C_O1_I4(r, r, r, rI, rI) C_O1_I4(r, r, rIN, rIK, 0) C_O2_I1(r, r, l) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index 4815a34e75..d6222ba2db 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -169,7 +169,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_mul_vec 1 #define TCG_TARGET_HAS_sat_vec 1 #define TCG_TARGET_HAS_minmax_vec 1 -#define TCG_TARGET_HAS_bitsel_vec 0 +#define TCG_TARGET_HAS_bitsel_vec 1 #define TCG_TARGET_HAS_cmpsel_vec 0 #define TCG_TARGET_DEFAULT_MO (0) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 8193d768d6..3381240909 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -213,6 +213,10 @@ typedef enum { INSN_VSARI = 0xf2800010, /* VSHR.S */ INSN_VSHRI = 0xf3800010, /* VSHR.U */ + INSN_VBSL = 0xf3100110, + INSN_VBIT = 0xf3200110, + INSN_VBIF = 0xf3300110, + INSN_VTST = 0xf2000810, INSN_VDUP_G = 0xee800b10, /* VDUP (ARM core register) */ @@ -2423,7 +2427,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) return C_O1_I2(w, w, wV); case INDEX_op_cmp_vec: return C_O1_I2(w, w, wZ); - + case INDEX_op_bitsel_vec: + return C_O1_I3(w, w, w, w); default: g_assert_not_reached(); } @@ -2741,7 +2746,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, { TCGType type = vecl + TCG_TYPE_V64; unsigned q = vecl; - TCGArg a0, a1, a2; + TCGArg a0, a1, a2, a3; int cmode, imm8; a0 = args[0]; @@ -2892,6 +2897,18 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, } return; + case INDEX_op_bitsel_vec: + a3 = args[3]; + if (a0 == a3) { + tcg_out_vreg3(s, INSN_VBIT, q, 0, a0, a2, a1); + } else if (a0 == a2) { + tcg_out_vreg3(s, INSN_VBIF, q, 0, a0, a3, a1); + } else { + tcg_out_mov(s, type, a0, a1); + tcg_out_vreg3(s, INSN_VBSL, q, 0, a0, a2, a3); + } + return; + case INDEX_op_mov_vec: /* Always emitted via tcg_out_mov. */ case INDEX_op_dup_vec: /* Always emitted via tcg_out_dup_vec. */ default: @@ -2917,6 +2934,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_sssub_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: + case INDEX_op_bitsel_vec: return 1; case INDEX_op_abs_vec: case INDEX_op_cmp_vec: From patchwork Fri Jun 4 20:12:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454168 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp730024jae; Fri, 4 Jun 2021 13:20:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykAxwuvBhSevFLdsOF8nvxyNIN/Fvmyu8a2MUyBYh7osRA/BDRge8vCbc3k/KSnzLa1G2U X-Received: by 2002:a6b:c386:: with SMTP id t128mr5162505iof.65.1622838049036; Fri, 04 Jun 2021 13:20:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622838049; cv=none; d=google.com; s=arc-20160816; b=DTzG5Wwxoqm39Yn6pyRoDRD3veqWPc/jLgzom+7PcA9Pn2MImmtnPYDJi25VNAVDu+ QpergEOIt51El1BVUc9kH3JDKxma0T8ScH8MGnXPNJTmrUN++aK0tq/EVL5tJ5f7IQ3t huEX445qzIaYA5y+418v3YlHn+tdh3iS7g+xF9jIeMG8BsxGlPDAQebZxQuL+tw8pfdw 0d0eI8/12yeFmrPA9gb7jUXwaEPuqnNTO/3KLJznHIXeBtfsrBWS5DK1X7TnBGnDhvuX UT4/+i4OPsFCdOQGeJ8c+AXpoKJ0zC7rTMsxvnq2b3pi/MhS/6ktwiB5bsaAxewtnZ8m l75A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=tysDNxr3RlOzffJblVLQ9LvTmL2OC/WP8TwNOcJ9Me0=; b=g9ytrwI/okR5U/fTcxAOsQMg+UxPwigmg/5qPKSQ4V7TScYwuyryS9f92vnD76oZWF zAtQx/3xWImFYXPOl0PaL98jmWhhwSAz5N12Kw2SK38rVLk+MvPsx22U8bFMs0rEmEZF 0/uf/iShGpYvRNd7Djsgu7tsWjYc39mh8oCQNfclpN/VY5Kv0fECs5szed8pfTTdC+en VSnh8jXttM/oYGwfMpQFsihvGGA7QUdR+cN6/gbcbzz8f/GFWRG9kf0j2RpmvHbfuecC aJkiEk/alVVwXWbDavUSfgC+qTlzjDYxVQ/xx6aK0BEfMQFidcHUsHeeYYVzc0wPrEll Kd1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qt84AeD8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z11si8667948ioq.81.2021.06.04.13.20.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:20:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qt84AeD8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGJE-0000Rz-Cr for patch@linaro.org; Fri, 04 Jun 2021 16:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB7-0005tE-6h for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:26 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:46683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB1-0005MT-UB for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:24 -0400 Received: by mail-pf1-x434.google.com with SMTP id u126so4263490pfu.13 for ; Fri, 04 Jun 2021 13:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tysDNxr3RlOzffJblVLQ9LvTmL2OC/WP8TwNOcJ9Me0=; b=qt84AeD8zdYPo7kWzDIHcQQSPrsh2U9ruNB21xov7oa2abYjG1FHL37gUoL67z5Edh 6nFF760e6+i8knivVsKG8by/+geTmRPjuadEqBjg316lj9RkrMjkva5oMU3nKnF0geNs ZaE3kVKJmrOUW6yzEDsY5eFP8LjE8hwiHghIWG1DM3L8KRlhJU+LD1QffPNh8i3P8B+A tx5OujDQ/KLr0i2O0gJ/EkOrp1F4BihjdW1zcvBXBjETGC8L8vN1t/TeerpunhmXbM87 qpE4gr33aPITUSBahmFSgjMblzk8Sr0tdcgz16x9ic3jqc003SxeBPd3FcM6CKNk7tGk twxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tysDNxr3RlOzffJblVLQ9LvTmL2OC/WP8TwNOcJ9Me0=; b=l3Np3VrV37IeG69YD7F5IPuG6qcm287Gu5EIZ0HIwaSzILYMRuiuMskfFfVV+s9Ypw pIoZXQEWdNQCRqQ+F9qJXm0NsyNcobyY9+w+lS8B9mHS3I6qqQCBIpmQ4OYP+g0xW5Ln 71DZzy2caUJJtlcWepVOdA9yaraB1lcKUC2iT7G7Skd+zJ7k6BKJK5baF88bmOx0AYJF I7W1rCi0srXhREAh0Z6d/6k0csy6jvPHqGFUrBnFQKJSTcKblTitgmtL08FWcrBeJDBG mimyVLuvzqm1CLD9eiNrYojWO8OnHPwuMaKphvif9ts5cougjJXqBoVF3D8uAhX7Pf4e 6Muw== X-Gm-Message-State: AOAM532cZyrtWyK9aWLt1ev7rMLMytTIQHR00SWSgWTqddRyMRdB0CBB sXQ0Z4cyDaGcaQzWgcHse00SkndA0vGL9Q== X-Received: by 2002:a63:544e:: with SMTP id e14mr6706608pgm.256.1622837538627; Fri, 04 Jun 2021 13:12:18 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 13/15] tcg/arm: Implement TCG_TARGET_HAS_shv_vec Date: Fri, 4 Jun 2021 13:12:08 -0700 Message-Id: <20210604201210.920136-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The three vector shift by vector operations are all implemented via expansion. Therefore do not actually set TCG_TARGET_HAS_shv_vec, as none of shlv_vec, shrv_vec, sarv_vec may actually appear in the instruction stream, and therefore also do not appear in tcg_target_op_def. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.opc.h | 3 ++ tcg/arm/tcg-target.c.inc | 61 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.opc.h b/tcg/arm/tcg-target.opc.h index 7a4578e9b4..d19153dcb9 100644 --- a/tcg/arm/tcg-target.opc.h +++ b/tcg/arm/tcg-target.opc.h @@ -10,3 +10,6 @@ * emitted by tcg_expand_vec_op. For those familiar with GCC internals, * consider these to be UNSPEC with names. */ + +DEF(arm_sshl_vec, 1, 2, 0, IMPLVEC) +DEF(arm_ushl_vec, 1, 2, 0, IMPLVEC) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 3381240909..a6c7889d9f 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -212,6 +212,8 @@ typedef enum { INSN_VSHLI = 0xf2800510, /* VSHL (immediate) */ INSN_VSARI = 0xf2800010, /* VSHR.S */ INSN_VSHRI = 0xf3800010, /* VSHR.U */ + INSN_VSHL_S = 0xf2000400, /* VSHL.S (register) */ + INSN_VSHL_U = 0xf3000400, /* VSHL.U (register) */ INSN_VBSL = 0xf3100110, INSN_VBIT = 0xf3200110, @@ -2418,6 +2420,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: case INDEX_op_xor_vec: + case INDEX_op_arm_sshl_vec: + case INDEX_op_arm_ushl_vec: return C_O1_I2(w, w, w); case INDEX_op_or_vec: case INDEX_op_andc_vec: @@ -2811,6 +2815,17 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_xor_vec: tcg_out_vreg3(s, INSN_VEOR, q, 0, a0, a1, a2); return; + case INDEX_op_arm_sshl_vec: + /* + * Note that Vm is the data and Vn is the shift count, + * therefore the arguments appear reversed. + */ + tcg_out_vreg3(s, INSN_VSHL_S, q, vece, a0, a2, a1); + return; + case INDEX_op_arm_ushl_vec: + /* See above. */ + tcg_out_vreg3(s, INSN_VSHL_U, q, vece, a0, a2, a1); + return; case INDEX_op_shli_vec: tcg_out_vshifti(s, INSN_VSHLI, q, a0, a1, a2 + (8 << vece)); return; @@ -2945,6 +2960,10 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_umax_vec: case INDEX_op_umin_vec: return vece < MO_64; + case INDEX_op_shlv_vec: + case INDEX_op_shrv_vec: + case INDEX_op_sarv_vec: + return -1; default: return 0; } @@ -2953,7 +2972,47 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, TCGArg a0, ...) { - g_assert_not_reached(); + va_list va; + TCGv_vec v0, v1, v2, t1; + TCGArg a2; + + va_start(va, a0); + v0 = temp_tcgv_vec(arg_temp(a0)); + v1 = temp_tcgv_vec(arg_temp(va_arg(va, TCGArg))); + a2 = va_arg(va, TCGArg); + va_end(va); + + switch (opc) { + case INDEX_op_shlv_vec: + /* + * Merely propagate shlv_vec to arm_ushl_vec. + * In this way we don't set TCG_TARGET_HAS_shv_vec + * because everything is done via expansion. + */ + v2 = temp_tcgv_vec(arg_temp(a2)); + vec_gen_3(INDEX_op_arm_ushl_vec, type, vece, tcgv_vec_arg(v0), + tcgv_vec_arg(v1), tcgv_vec_arg(v2)); + break; + + case INDEX_op_shrv_vec: + case INDEX_op_sarv_vec: + /* Right shifts are negative left shifts for NEON. */ + v2 = temp_tcgv_vec(arg_temp(a2)); + t1 = tcg_temp_new_vec(type); + tcg_gen_neg_vec(vece, t1, v2); + if (opc == INDEX_op_shrv_vec) { + opc = INDEX_op_arm_ushl_vec; + } else { + opc = INDEX_op_arm_sshl_vec; + } + vec_gen_3(opc, type, vece, tcgv_vec_arg(v0), + tcgv_vec_arg(v1), tcgv_vec_arg(t1)); + tcg_temp_free_vec(t1); + break; + + default: + g_assert_not_reached(); + } } static void tcg_out_nop_fill(tcg_insn_unit *p, int count) From patchwork Fri Jun 4 20:12:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454170 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp731108jae; Fri, 4 Jun 2021 13:22:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpwS6PQn58tXsK4h8zJGuxsP9N7dk8x9jHLm/Ia+kXlrPZZjR0cYOG/9KvnbyHAF1K8aJz X-Received: by 2002:a05:6808:190:: with SMTP id w16mr12293912oic.92.1622838155759; Fri, 04 Jun 2021 13:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622838155; cv=none; d=google.com; s=arc-20160816; b=01ij27FiQKw1UAul8DFQYZ/vAj1oDTvWY3Z7L8b7OwGXBQxXEhA7pzugQrLKCU0WVX +bP3LLSAFjVhjzeG4MBJ4QTffcjamsEzFJDWRzSDthOAYTyqsGLlwwqsQLy0rqEAApqM ifnmFQ/oixrF4fGhROrH/gFg8slwLCmDPguUC55k4YoM2jhTU49KMSpANC4ThPIB+/x6 xEo5NsxqZbI7JRslMiHf9xHBz0Qa1v1bqj7GfMKh8a+AR653wsL096y6K36nsDcYU+EE C4mUj6HKmn+INMjMIlr/WEUWfjCdIfakgkYQAyeT3lW4c5HoneoN73YGjAvvJyPaR7Gk TAxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=uzTCotQYpv54FQEtObhJ5kr381PzZffGPK0hbe7ubUA=; b=RuXpkp85yVIuTCIJZOnAIai5qORkwK8iW+IV1Lo03UhxNEhLiNJif/pcvJ/ly/LrsA XyJ0CSuyoN6X4/UGAfPKHrcGmzNGZcneSAYR57JyhU5fgWfoiJGEa/VyA+83C1Iria6x oaekLy66CvLXiswFZ6IBMYgbl/22/z4vqad+EXghywntUUIQXABub4M4SMYF4sHKd0Fm 0XcrSfCOioSVz5t+ttNFkhcuYzRI78wDknzk930xbzEm7F60JuTbi4s66n/j7bNRMg24 C3fvVeXjbwth4KEWN+qarcYfgGU9cdIWdHRNXrrMLsaPsmL6+G4BJvi2VQCc4NHlrxin DO/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sApfiLUi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u10si1002172otk.90.2021.06.04.13.22.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sApfiLUi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGKx-0003P0-6P for patch@linaro.org; Fri, 04 Jun 2021 16:22:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB9-0005xu-MR for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:28 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:41541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB2-0005NL-M6 for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:27 -0400 Received: by mail-pf1-x436.google.com with SMTP id x73so8245422pfc.8 for ; Fri, 04 Jun 2021 13:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uzTCotQYpv54FQEtObhJ5kr381PzZffGPK0hbe7ubUA=; b=sApfiLUixHwMVn3xFXTw56faSLRckixYZ5pS5C2J5UZXYxJkawuGAB5kyyqEgzU1mD FW1k9txIM6HcEQAS/aOUQdggVJC0JOUkzFk5BSA68lf3CQpFWJsgqyNTaDwTB3pMoRzc MqbQsrUpira4mfHmbKNYNJofhLnA55/trqZcqkxB72WUzhF0h1wugfgArR9TLs2pQViO kJ4uBk7baQQmTU7XZYAaiCrm41BTAnJHDmEaKo6MUvYja9RQwGcInjewi+APdKj2ueDP 20gDpp4ijoaAML2XiOsDY7ti6E5GCbN7thHZ/aaKQ6mfl7t8F/592No/17NVIxJA6B1W Zvyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uzTCotQYpv54FQEtObhJ5kr381PzZffGPK0hbe7ubUA=; b=aeNDP8wvBgnEoUTaYv2nkqJAjwHLNCyLXxM6oDYknLiRuCiSXRXuozzTZ/6PbeOrQN 4CCPwFeZlJhL17bp44ueO6x/GMIkBUIbS6vP825cXkOthkApiSvlqqXLYncPCb47Bes0 jw4s+TaEhrrpHlnMFyT26lIXapYcew1lA86YsUTWGdkxhyZFm3H2bRxpOsUOooGJKuwX 3aHXxjhycK9pedsgMd6ZmHyf6veQUmN0DlfTatxTqPFTpVjTdmUi45PgTLYQK4sJG1hq MP1JOSaAHRDHZzXsNcbKU0zQBWv1Kuq8U+afUP1h2R1om6PiMSmsmyGnwIMOjpP0AjOB kHCQ== X-Gm-Message-State: AOAM531QEo+S0z5EVxCK5G7ND5bO8RgebL6fFr5rb+JhVUz4ikop5bE+ n3adKB3l/lTcdVPoGPOUblOZFoQSQKa8fQ== X-Received: by 2002:aa7:829a:0:b029:2e9:e53:198d with SMTP id s26-20020aa7829a0000b02902e90e53198dmr6328616pfm.72.1622837539259; Fri, 04 Jun 2021 13:12:19 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 14/15] tcg/arm: Implement TCG_TARGET_HAS_roti_vec Date: Fri, 4 Jun 2021 13:12:09 -0700 Message-Id: <20210604201210.920136-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Implement via expansion, so don't actually set TCG_TARGET_HAS_roti_vec. For NEON, this is shift-right followed by shift-left-and-insert. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target-con-set.h | 1 + tcg/arm/tcg-target.opc.h | 1 + tcg/arm/tcg-target.c.inc | 15 +++++++++++++++ 3 files changed, 17 insertions(+) -- 2.25.1 diff --git a/tcg/arm/tcg-target-con-set.h b/tcg/arm/tcg-target-con-set.h index d02797cbf4..3685e1786a 100644 --- a/tcg/arm/tcg-target-con-set.h +++ b/tcg/arm/tcg-target-con-set.h @@ -30,6 +30,7 @@ C_O1_I2(r, r, rIK) C_O1_I2(r, r, rIN) C_O1_I2(r, r, ri) C_O1_I2(r, rZ, rZ) +C_O1_I2(w, 0, w) C_O1_I2(w, w, w) C_O1_I2(w, w, wO) C_O1_I2(w, w, wV) diff --git a/tcg/arm/tcg-target.opc.h b/tcg/arm/tcg-target.opc.h index d19153dcb9..d38af9a808 100644 --- a/tcg/arm/tcg-target.opc.h +++ b/tcg/arm/tcg-target.opc.h @@ -11,5 +11,6 @@ * consider these to be UNSPEC with names. */ +DEF(arm_sli_vec, 1, 2, 1, IMPLVEC) DEF(arm_sshl_vec, 1, 2, 0, IMPLVEC) DEF(arm_ushl_vec, 1, 2, 0, IMPLVEC) diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index a6c7889d9f..d0af654c65 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -212,6 +212,7 @@ typedef enum { INSN_VSHLI = 0xf2800510, /* VSHL (immediate) */ INSN_VSARI = 0xf2800010, /* VSHR.S */ INSN_VSHRI = 0xf3800010, /* VSHR.U */ + INSN_VSLI = 0xf3800510, INSN_VSHL_S = 0xf2000400, /* VSHL.S (register) */ INSN_VSHL_U = 0xf3000400, /* VSHL.U (register) */ @@ -2423,6 +2424,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_arm_sshl_vec: case INDEX_op_arm_ushl_vec: return C_O1_I2(w, w, w); + case INDEX_op_arm_sli_vec: + return C_O1_I2(w, 0, w); case INDEX_op_or_vec: case INDEX_op_andc_vec: return C_O1_I2(w, w, wO); @@ -2835,6 +2838,9 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, case INDEX_op_sari_vec: tcg_out_vshifti(s, INSN_VSARI, q, a0, a1, (16 << vece) - a2); return; + case INDEX_op_arm_sli_vec: + tcg_out_vshifti(s, INSN_VSLI, q, a0, a2, args[3] + (8 << vece)); + return; case INDEX_op_andc_vec: if (!const_args[2]) { @@ -2963,6 +2969,7 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_shlv_vec: case INDEX_op_shrv_vec: case INDEX_op_sarv_vec: + case INDEX_op_rotli_vec: return -1; default: return 0; @@ -3010,6 +3017,14 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, tcg_temp_free_vec(t1); break; + case INDEX_op_rotli_vec: + t1 = tcg_temp_new_vec(type); + tcg_gen_shri_vec(vece, t1, v1, -a2 & ((8 << vece) - 1)); + vec_gen_4(INDEX_op_arm_sli_vec, type, vece, + tcgv_vec_arg(v0), tcgv_vec_arg(t1), tcgv_vec_arg(v1), a2); + tcg_temp_free_vec(t1); + break; + default: g_assert_not_reached(); } From patchwork Fri Jun 4 20:12:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 454166 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp728928jae; Fri, 4 Jun 2021 13:18:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR7LxTAT3e6eJX5Fm9U+pJaKZ5uv8y7JLiU2KQ8nHWHoUsdZHey21vt3ehV2+lANqjZS8f X-Received: by 2002:a5e:8513:: with SMTP id i19mr5029259ioj.50.1622837937771; Fri, 04 Jun 2021 13:18:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622837937; cv=none; d=google.com; s=arc-20160816; b=BTg/6thXVtaIv55q643zqsgTojOXxSEORocsDKYfYFrxV78GIvAjHmKz597eHv/Jnw y1n7C4UVBtSAyr3y8YLnhBhuWLPDLlzklYQ03BCO/BTN2JbGQ0P4V3kSnS/KDx3HoSR3 fgh6wEPXQ/pKvh9yVArftCNLZATZZbXA1sZvMXXYs2cyPct6bLhnfirzGEWWtxL8erwc zQVbjNyxAzW1q1ofRQCMvAm8BR4dP7EKHPwdoCaQP9EVOQOUkrS5q9uRuIuWQKQvLHdW uWGpXtWTur5Tktge/uzMkfACQgfR9oI++HB09KIn3d4UBhR716fx14OkJhw2yssqdO15 3hFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+Ml4qUqW7f9PWixv5pRGmS2Ze6jibnZ1zFb/E9JWDOY=; b=mA20yGDU5e/V+cvgaiO+HICgZSVmzf9ZTYbS7viQysXuh8FeKlXJNKlfjHOYU9TJZs bpEcaeFLf6yhvgawAUtboHYq+BfH4sDIf11SJXPZ0zMcz4aySHAbb4rN32brSE7di3/S n460RVMA7Z/s2m6EE5IzyG2lQi4E9ImofJ68gMfsbB1ZsL9ox3kw3vA0N0Ge7s1gNHKA NIDqXYFMpkURdOvjGGoj5DnrZLBElbgjPyxtXG8/KdW2L7DCDjUgG4oukKh1Er3v7kvp 4iBepPOoqVrZXKWWUOK4C/pWLSC1R7Pbq42/+TAVBBbkfSa41G5iPx0C5JGrQx1SQOuQ sDAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g6J0kOAY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i24si7896504jan.76.2021.06.04.13.18.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 Jun 2021 13:18:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g6J0kOAY; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpGHR-0005R5-7W for patch@linaro.org; Fri, 04 Jun 2021 16:18:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpGB7-0005tF-7z for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:26 -0400 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:37618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpGB3-0005ON-KK for qemu-devel@nongnu.org; Fri, 04 Jun 2021 16:12:25 -0400 Received: by mail-pg1-x52c.google.com with SMTP id t9so8747774pgn.4 for ; Fri, 04 Jun 2021 13:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Ml4qUqW7f9PWixv5pRGmS2Ze6jibnZ1zFb/E9JWDOY=; b=g6J0kOAYxKxV+gn0ubZxU/mDddd19I9doNrUuA2J6l4oXSawVyHgJDAX+jnjYs77P0 tETbmyTaDf3LAL4eX683ZehnBG6npXofjyIIjg/etb20wwAoEyGFUaESz0NLONme4F9x vOLDJbyvUMUq8IVcFRrOJjl9GGYPZ/w9lANLCREgV8mrpXOKHqVY58PxJDarBHmJsebz Hi/hgkDjpNZ5opwK3VeRmYXH5syx9LB0FOaCd+T2rqgOM2o6wz+9EE69a8S+LglbCrmZ qqukT2J4A7flqWnzC9C8Vseqb3Z299MzDVFMjHKYzplUAw0ujXgtySGGJlDqghHekW2W xzTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Ml4qUqW7f9PWixv5pRGmS2Ze6jibnZ1zFb/E9JWDOY=; b=ivplNf2xS/T3nRUvHa/r2MZSeAT74DsMHHwGZWOUBNzHd5W3Xp2onnEl1hx34FUcg/ 3c42uP6j9Jj+Gta3oxax2cCtZ0NkBUZf0K8nbwh5F31Bnf+Y4WrFAHDhzR9fjVpGMIis BvVJS/btJKmG+QIQSjjzzspSHP95s71Sy1fH2sWTMG+8M/tZYZ4MrZNPT1S7Z3qr7I+C Whcrdzw9o1pNnW5hzutWtIy3cdDHIxEQC+ztP82YV96LVts7BMwCl7EQxUeSrgAXo/5c BohOwKAxvv+/LbSuSTmBHFFkqncynNP9M+rgJL/cD8/xV942Jog9U9sCHf0Xxw1Vl3CH bB4g== X-Gm-Message-State: AOAM530b5NxGRgJJ1Hh9OEvUfe+BSNSrJFgJcGq/e9ujS3WZR2rPq9BN j1PNfcHNh8gpA+3Nu9UMgN+F+2AgjhJn4w== X-Received: by 2002:aa7:801a:0:b029:2e0:c3db:15a2 with SMTP id j26-20020aa7801a0000b02902e0c3db15a2mr6271132pfi.42.1622837539861; Fri, 04 Jun 2021 13:12:19 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id a129sm2422599pfa.118.2021.06.04.13.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 13:12:19 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 15/15] tcg/arm: Implement TCG_TARGET_HAS_rotv_vec Date: Fri, 4 Jun 2021 13:12:10 -0700 Message-Id: <20210604201210.920136-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210604201210.920136-1-richard.henderson@linaro.org> References: <20210604201210.920136-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Implement via expansion, so don't actually set TCG_TARGET_HAS_rotv_vec. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.c.inc | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index d0af654c65..f4c9cb8f9f 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -2970,6 +2970,8 @@ int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type, unsigned vece) case INDEX_op_shrv_vec: case INDEX_op_sarv_vec: case INDEX_op_rotli_vec: + case INDEX_op_rotlv_vec: + case INDEX_op_rotrv_vec: return -1; default: return 0; @@ -2980,7 +2982,7 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, TCGArg a0, ...) { va_list va; - TCGv_vec v0, v1, v2, t1; + TCGv_vec v0, v1, v2, t1, t2, c1; TCGArg a2; va_start(va, a0); @@ -3025,6 +3027,37 @@ void tcg_expand_vec_op(TCGOpcode opc, TCGType type, unsigned vece, tcg_temp_free_vec(t1); break; + case INDEX_op_rotlv_vec: + v2 = temp_tcgv_vec(arg_temp(a2)); + t1 = tcg_temp_new_vec(type); + c1 = tcg_constant_vec(type, vece, 8 << vece); + tcg_gen_sub_vec(vece, t1, v2, c1); + /* Right shifts are negative left shifts for NEON. */ + vec_gen_3(INDEX_op_arm_ushl_vec, type, vece, tcgv_vec_arg(t1), + tcgv_vec_arg(v1), tcgv_vec_arg(t1)); + vec_gen_3(INDEX_op_arm_ushl_vec, type, vece, tcgv_vec_arg(v0), + tcgv_vec_arg(v1), tcgv_vec_arg(v2)); + tcg_gen_or_vec(vece, v0, v0, t1); + tcg_temp_free_vec(t1); + break; + + case INDEX_op_rotrv_vec: + v2 = temp_tcgv_vec(arg_temp(a2)); + t1 = tcg_temp_new_vec(type); + t2 = tcg_temp_new_vec(type); + c1 = tcg_constant_vec(type, vece, 8 << vece); + tcg_gen_neg_vec(vece, t1, v2); + tcg_gen_sub_vec(vece, t2, c1, v2); + /* Right shifts are negative left shifts for NEON. */ + vec_gen_3(INDEX_op_arm_ushl_vec, type, vece, tcgv_vec_arg(t1), + tcgv_vec_arg(v1), tcgv_vec_arg(t1)); + vec_gen_3(INDEX_op_arm_ushl_vec, type, vece, tcgv_vec_arg(t2), + tcgv_vec_arg(v1), tcgv_vec_arg(t2)); + tcg_gen_or_vec(vece, v0, t1, t2); + tcg_temp_free_vec(t1); + tcg_temp_free_vec(t2); + break; + default: g_assert_not_reached(); }