-
Notifications
You must be signed in to change notification settings - Fork 243
Open
Description
construct_uint! {
pub struct U64(2);
}
This piece of code generates some code that makes sense, like this:
/// Conversion to u32
#[inline]
pub const fn low_u32(&self) -> u32 {
let &U64(ref arr) = self;
arr[0] as u32
}
But mostly non-sensical like this:
pub struct U64(pub [u64; 2]);
It'd be nice if it recognized that 64/2 == 32
and generated [u32; 2]
instead.
The use case is SPIR-V target, which is technically 64-bit, but requires special capability in practice, which is not supported by some GPUs, so I need u64
that is a [u32; 2]
and u128
that is [u32; 4]
.
Metadata
Metadata
Assignees
Labels
No labels