From nobody Mon Sep 26 10:03:03 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 4MbdcK07Cwz4dbJG for ; Mon, 26 Sep 2022 10:03:13 +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 4MbdcJ0lKcz3YW0; Mon, 26 Sep 2022 10:03:12 +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 689CB5802D1; Mon, 26 Sep 2022 12:03:09 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_8AB4E2B0-A601-47B5-A484-B6BF430ABC73"; 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: Mon, 26 Sep 2022 12:03:03 +0200 Cc: Jan Beich , freebsd-current@freebsd.org Message-Id: <430A830E-3473-4EF4-9605-039F8254999C@FreeBSD.org> References: <1A903FD8-D904-4B91-ABC4-2F704F0E2CF4@FreeBSD.org> To: Christian Weisgerber X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Rspamd-Queue-Id: 4MbdcJ0lKcz3YW0 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_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-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=_8AB4E2B0-A601-47B5-A484-B6BF430ABC73 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 25 Sep 2022, at 23:38, Christian Weisgerber wrote: > > Dimitry Andric: > >>> 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. > > __AVX__, for instance, is not defined unless you compile with -mavx, > which also allows the compiler to issue AVX instructions during > normal code generation. Sure, but if you are compiling without -mavx, why would you want the AVX intrinsics? You cannot use AVX intrinsics anyway, if AVX is not enabled. So I don't fully understand the problem this configure scripting is supposed to solve? In my opinion, if you would want to know whether the compiler supports AVX in any mode, you would first attempt to run "$CC -mavx" and if that succeeds, run a test case which checks for the __AVX__ define. If both succeed, then AVX intrinsics work, otherwise they don't. Rinse and repeat for any other particular extension you would want to check. And should work for both clang and gcc. -Dimitry --Apple-Mail=_8AB4E2B0-A601-47B5-A484-B6BF430ABC73 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 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYzF41wAKCRCwXqMKLiCW o3MJAJ92D3yV4DrEbi0462z69A8A5OdjtwCgjm2hJohnFzfsjYb/SlcYQ/nHIpU= =mwlY -----END PGP SIGNATURE----- --Apple-Mail=_8AB4E2B0-A601-47B5-A484-B6BF430ABC73--