From owner-freebsd-questions@freebsd.org Wed Jun 19 09:32:54 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BFBB15B12AC for ; Wed, 19 Jun 2019 09:32:54 +0000 (UTC) (envelope-from ik@sjmulder.nl) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F41784D25 for ; Wed, 19 Jun 2019 09:32:51 +0000 (UTC) (envelope-from ik@sjmulder.nl) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 5912721B84; Wed, 19 Jun 2019 05:32:45 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 19 Jun 2019 05:32:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sjmulder.nl; h= date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= hXs+8Gf5WXc9ztHLWIJPj31fkvwZLtw/LgzrjCF1oJE=; b=gSeZk/LCVzXsB507 wJEEySPlU4do5un+LaFbnNVFhQuxz4VaIGC+OsA2tDjn/LyVh+i1FwHgMgm9uius Vggg/fVaScJ0AwEIetfse6sJxtHKkHqlEvpek+fsnl1oeI8Z9xrPNDoA1l+awAB2 jfwdLIEci8F5QxNe9BKHOwjGRNBmUPzWvV1gJqHFAbHq7fPH58t1iEyVhv221F0l BJWzkz4rZCQU57FIT72/sKszBAeufqnPebPwkgv50oXhs+At37ZncIdHiNRFHsO9 s57GC3ngYhke8tnvz2P0lD0uuO/Fm2eZkpsjTeW/vdaGiCE0AuMrMPZG1SO/f5rC NzUkIw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=hXs+8Gf5WXc9ztHLWIJPj31fkvwZLtw/LgzrjCF1o JE=; b=xwzndxC/QLa+ZX4lByyIEIpl6SpweRdNsQZhe1C40YHWsuBBRc+ov/1e/ ATl9WMpmv5vbHefsgRaQjanQxps4UUydmH/7EPt/f76/E4FG2Hm1ewzJMP7h2MpF j1wKbNfsT631xCvZbIvrhlq8hPEFE4QZsXZDkl8B/WpQ0tvygwfC7b/hK46KNrQF 2wZG07LU5hrJ7jrE5LjUh+3MUU39P55ImGW9PBXs1x4hux8D7WI1H1F2TKEc2LMq OPwBMbqUiK63dizQfGpBMNr1OxnBr+iwa5nD5PeNuEvupFYLYaPUg0CRhIlFXE96 fw6PGz0hUxMVle4PczGtfXaPom7Kw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddugddugeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkjghfofggtgfgsehtje ertdfjtddvnecuhfhrohhmpedfufhijhhmvghnucflrdcuofhulhguvghrfdcuoehikhes shhjmhhulhguvghrrdhnlheqnecuffhomhgrihhnpehinhhtvghlrdgtohhmpdifihhkih hpvgguihgrrdhorhhgnecukfhppedugeehrdduvdekrddvvdejrddukeejnecurfgrrhgr mhepmhgrihhlfhhrohhmpehikhesshhjmhhulhguvghrrdhnlhenucevlhhushhtvghruf hiiigvpedt X-ME-Proxy: Received: from BBLP-SMULDE.colo.betabit.nl (unknown [145.128.227.187]) by mail.messagingengine.com (Postfix) with ESMTPA id 7D762380084; Wed, 19 Jun 2019 05:32:44 -0400 (EDT) Date: Wed, 19 Jun 2019 11:32:49 +0200 From: "Sijmen J. Mulder" To: mayuresh@kathe.in Cc: freebsd-questions@freebsd.org Subject: Re: How are modern processor instructions exposed to userland? Message-Id: <20190619113249.09852c139fe41b79abca8dcd@sjmulder.nl> In-Reply-To: <4b320042bd82ffe9b7793b62719d06f0@kathe.in> References: <4b320042bd82ffe9b7793b62719d06f0@kathe.in> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 3F41784D25 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=sjmulder.nl header.s=fm2 header.b=gSeZk/LC; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=xwzndxC/; spf=pass (mx1.freebsd.org: domain of ik@sjmulder.nl designates 66.111.4.25 as permitted sender) smtp.mailfrom=ik@sjmulder.nl X-Spamd-Result: default: False [-5.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[sjmulder.nl:s=fm2,messagingengine.com:s=fm3]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.25]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[sjmulder.nl]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[sjmulder.nl:+,messagingengine.com:+]; RCPT_COUNT_TWO(0.00)[2]; MX_GOOD(-0.01)[in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-3.46)[ip: (-9.43), ipnet: 66.111.4.0/24(-4.74), asn: 11403(-3.08), country: US(-0.06)]; RCVD_IN_DNSWL_LOW(-0.10)[25.4.111.66.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jun 2019 09:32:54 -0000 Mayuresh Kathe wrote: > Let's think about the AVX-512 instruction introduced with the latest > Intel Core i9 Skylake-X processor. > I wanted to know how one could use such capabilities via regular C. Unprivileged instructions (like these) are available to all processes. C compilers can and do already emit them when targeting a CPU that supports them (see the "-march" flag). You can also use instrinsics: https://en.wikipedia.org/wiki/Intrinsic_function https://software.intel.com/sites/landingpage/IntrinsicsGuide/ Sijmen