Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Paolo Bonzini
Il mer 21 mag 2025, 11:22 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > Perhaps it'd be simpler to contribute const-ability to upstream bilge? > Is From/Into the only problem trait? Probably. I was thinking we can generate > from/into associated methods for each type that

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Paolo Bonzini
Il mer 21 mag 2025, 13:12 Manos Pitsidianakis < manos.pitsidiana...@linaro.org> ha scritto: > On Wed, May 21, 2025 at 12:50 PM Alex > > > -_reserved_unpredictable: u4, > > > +#[bits(4)] > > > +_reserved_unpredictable: u8, > > > > This does come off as a little janky - effectively casti

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 12:50 PM Alex Bennée wrote: > > Paolo Bonzini writes: > > > The bilge crate, while very nice and espressive, is heavily reliant on > > traits; because trait functions are never const, bilge and const mix > > about as well as water and oil. > > > > Try using the bitfield-st

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 12:21 PM Manos Pitsidianakis wrote: > > On Wed, May 21, 2025 at 11:19 AM Paolo Bonzini wrote: > > > > The bilge crate, while very nice and espressive, is heavily reliant on > > traits; because trait functions are never const, bilge and const mix > > about as well as water

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Alex Bennée
Paolo Bonzini writes: > The bilge crate, while very nice and espressive, is heavily reliant on > traits; because trait functions are never const, bilge and const mix > about as well as water and oil. > > Try using the bitfield-struct crate instead. It is built to support > const very well and th

Re: [RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Manos Pitsidianakis
On Wed, May 21, 2025 at 11:19 AM Paolo Bonzini wrote: > > The bilge crate, while very nice and espressive, is heavily reliant on > traits; because trait functions are never const, bilge and const mix > about as well as water and oil. > > Try using the bitfield-struct crate instead. It is built to

[RFC PATCH 5/6] rust: pl011: switch from bilge to bitfield-struct

2025-05-21 Thread Paolo Bonzini
The bilge crate, while very nice and espressive, is heavily reliant on traits; because trait functions are never const, bilge and const mix about as well as water and oil. Try using the bitfield-struct crate instead. It is built to support const very well and the only downside is that more manual