chore: add force align fn (used in arm32, turbo, and zba)
This commit is contained in:
parent
78b944a98f
commit
7ebaf2854a
|
@ -90,3 +90,7 @@ pub inline fn rotr(comptime T: type, x: T, r: anytype) T {
|
|||
const ar: Log2Int(T) = @intCast(@mod(r, @typeInfo(T).Int.bits));
|
||||
return x >> ar | x << (1 +% ~ar);
|
||||
}
|
||||
|
||||
pub inline fn alignAddr(comptime T: type, address: u32) u32 {
|
||||
return address & ~@as(u32, @sizeOf(T) - 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue