Function intAlignment [src]

Prototype

pub fn intAlignment(target: *const std.Target, bits: u16) u16

Parameters

target: *const std.Targetbits: u16

Source

pub fn intAlignment(target: *const std.Target, bits: u16) u16 { return switch (target.cpu.arch) { .x86 => switch (bits) { 0 => 0, 1...8 => 1, 9...16 => 2, 17...32 => 4, 33...64 => switch (target.os.tag) { .uefi, .windows => 8, else => 4, }, else => 16, }, .x86_64 => switch (bits) { 0 => 0, 1...8 => 1, 9...16 => 2, 17...32 => 4, 33...64 => 8, else => 16, }, else => return @min( std.math.ceilPowerOfTwoPromote(u16, @as(u16, @intCast((@as(u17, bits) + 7) / 8))), target.cMaxIntAlignment(), ), }; }