[PATCH v2 04/42] arm64/sve: Make access to FFR optional

Mark Brown broonie at kernel.org
Tue Oct 19 08:31:13 PDT 2021


On Tue, Oct 19, 2021 at 03:39:11PM +0100, Mark Rutland wrote:
> On Tue, Oct 19, 2021 at 11:14:47AM +0100, Will Deacon wrote:

> > > +		sve_flush_live(true, vq_minus_one);

> > What does the pcs say about passing bools in registers? Can we guarantee
> > that false is a 64-bit zero?

> Per usual rules, bits [63:8] can be arbitrary -- AAPCS64 leaves it to the callee
> to extend values, with the upper bits being arbitrary, and it maps _Bool/bool
> to unsigned char, which covers bits [7:0].

> So a bool false in a register is not guaranteed to be a 64-bit zero. But
> since it *is* guarnateed to be either 0 or 1, we can use TBZ/TBNZ
> instead of CBZ/CBNZ. Either that, or extend it to a wider type in the
> function prototype.

I'll change it to tbz - if we use a wider type then people will notice
using true/false with it in the code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211019/cd852efc/attachment.sig>


More information about the linux-arm-kernel mailing list