Many instructions have very similar structure of possible arguments (for example, ldr and str). Right now they define MakeLdr/Ldr<...> and MakeStr/Str<...> with macros and ldr/str functions.
Instead, we should define with macros common trait and type MakeLdrLikeArgs/LdrLikeArgs<...>, and define
pub struct<D, A> Ldr(LdrLikeArgs<D,A>);
pub fn ldr<D, A, RD, RA>(dst: D, addr: A) -> Ldr<RD, RA>
where LdrLikeArgs<RD, RA>: MakeLdrLikeArgs<D, A>
{
Ldr(LdrLikeArgs::make(dst, addr))
// or, perhaps, LdrLikeArgs::make(dst, addr, Ldr) to work with both fallible and unfallible variants
}
Failing variants of Make*-traits should be handled, though.
It should make the codebase smaller and reduce compilation time.
Many instructions have very similar structure of possible arguments (for example,
ldrandstr). Right now they defineMakeLdr/Ldr<...>andMakeStr/Str<...>with macros andldr/strfunctions.Instead, we should define with macros common trait and type
MakeLdrLikeArgs/LdrLikeArgs<...>, and defineFailing variants of
Make*-traits should be handled, though.It should make the codebase smaller and reduce compilation time.