On 02.09.2026 12:48, Oleksii Kurochko wrote:
> On 9/1/26 9:01 AM, Jan Beulich wrote:
>> And then
>>
>> #define INSN_16BIT_MASK                      0x3
>> #define INSN_32BIT_MASK                      0x1c
>>
>> are really named backwards, seeing e.g. their use in
> 
> It was derived from OpenSBI project and I haven't paid enough attention 
> for these defines.
> 
> Now looking at them again I fully agree that names here not really 
> correct. It should be according to the spec:
>     #define INSN_32BIT_MASK          0x3
>     #define INSN_48BIT_MASK          0x1c

Especially the latter would then still be misnamed, as the mask merely
identifies insns >= 48 bits. Even for the former I'd still question the
name to some degree ("mask" doesn't mean all of the bits need to be set).

In how many places are you going to need these constants? If, by suitably
using helpers, it's just one - maybe better to get away without any named
constants in this case (i.e. when suitable names are apparently difficult
to come up with)?

> I think that for now it is enough to go without common implmenntation of 
> INSN_LEN and just return 0 as suggested above.

Suitably commented upon that would certainly be okay with me.

Jan

Reply via email to