lkml.org 
[lkml]   [2023]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] arm64/fpsimd: Only provide the length to cpufeature for xCR registers
On Fri, Jul 28, 2023 at 11:27:20AM +0100, Jonathan Cameron wrote:
> Mark Brown <broonie@kernel.org> wrote:

> > zcr = read_sysreg_s(SYS_ZCR_EL1);
> > - zcr &= ~(u64)ZCR_ELx_LEN_MASK; /* find sticky 1s outside LEN field */
> > + zcr &= ~(u64)ZCR_ELx_LEN_MASK;
> > vq_max = sve_vq_from_vl(sve_get_vl());
> > zcr |= vq_max - 1; /* set LEN field to maximum effective value */

> > - return zcr;
> > + return SYS_FIELD_GET(ZCR_ELx, LEN, zcr);

> Isn't that overly complex if we only end up with the length? (if I'm reading this right)
> Perhaps it is more logical to build the register then pull the
> field out of it, but it would be simpler as something like...

> return sve_vq_from_vl(sve_get_vl()) - 1;

We could, yes - I did prefer to keep it clear that this is an actual
if modified register value we're returning, though that could've been a
comment.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-07-28 13:55    [W:0.053 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site