lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <73e4e259-f933-461e-86df-08a08c150138@app.fastmail.com>
Date: Tue, 23 Jul 2024 09:26:59 +0000
From: "Arnd Bergmann" <arnd@...db.de>
To: "Yann Sionneau" <ysionneau@...rayinc.com>, linux-kernel@...r.kernel.org
Cc: "Jonathan Borne" <jborne@...rayinc.com>,
 "Julian Vetter" <jvetter@...rayinc.com>,
 "Clement Leger" <clement@...ment-leger.fr>,
 "Jules Maselbas" <jmaselbas@...v.net>,
 "Marius Gligor" <mgligor@...rayinc.com>
Subject: Re: [RFC PATCH v3 29/37] kvx: Add some library functions

> +static inline uint64x4_t uint64x2_divmod(uint64x2_t a, uint64x2_t b)
> +{
> +	float64x2_t double1 = 1.0 - (float64x2_t){};
> +	int64x2_t bbig = (int64x2_t)b < 0;
> +	int64x2_t bin01 = (uint64x2_t)b <= 1;
> +	int64x2_t special = bbig | bin01;
> +	// uint64x2_t q = bbig ? a >= b : a;
> +	uint64x2_t q = __builtin_kvx_selectdp(-(a >= b), a, bbig, ".nez");
> +	// uint64x2_t r = bbig ? a - (b&-q) : 0;
> +	uint64x2_t r = __builtin_kvx_selectdp(a - (b & -q), 0 - 
> (uint64x2_t){}, bbig, ".nez");
> +	float64x2_t doublea = __builtin_kvx_floatudp(a, 0, ".rn.s");
> +	float64x2_t doubleb = __builtin_kvx_floatudp(b, 0, ".rn.s");

How does this work with the use of floating point registers?
On most architectures, this is not allowed in the kernel in
order to avoid having to save/restore them on each context
switch. Does kvx use the same registers for integer and float
operations, or do you always save them?

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ