From patchwork Thu Jun 6 17:46:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1944759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=SPHDNxSf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VwBcd6sztz20KL for ; Fri, 7 Jun 2024 03:47:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DA7C39AF0DE for ; Thu, 6 Jun 2024 17:47:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id E4FD439AF0C8 for ; Thu, 6 Jun 2024 17:46:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E4FD439AF0C8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E4FD439AF0C8 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717696020; cv=none; b=pAMagIG+mljLkJsQGDzPPt2Bu3isAQ9udp0j8ENdUUOAvjSitLOvLsM51w9+Mp1g5g+B7bQgRQyDqHx5I59yVQjH4yyYV4E2jQ3Cdo268FoModK4fY5pEQJ1cw5vGIgQCjHQOrNQc/wu4OcalfjXEO8bqHJvSv//8XQv/eZ33dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717696020; c=relaxed/simple; bh=4jEVbLqXOarseXryRET7Ai2V6+BEqXs70ps24Qe4qtM=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=r6LE7WCQbmYxvs1KGyjkrfJLfIXRhlYY7v0H342UAe0YHHS63bHEn3XKKM/iOnudggTuULZlk+YG2cxv6/K9KUm5HoDAjlqfEaRysYYkkvyDTM7eF6ei3JLuwzNCrmXrW/5BZG3RfzocZGkO2uAzIbDIpG3dkO6Y2MLGgyYPyZQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2eabd22d441so19875851fa.2 for ; Thu, 06 Jun 2024 10:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717696017; x=1718300817; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=jZ+VIJcMuvDQxA+r3K7IGr1l4d1YDNByzGYVuzMDUXQ=; b=SPHDNxSfkRur3PaP9kHmDkQ8nsthy4XIVkUMm8B8OEkd0XKYTjadfnL+JF2FyDrqJa f+Jhf1vqWtZFvzR5Om6A0pgIv8pXFFn86RlYPRQXA/S/uTbw6DZe6faPFbGIjdwfZeWW sjxG+qehJEz+1nFwlCo2m0ZJ7F85ggpegOqdwttdaC680htjwIMFtMNCbPy6zKMTGVZa 0IczkVRyJjz2Kp6tyX17JNyGVbn9qPRnNm7KU0AAucPzWnQYEmH9UPTTLF6mE2WKtq5C 2hBnVvqbcP/vGqTOkQASnjD5CBwH1PhgJkeEOsnWHEc5OpI8BfiizeFgm2DNSBel8GUb WMWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717696017; x=1718300817; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jZ+VIJcMuvDQxA+r3K7IGr1l4d1YDNByzGYVuzMDUXQ=; b=uyZCRTqcXyxK6mhvMrrVreIq0XeOz7rLPwfr6/KWRFNgaf04MyvS2+U56KrTcpYFFN NDNvRBnF/IYvwlEF4t/k6xTs82MNMLFWh0nZ7E/hCytXF8QRNJ6YYaZHp8gkAWccuTsU tKLxfyIGE4mmlyYbVhzux3564Vz0bSV3Kazh6uCUW69317y0L7nl3Y5V158hFONVvMQQ M0V1VJ5g+zJJq1zHqaCYlA8sWV8WcFMtb4DpiLInjGjsNUuGcjLr9N02q1eGqGdrJYZc QjeEwtcjFqgAVEWMtTzsLbCGbunlvrx3y4fko2NfQiiy/VK8jlTvJAtgVQKZTFrS54Q4 KA4g== X-Gm-Message-State: AOJu0Yxb8dC4rJ3VJEcSPwN4G2ng64+NXUuiCjP1Zr6ytrMyuf1cvHf5 WuCa91I8OqwxTv9RaAqhG0BE1zN6GoJUlmdG9PJmYLRp2reRKaAhbnfpi6aWPUExJb26iipCJEp +/9D/16TZa3gs/lvdJ6+kO8e56Z2UyubqnXQ= X-Google-Smtp-Source: AGHT+IEs/eBv6Twb8Z/Kccg+gjz5fuBCDhCHFevY8fKpxOBWAybHm3+3qfkfi40/gS1we6HeEudkf6nGZZHJxS4EGO8= X-Received: by 2002:a05:651c:d2:b0:2ea:7e39:bd38 with SMTP id 38308e7fff4ca-2eadce85ee7mr3140701fa.34.1717696016557; Thu, 06 Jun 2024 10:46:56 -0700 (PDT) MIME-Version: 1.0 From: Uros Bizjak Date: Thu, 6 Jun 2024 19:46:44 +0200 Message-ID: Subject: [committed] testsuite/i386: Add vector sat_sub testcases [PR112600] To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org PR middle-end/112600 gcc/testsuite/ChangeLog: * gcc.target/i386/pr112600-2a.c: New test. * gcc.target/i386/pr112600-2b.c: New test. Tested on x86_64-linux-gnu {,-m32}. Uros. diff --git a/gcc/testsuite/gcc.target/i386/pr112600-2a.c b/gcc/testsuite/gcc.target/i386/pr112600-2a.c new file mode 100644 index 00000000000..4df38e5a720 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr112600-2a.c @@ -0,0 +1,15 @@ +/* PR middle-end/112600 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-vectorize -msse2" } */ + +typedef unsigned char T; + +void foo (T *out, T *x, T *y, int n) +{ + int i; + + for (i = 0; i < n; i++) + out[i] = (x[i] - y[i]) & (-(T)(x[i] >= y[i])); +} + +/* { dg-final { scan-assembler "psubusb" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr112600-2b.c b/gcc/testsuite/gcc.target/i386/pr112600-2b.c new file mode 100644 index 00000000000..0f6345de704 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr112600-2b.c @@ -0,0 +1,15 @@ +/* PR middle-end/112600 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftree-vectorize -msse2" } */ + +typedef unsigned short T; + +void foo (T *out, T *x, T *y, int n) +{ + int i; + + for (i = 0; i < n; i++) + out[i] = (x[i] - y[i]) & (-(T)(x[i] >= y[i])); +} + +/* { dg-final { scan-assembler "psubusw" } } */