From patchwork Mon Dec 16 03:42:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 1210061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-516010-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="oE8PyaZt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gl/M9wuG"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47bnCh6V8qz9sNH for ; Mon, 16 Dec 2019 14:42:38 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=UAZuA6QRj8b6KE9pKvpXduI/jKIoQtehBrMF8j3fnQP4BW MCLMbZxeuUEWJbTKEHyG0s5V1XyJ6bCOxG8qm4v/JK218ELQLr7Z8+sREBRsVwYt KhqUCzMrux+Z1wq/qc7Q0zlIHpNlH3xd7ziu+kJgpWyGYl2xis+8uECwSMviQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=ovgUfVYedqJvah1s3kp7bndxZC4=; b=oE8PyaZt8Qmjdi28X4dq bQ0kuFmfANYtPuWxJTpMxmSNOLa1tJB+h7o1QLYYVx9J5jILqfbaVVQ/RL7DrEmq ZqDk7SQv+FEN0PD5Igazr4TLIf+zx2u70i1kkSwLiknqLKOq/Yf32cDNgDeLUZBB Kog+pXT6k1pDYDqZSoMOo70= Received: (qmail 30387 invoked by alias); 16 Dec 2019 03:42:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 30379 invoked by uid 89); 16 Dec 2019 03:42:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=__int128, H*MI:Sn1, apinskimarvellcom, littleendian X-HELO: mail-vk1-f174.google.com Received: from mail-vk1-f174.google.com (HELO mail-vk1-f174.google.com) (209.85.221.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Dec 2019 03:42:28 +0000 Received: by mail-vk1-f174.google.com with SMTP id p191so1232393vkf.8 for ; Sun, 15 Dec 2019 19:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=P/TJjXy12UmilHcDqFPfAVXirMgXddCzjp4/RvLiyRk=; b=gl/M9wuGSRAEHkFYpimXnkCQcCS9CfXIxXK41vltoLlr9DNnFNBBuLc4vCO/LOC8UM K6Ff85RrTfNO+ny/iNyIC1LM5H8d0YisCHvc5kRU2qV0xRv0O8P1ne2kFVpojan/IpcN goWy2MHt2Kb+HraeXxKzb0ZQA8iLvsZCN7ayUvIr09ZdiLsx58HfczLE9z46KxNjIAix nonKdpsrgRdsSq/+ZYxBrw7msn6gHqGG1nOr72mMIRBa2bbF3lxL15OAKXPSGWnZlEWu /JW5dX8Ol3f5tGzfOAE+c8Bhgyx+beMpYsx4Ow4nQP7Qvg0OCRMxPyvUjm6GF4wkNCBC RGsA== MIME-Version: 1.0 From: Andrew Pinski Date: Sun, 15 Dec 2019 19:42:14 -0800 Message-ID: Subject: [Committed] Add some __int128 bitfield testcases To: GCC Patches X-IsSubscribed: yes Hi, While working on the bit-field lowering patch, I noticed there was no testcases that used int128_t as bit-fields. So I added some. Including two that uses scalar_storage_order. These are just compile testcases. Committed as obvious after testing on x86_64 to make sure the testcases pass. Thanks, Andrew Pinski testsuite/ChangeLog: * gcc.c-torture/compile/bitfield-1.c: New test. * gcc.c-torture/compile/bitfield-endian-1.c: New test. * gcc.c-torture/compile/bitfield-endian-2.c: New test. Index: ChangeLog =================================================================== --- ChangeLog (revision 279408) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2019-12-15 Andrew Pinski + + * gcc.c-torture/compile/bitfield-1.c: New test. + * gcc.c-torture/compile/bitfield-endian-1.c: New test. + * gcc.c-torture/compile/bitfield-endian-2.c: New test. + 2019-12-14 Jakub Jelinek PR tree-optimization/92930 Index: gcc.c-torture/compile/bitfield-1.c =================================================================== --- gcc.c-torture/compile/bitfield-1.c (nonexistent) +++ gcc.c-torture/compile/bitfield-1.c (working copy) @@ -0,0 +1,13 @@ +/* { dg-require-effective-target int128 } */ + +struct f +{ + __uint128_t t:124; + __uint128_t t1:4; +}; + +struct f g(void) +{ + struct f t = {1, 2}; + return t; +} Index: gcc.c-torture/compile/bitfield-endian-1.c =================================================================== --- gcc.c-torture/compile/bitfield-endian-1.c (nonexistent) +++ gcc.c-torture/compile/bitfield-endian-1.c (working copy) @@ -0,0 +1,15 @@ +/* { dg-require-effective-target int128 } */ + +#define ENDIAN __attribute((scalar_storage_order ("big-endian"))) + +typedef struct ENDIAN +{ + __uint128_t t:124; + __uint128_t t1:4; +}f; + +f g(void) +{ + f t = {1, 2}; + return t; +} Index: gcc.c-torture/compile/bitfield-endian-2.c =================================================================== --- gcc.c-torture/compile/bitfield-endian-2.c (nonexistent) +++ gcc.c-torture/compile/bitfield-endian-2.c (working copy) @@ -0,0 +1,15 @@ +/* { dg-require-effective-target int128 } */ + +#define ENDIAN __attribute((scalar_storage_order ("little-endian"))) + +typedef struct ENDIAN +{ + __uint128_t t:124; + __uint128_t t1:4; +}f; + +f g(void) +{ + f t = {1, 2}; + return t; +}