From nobody Sun Sep 25 20:46:47 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MbHyB16b3z4cvjJ for ; Sun, 25 Sep 2022 20:47:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (springbank.echomania.com [149.210.134.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "springbank.echomania.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MbHy82CfHz3XXj; Sun, 25 Sep 2022 20:47:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from smtpclient.apple (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 511DB580331; Sun, 25 Sep 2022 22:47:19 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_6A6C5323-8673-47D3-90AB-FAAB7E847848"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: Did clang 14 lose some intrinsics support? From: Dimitry Andric In-Reply-To: Date: Sun, 25 Sep 2022 22:46:47 +0200 Cc: Christian Weisgerber , freebsd-current@freebsd.org Message-Id: <1A903FD8-D904-4B91-ABC4-2F704F0E2CF4@FreeBSD.org> References: To: Jan Beich X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MbHy82CfHz3XXj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=softfail (mx1.freebsd.org: 149.210.134.147 is neither permitted nor denied by domain of dim@FreeBSD.org) smtp.mailfrom=dim@FreeBSD.org X-Spamd-Result: default: False [-3.70 / 15.00]; SIGNED_PGP(-2.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; MV_CASE(0.50)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:20857, ipnet:149.210.128.0/17, country:NL]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[dim]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; HAS_ATTACHMENT(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_6A6C5323-8673-47D3-90AB-FAAB7E847848 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 Sep 2022, at 21:02, Jan Beich wrote: > > Christian Weisgerber writes: > >> Did we lose support for SSSE3 and AVX2 intrinsics on amd64 with >> clang 14? > > __builtin_* appear unstable unlike _mm* intrinsics. Clang 15 seems > to hide more but I'm not sure about the cause (need bisecting). Yeah, these internal names are constantly changing. I don't know the reason for it, but it's terribly annoying when diagnosing failures with preprocessed files, as these tend to break when compiled with a much earlier or later copy of clang. > ===> clang version 15.0.1 > #define SSE2_SUPPORTED 1 > #define SSE_SUPPORTED 1 > > ===> clang version 15.0.1 with -march=native > #define AVX_SUPPORTED 1 > #define FMA_SUPPORTED 1 > #define SSE2_SUPPORTED 1 > #define SSE4_1_SUPPORTED 1 > #define SSE_SUPPORTED 1 > >> #if __has_builtin(__builtin_ia32_pabsd128) >> #define SSSE3_SUPPORTED 1 >> #endif > [...] >> #if __has_builtin(__builtin_ia32_pabsd256) >> #define AVX2_SUPPORTED 1 >> #endif > > See https://github.com/llvm/llvm-project/commit/e5147f82e1cb > > - Instead of __builtin_ia32_pabsd128 maybe use _mm_abs_epi32 > - Instead of __builtin_ia32_pabsd256 maybe use _mm256_abs_epi32 > I'm wondering why this rather fragile method is chosen? If you want to know whether SSE is supported, you check for __SSE__, and similarly __SSE2__, __AVX__ and a bunch of others. That is also portable to gcc. -Dimitry --Apple-Mail=_6A6C5323-8673-47D3-90AB-FAAB7E847848 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYzC+NwAKCRCwXqMKLiCW o7zLAJ4+KxyghfjJZriIcC2tPbhcZPQ7eACg8KGwhFatN/7MdCi+EC0cliBs9v8= =XJ7C -----END PGP SIGNATURE----- --Apple-Mail=_6A6C5323-8673-47D3-90AB-FAAB7E847848--