From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E76D43858D37 for ; Tue, 21 Mar 2023 11:19:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E76D43858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679397591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MHltgJeiQPbokFUCOv+c7cX1kmligHK0i9BLxVbwnxA=; b=VfPGyxxxRT/aW2MGFRzMEdNCOeCe/IV8FgC+uqJXZMyVO7e27jTMpCI7KuoSDZcHZ/I209 qXNrspJLvcl93uKBQSoduf/xe14ysXlkqDlBkDfg4u7gB1d0QryAUtW7Ey7qQTNKi9u7wV fDZwIbOFp+D9I9IafuoxNX+QalQxbEA= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-377-AZl8e0BLOh2Pk3RzgUj91Q-1; Tue, 21 Mar 2023 07:19:48 -0400 X-MC-Unique: AZl8e0BLOh2Pk3RzgUj91Q-1 Received: by mail-lf1-f71.google.com with SMTP id y9-20020a056512044900b004b4b8aabd0cso5429477lfk.16 for ; Tue, 21 Mar 2023 04:19:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679397586; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MHltgJeiQPbokFUCOv+c7cX1kmligHK0i9BLxVbwnxA=; b=uflx56MwrXl+rgzFWH4KZthsu8jTsG8cIKKHFTNV6NuxN7iTlTafrwR/4SpcB2tYm9 8JqTOZk66BlqJKBIvyQEskvWVUakAF9OGBjRWTDDSFkcbQMfJ43FA2NACbjUNS3+W9ab rWHpgFhzRRUTD0F9pQeKoN5OJdYGWtk1f6+yyoedMW3FiJPZrt9cwnU5WGS1M3w3Sg5u lMCxScfA4cuHncG+F6LBNXWFg8UVmj+6reorQtjgK7g14HeDWvU97HA39eEXGcu7Zzyz OROyaKFs8sGtvUZJqvkHldYa4L++tnsz75Q59d0OxR+MtrdIfbThA1bEIdVXopXFpPeg g69Q== X-Gm-Message-State: AO0yUKVTycQMULfEx5S43Q+3+EEronqC0GMY3sznI2qzJZRaGk3o6PhB wD1ZYDyJy/tn4Qm2QY8llVja8R4mUKRP21fEo78BAKPDsCqKrKw8gfDd9mtxe/C0YeSnbMEt3MC DdSDsNwlHT9G3rLVuF/oTrH9YjX1iplpzQw== X-Received: by 2002:ac2:4c18:0:b0:4e9:d7b3:97a6 with SMTP id t24-20020ac24c18000000b004e9d7b397a6mr697343lfq.8.1679397586716; Tue, 21 Mar 2023 04:19:46 -0700 (PDT) X-Google-Smtp-Source: AK7set8mstacL17HQazfvx44MxaJlPtRFXgrhdgn2bXZewFVvdxOziBc4gn2H9g7HjW1STMeJjLIkv5bWfqQxpEcid0= X-Received: by 2002:ac2:4c18:0:b0:4e9:d7b3:97a6 with SMTP id t24-20020ac24c18000000b004e9d7b397a6mr697334lfq.8.1679397586443; Tue, 21 Mar 2023 04:19:46 -0700 (PDT) MIME-Version: 1.0 References: <6895974.e9J7NaK4W3@minbar> <25835488.EfDdHjke4D@minbar> In-Reply-To: <25835488.EfDdHjke4D@minbar> From: Jonathan Wakely Date: Tue, 21 Mar 2023 11:19:35 +0000 Message-ID: Subject: Re: [PATCH 2/2] libstdc++: Fix simd compilation with Clang To: Matthias Kretz Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000093b33705f767385c" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000093b33705f767385c Content-Type: text/plain; charset="UTF-8" On Tue, 21 Mar 2023 at 09:24, Matthias Kretz via Libstdc++ < libstdc++@gcc.gnu.org> wrote: > > > Clang fails to compile some constant expressions involving simd. > Therefore, just disable this non-conforming extension for clang. > > Fix AVX512 blend implementation for Clang. It was converting the bitmask > to bool before, which is obviously wrong. Instead use a Clang builtin to > convert the bitmask to vector-mask before using a vector blend ?:. A > similar change is required for the masked unary implementation, because > the GCC builtins do not exist on Clang. > > Signed-off-by: Matthias Kretz > > libstdc++-v3/ChangeLog: > > * include/experimental/bits/simd_detail.h: Don't declare the > simd API as constexpr with Clang. > * include/experimental/bits/simd_x86.h (__movm): New. > (_S_blend_avx512): Resolve FIXME. Implement blend using __movm > and ?:. > (_SimdImplX86::_S_masked_unary): Clang does not implement the > same builtins. Implement the function using __movm, ?:, and - > operators on vector_size types instead. > +#if (defined __STRICT_ANSI__ && __STRICT_ANSI__) || defined __clang__ We don't generally are about -Wundef so this could be simplified to: #if __STRICT_ANSI__ || defined __clang__ But it's OK as it is. OK for trunk. --00000000000093b33705f767385c--