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.133.124]) by sourceware.org (Postfix) with ESMTPS id E81FD3858D37 for ; Tue, 21 Mar 2023 11:19:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E81FD3858D37 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=1679397589; 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=RN7xT/FgdIHtAFHlR1YTl0KxTNbfaNYeFK1+D4AhkLjFMYhMjMWipegN2edSZOicn16ARf M/LmSfZS15xonWvaRGxbcNNn/YvJ1Z1ffXnQ7zZHHAZvmPXShM/e3/XpgUWCh9n8o2RmtA my0zq8cO9mLs1NL/wy6QZ7EmOJx2HLA= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-50-I3HRO87zNHuvcqykf5jKwA-1; Tue, 21 Mar 2023 07:19:48 -0400 X-MC-Unique: I3HRO87zNHuvcqykf5jKwA-1 Received: by mail-lj1-f200.google.com with SMTP id k15-20020a2ea26f000000b0029a6cbad7baso3185779ljm.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=UE+5/XdXadHkSyAdJxCW02iIMP42bBzSvtyhasaIm352PZCNryIeXvkgqEqD++fTuG V71haNAoARi4lwOCjl6S55Ahlt4pQQo06+F50h5e2ffYBkaUP6LC5jk2soaNyt34T4WA 3Au6sPvDQvigV5clhmXb/OAfmeAyhrvHoJ0QzWnLmGt7n8ll0aNJRD2yd9lEaNsJcHv6 GFhmnFt/Ykkacke1SmhMdnDandb16G9up+FnQLkV+kBi9IyLx6Ak0SnDQaG/t/T3fEj4 9zxzhsk0JnaewOw4IpNJ976eplKjCfMfJkHh8wPh+CTB78JrPVKnxOzvTnLedjSYYQsy MVsw== X-Gm-Message-State: AO0yUKXgnD9fbxumsMt90eJxlbGQBxI+C7rfwqGfp9BJaLLREbm/lnlX xVoB9efvgKEvqtu0WJhgvygUAQhip0gKaNY+CVePxl81JBsf0EHS/OJsDZKNWS6KZSRa9USnmwk 8nO88yNPNEOpACY+yBe43BqodjYgiyXE= X-Received: by 2002:ac2:4c18:0:b0:4e9:d7b3:97a6 with SMTP id t24-20020ac24c18000000b004e9d7b397a6mr697344lfq.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=ham 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--