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: