From patchwork Sun Sep 6 12:40:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11759499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 487D0112E for ; Sun, 6 Sep 2020 12:41:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C664208B3 for ; Sun, 6 Sep 2020 12:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kn0BNdgB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725803AbgIFMlN (ORCPT ); Sun, 6 Sep 2020 08:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726931AbgIFMlI (ORCPT ); Sun, 6 Sep 2020 08:41:08 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8A7DC061573 for ; Sun, 6 Sep 2020 05:40:46 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id c10so10049417edk.6 for ; Sun, 06 Sep 2020 05:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dKOOwWUHAHq3BdSfYEjSQTKHFN7u8QKMUwhamgd6olU=; b=kn0BNdgBg7M9syUGCjUdjkgsdRASuBAFk85Tlph6OvuK9a6oH7ecRQubjkHhQ4K/St BKzQgDtvwKIiO5SnFUPEmIFeIDQXAUAXUlqweFDafr/fGpCJy+aZ0smi1jRrNFvU3424 lXpMc4cPX0w1PXpEP/NrsAEl0wzbVyF3VwczCyQ6cUnZ37cIxcbIx30Y2v3W9DEi0nsS RpUcqIionyczAaE3234c8jH+43MYOJ4PvDm2BvrAtO03zKYHQ6CCyRILTZ70xZksT1+l Pqi9TJ8luJE7CX4uYOy5opYUeWE3RMUdy3CJ3HOyQQofGSC6kNZDL12z0amrid8bu4XE +D1Q== 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=dKOOwWUHAHq3BdSfYEjSQTKHFN7u8QKMUwhamgd6olU=; b=cJVhKO1mKv3Ztxq114HJCnX1UaKsFfODcg2OQY/PTs5Ke/Ngx/G7c3NEPYo6ohVkyT myB76z6BmNBYJfYYfSOVSCp4wh/oEb4IA0fGQRIDrioPqCb6WpQsAZkN3/zj9Vxsq9qf 7CTRMV4XHxUwnce3kfaC2JuA9ktMp77priSRpZv3YsvjNtZUYWTNwdfwdJEF0ebeyemP v1olIvtDI1PdP3wc3Drddb3m8G/lcNCBzbmbAzOEPBEd37OT6QCTc+AbOgtypRlnJ06Y 2rN18BhX4UoRqmfMDUcTphqeuk5Jz3FAE80imp2CYsBvWkQxGa9SHi5vbnsrvV3FK5Gh voew== X-Gm-Message-State: AOAM531EsH0S/jqI0T1wN7qpyv1Bz0oHmys0fxKbpqzi7NMn/aqawzqV Mms3rzxpiWrNyfFvb9NnlMlOAAV0OeM= X-Google-Smtp-Source: ABdhPJxkgQpURlQctBcSymW9HxgrUM2Z/i7D+gJKTMLm0QULePBt7FCeZIsmgXVAdexwUXFGSuFeiA== X-Received: by 2002:a05:6402:644:: with SMTP id u4mr16889814edx.182.1599396044112; Sun, 06 Sep 2020 05:40:44 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:a7fb:e200:6c5d:e4e0:a162:77b6]) by smtp.gmail.com with ESMTPSA id b6sm11591124eds.46.2020.09.06.05.40.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 05:40:43 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 1/3] add more testcases for existing AND/OR simplifications Date: Sun, 6 Sep 2020 14:40:36 +0200 Message-Id: <20200906124038.46786-2-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> References: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Add a few more testcases to catch possible future regressions. Signed-off-by: Luc Van Oostenryck --- validation/optim/and-shl-or-and0.c | 13 +++++++++++++ validation/optim/lsr-or-and0.c | 23 +++++++++++++++++++++++ validation/optim/shl-or-constant0.c | 12 ++++++++++++ validation/optim/shl-or-constant1.c | 12 ++++++++++++ validation/optim/shl-or-constant2.c | 12 ++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 validation/optim/and-shl-or-and0.c create mode 100644 validation/optim/lsr-or-and0.c create mode 100644 validation/optim/shl-or-constant0.c create mode 100644 validation/optim/shl-or-constant1.c create mode 100644 validation/optim/shl-or-constant2.c diff --git a/validation/optim/and-shl-or-and0.c b/validation/optim/and-shl-or-and0.c new file mode 100644 index 000000000000..ea08d2622a95 --- /dev/null +++ b/validation/optim/and-shl-or-and0.c @@ -0,0 +1,13 @@ +unsigned and_shl_or_and0(unsigned a, unsigned b) +{ + return (((a & 0xfff00000) | b) << 12) & 0xfff00000; +} + +/* + * check-name: and-shl-or-and0 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-excludes: or\\. + * check-output-excludes: lsr\\. + */ diff --git a/validation/optim/lsr-or-and0.c b/validation/optim/lsr-or-and0.c new file mode 100644 index 000000000000..3c369cb9497e --- /dev/null +++ b/validation/optim/lsr-or-and0.c @@ -0,0 +1,23 @@ +#define S 12 + +// ((x & M) | b) >> S; +// -> ((x >> S) & (M >> S)) | (b >> S) +// 0a: (M >> S) == 0 +// 0b: (x >> S) == 0 +// 0c: (b >> S) == 0 + +int lsr_or_and0a(unsigned int x, unsigned int b) +{ + return ((x & 0x00000fff) | b) >> S; +} + +/* + * check-name: lsr-or-and0 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-pattern(1): lsr\\. + * check-output-excludes: %arg1\\. + * check-output-excludes: and\\. + * check-output-excludes: or\\. + */ diff --git a/validation/optim/shl-or-constant0.c b/validation/optim/shl-or-constant0.c new file mode 100644 index 000000000000..25347b4b3b20 --- /dev/null +++ b/validation/optim/shl-or-constant0.c @@ -0,0 +1,12 @@ +unsigned shl_or_constant0(unsigned a) +{ + return (a | 0xfff00000) << 12; +} + +/* + * check-name: shl-or-constant0 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-excludes: or\\. + */ diff --git a/validation/optim/shl-or-constant1.c b/validation/optim/shl-or-constant1.c new file mode 100644 index 000000000000..cd3ea8bb011b --- /dev/null +++ b/validation/optim/shl-or-constant1.c @@ -0,0 +1,12 @@ +unsigned shl_or_constant1(unsigned a) +{ + return (a | 0x000fffff) << 12; +} + +/* + * check-name: shl-or-constant1 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-contains: ret\\..*\\$0xfffff000 + */ diff --git a/validation/optim/shl-or-constant2.c b/validation/optim/shl-or-constant2.c new file mode 100644 index 000000000000..9dbde3b574d7 --- /dev/null +++ b/validation/optim/shl-or-constant2.c @@ -0,0 +1,12 @@ +unsigned shl_or_constant1(unsigned a) +{ + return (a | 0x00ffff0f) << 12; +} + +/* + * check-name: shl-or-constant2 + * check-command: test-linearize -Wno-decl $file + * + * check-output-ignore + * check-output-contains: or\\..*\\$0xfff0f + */ From patchwork Sun Sep 6 12:40:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11759501 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C310C746 for ; Sun, 6 Sep 2020 12:41:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A7E7620C09 for ; Sun, 6 Sep 2020 12:41:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S733cBxu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbgIFMlU (ORCPT ); Sun, 6 Sep 2020 08:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbgIFMlI (ORCPT ); Sun, 6 Sep 2020 08:41:08 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B25FC061575 for ; Sun, 6 Sep 2020 05:40:47 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id i26so14293080ejb.12 for ; Sun, 06 Sep 2020 05:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lZmnknJgZbE5l1SQAl8BMcw2os7U3h4tWBKfEbcJqUo=; b=S733cBxubl1J7d/s275y6KKbfFcQSlK64mbC6Y9M8WV8v+r2arrfRw2+0pHGZlmSiJ Fhdn9ik2bdC4u+5394lmG9+7y04qVgIBQ0B1gkvAkrbhGoGUPnuRGVc8SmBBCGJYcBDP Uo0CkgXevkuwNUHxpwzt+vRZnjvV4lR/59hJq49hmurhn0WGHrQ9uhd9YgHzTbZyZU2z UCpxtDduuKY6b4dscvG1mC62zDUQcLADZh4kVd56hcOni99T3VKG5ac/yzO3b+9Wgycx tNF1jAM5leUtmec1vcrcAjv38CZBfjc5U2QXWs/Ls/VGWpuwuKn7X47QnrxVs/nwiysL 8x0g== 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=lZmnknJgZbE5l1SQAl8BMcw2os7U3h4tWBKfEbcJqUo=; b=cWCgf31B1/21OadkjZM19nxAseEXP/JSoAcNRBOgPi3aVpg4PjcpAj91E85Hjf5sQ5 ug50VhTecEe1bEBA0w+N9cPhYWVACc2PBbiWkeSjf5iIE2DWSJ0h6ZahAl7zDOcZ5G0D jxDoobB3X/GmVrYhYOVYmmBPruxw8h9PMfhVolLgz3gFQSDV5fOG/Wo9Tsoa0UysQLk6 eak4LxNtuHHanksGHizBB1efaknvN95ENF68642nVm8kjj6sqrjckhNBKYf5Ye3yKiG9 6Y/8SzRpvRCa/U+1jvvcItYQe12UAHGG00Y6STCBjjh/AG3HW7ScALhEg+NhDQtxTFlY varQ== X-Gm-Message-State: AOAM530TlzwmDAaB1Xd/q89do+gw3AkPxSkulmoB5L4rZyhBjiwS6NiD E/ZXyC3tzOPz7kWX8H2W6DgiyjFHpY8= X-Google-Smtp-Source: ABdhPJx0uY2kRJUq9080j0Tk/MhPvyXgU6V4/NZCLMFvuIXlsqgAMf1r/NWswrhVHE3hyyiz71YFjw== X-Received: by 2002:a17:906:84f7:: with SMTP id zp23mr16070756ejb.203.1599396045276; Sun, 06 Sep 2020 05:40:45 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:a7fb:e200:6c5d:e4e0:a162:77b6]) by smtp.gmail.com with ESMTPSA id b6sm11591124eds.46.2020.09.06.05.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 05:40:44 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 2/3] add more testcases for AND/OR simplification Date: Sun, 6 Sep 2020 14:40:37 +0200 Message-Id: <20200906124038.46786-3-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> References: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Add a few testcases showing the effectiveness of these simplifications and to catch possible future regressions. Signed-off-by: Luc Van Oostenryck --- validation/optim/and-lsr-or-shl0.c | 12 ++++++++++++ validation/optim/and-lsr-or-shl1.c | 12 ++++++++++++ validation/optim/and-shl-or-lsr0.c | 13 +++++++++++++ validation/optim/lsr-or-lsr0.c | 20 ++++++++++++++++++++ validation/optim/trunc-or-shl0.c | 19 +++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 validation/optim/and-lsr-or-shl0.c create mode 100644 validation/optim/and-lsr-or-shl1.c create mode 100644 validation/optim/and-shl-or-lsr0.c create mode 100644 validation/optim/lsr-or-lsr0.c create mode 100644 validation/optim/trunc-or-shl0.c diff --git a/validation/optim/and-lsr-or-shl0.c b/validation/optim/and-lsr-or-shl0.c new file mode 100644 index 000000000000..e2a517ab65c4 --- /dev/null +++ b/validation/optim/and-lsr-or-shl0.c @@ -0,0 +1,12 @@ +unsigned int and_lsr_or_shl0(unsigned int a, unsigned int b) +{ + return ((a | b << 12) >> 12) & 0xfff00000; +} + +/* + * check-name: and-lsr-or-shl0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-excludes: shl\\. + */ diff --git a/validation/optim/and-lsr-or-shl1.c b/validation/optim/and-lsr-or-shl1.c new file mode 100644 index 000000000000..6f2d05a0bfdd --- /dev/null +++ b/validation/optim/and-lsr-or-shl1.c @@ -0,0 +1,12 @@ +unsigned int and_lsr_or_shl1(unsigned int a, unsigned int b) +{ + return ((a | b << 12) >> 12) & 0x000fffff; +} + +/* + * check-name: and-lsr-or-shl1 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-excludes: shl\\. + */ diff --git a/validation/optim/and-shl-or-lsr0.c b/validation/optim/and-shl-or-lsr0.c new file mode 100644 index 000000000000..f2a7cc631258 --- /dev/null +++ b/validation/optim/and-shl-or-lsr0.c @@ -0,0 +1,13 @@ +unsigned and_shl_or_lsr0(unsigned a, unsigned b) +{ + return ((a | (b >> 12)) << 12) & 0xfff00000; +} + +/* + * check-name: and-shl-or-lsr0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: or\\. + */ diff --git a/validation/optim/lsr-or-lsr0.c b/validation/optim/lsr-or-lsr0.c new file mode 100644 index 000000000000..a1687ec21ff0 --- /dev/null +++ b/validation/optim/lsr-or-lsr0.c @@ -0,0 +1,20 @@ +#define S 12 + +// ((x >> S') | y) >> S; +// -> ((x >> S >> S) | (y >> S) + +int lsr_or_lsr0(unsigned int x, unsigned int b) +{ + return ((x >> (32 - S)) | b) >> S; +} + +/* + * check-name: lsr-or-lsr0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-pattern(1): lsr\\. + * check-output-excludes: and\\. + * check-output-excludes: or\\. + */ diff --git a/validation/optim/trunc-or-shl0.c b/validation/optim/trunc-or-shl0.c new file mode 100644 index 000000000000..4d85a6bd4ec4 --- /dev/null +++ b/validation/optim/trunc-or-shl0.c @@ -0,0 +1,19 @@ +char trunc_or_shl0a(unsigned a, unsigned b) +{ + return (a << 8) | b; +} + +char trunc_or_shl0b(unsigned a, unsigned b) +{ + return a | (b << 8); +} + +/* + * check-name: trunc-or-shl0 + * check-command: test-linearize -Wno-decl $file + * check-known-to-fail + * + * check-output-ignore + * check-output-excludes: or\\. + * check-output-excludes: shl\\. + */ From patchwork Sun Sep 6 12:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11759503 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7905B746 for ; Sun, 6 Sep 2020 12:41:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5DD2320C09 for ; Sun, 6 Sep 2020 12:41:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UwujrLMr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728542AbgIFMlW (ORCPT ); Sun, 6 Sep 2020 08:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727773AbgIFMlI (ORCPT ); Sun, 6 Sep 2020 08:41:08 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 196EDC061755 for ; Sun, 6 Sep 2020 05:40:47 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id c10so10049458edk.6 for ; Sun, 06 Sep 2020 05:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CW5HfaKL0MFm8iN7hro8u/5xiWhgqjY5+LgqtEBVOSc=; b=UwujrLMrl+h7OWAcewMFLeH+bYm2eNDUMsPafpAe7npwG2kPfgcwnjTerKXzGJDJym jz69lwRnL2I6GE5oQ7hE2OgD0xaewFfcArNlA1gJiz/L5/xlcYguSt9UUVGQv32iq/iv QtVinIX6n4zxQx82ncuZLFNE+SAvO9Vt1yFOCESdqe3je5y/zhVKmK0GyZLfbkDN68ra GyXT/vw5qi98KsFhCJ6zWQFsZkqs7nL1SHUM6kyXD9WzODi48UW92/pgS1haHp1F6xEu 4rCVMz2AExrkdqrlYhS1R5yW/++x3j97WS90bbOcywZUnZUKVpCoiSBWteJfyBsoZD5m 3dYA== 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=CW5HfaKL0MFm8iN7hro8u/5xiWhgqjY5+LgqtEBVOSc=; b=bg9OUhWYI52QXZ43TeR6/ZT50hMAkNPFrhSV3l5mAytkKLCrwU7gtO9CMzP67eZzuX AJ6WW2M7fCH5io56J5HxmSAeT8muiFy3aexxyeQLNlU0T2W/JtIrM1lUB3zx1ATZkd3v 8W8LdCD8M4KsbuKwd+arWhJWZyQmdmL9kWDhYQ2F0k0BWYly0Sm/U1QTJOK1/+q79o6p ddmJem+QEk05TEe/RMQ0ogpmx9TDEERqZ6sJyxQsFzwZX9SzZTj4bg5T52mprV3weA7Q /SVThKWYHM3lrQvpWVtnYdmFsEFKxgMJzhxXylF8CClDuDclGmDEAB4Un7VcOdCh4cof DgIQ== X-Gm-Message-State: AOAM533dkxjDa2ZNXmGycgSwvYRMVQWstpkuBpJtREhLePZn0/GtRoIh CFbl20ypYV7Xmj71n1ZMKgey1a0XGLE= X-Google-Smtp-Source: ABdhPJzpAbrvADM5ZGxXrXphxVS/cW27dqDavEMEgC4ffJH05/mdtaNQm4zPCmJsqRskVMqB1pSFzg== X-Received: by 2002:aa7:cb83:: with SMTP id r3mr16818547edt.35.1599396046325; Sun, 06 Sep 2020 05:40:46 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:a7fb:e200:6c5d:e4e0:a162:77b6]) by smtp.gmail.com with ESMTPSA id b6sm11591124eds.46.2020.09.06.05.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 05:40:45 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 3/3] optim: fix some testcases related to bitfield manipulation Date: Sun, 6 Sep 2020 14:40:38 +0200 Message-Id: <20200906124038.46786-4-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> References: <20200906124038.46786-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org The patterns used here were based on looser semantic for OP_{SEXT,TRUNC}. Signed-off-by: Luc Van Oostenryck --- validation/optim/sext.c | 7 +++---- validation/optim/trunc-or-shl.c | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/validation/optim/sext.c b/validation/optim/sext.c index 719730d50739..a3aa14945f11 100644 --- a/validation/optim/sext.c +++ b/validation/optim/sext.c @@ -6,10 +6,9 @@ int sext(int x) /* * check-name: sext * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore - * check-output-contains: sext\\.$27 - * check-output-excludes: asr\\. - * check-output-excludes: shl\\. + * check-output-pattern(3): \\.32 + * check-output-contains: shl\\. + * check-output-contains: asr\\. */ diff --git a/validation/optim/trunc-or-shl.c b/validation/optim/trunc-or-shl.c index 70d8bd1de5bb..52b4f041b010 100644 --- a/validation/optim/trunc-or-shl.c +++ b/validation/optim/trunc-or-shl.c @@ -9,5 +9,7 @@ char foo(int a, int b) * check-known-to-fail * * check-output-ignore - * check-output-contains: ret\\..*%arg2 + * check-output-contains: trunc\\..*%arg2 + * check-output-excludes: or\\. + * check-output-excludes: shl\\. */