Closed kevlar700 closed 2 years ago
Why wouldn't you want to use Interfaces functions like shift without conversions as a user of the Hal crate?
The Shift_Left
Shift_Right
functions are available with the current code, without conversions.
Where are they? I can find the assembly from within Interfaces. I shall see if they somehow magically work within my codebase. Do you have to use Hal?
These functions are intrinsics, see definition in Interfaces
: https://github.com/Fabien-Chouteau/bare_runtime/blob/bd95e2b7d0911d72370e2f9abcd7c11d77690a75/src/interfac.ads#L89
The UInt8
, UInt16
and UInt32
type in HAL
inherit them from the Intrerfaces.Unsigned_
types.
We should actually declare those functions for all the other UInt*
types here.
Right, the shift/rotate ops are inherited when deriving from those types declared in Interfaces,, and are not otherwise defined for user-defined modular types. We could explicitly declare the functions, as intrinsics, or we could apply the GNAT-defined pragma Provide_Shift_Operators.
All committers have signed the CLA.