diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-05 00:19:21 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-10-05 00:19:21 -0400 |
| commit | 5a35734a48fddec7fa58a10be01b045c49099145 (patch) | |
| tree | 4737ac3142ce17bf0036591c5b13105feb3681ce /src | |
| parent | 644d943861ece8ef2c394bf4a4fdf0da9500c2cd (diff) | |
| download | zig-5a35734a48fddec7fa58a10be01b045c49099145.tar.gz zig-5a35734a48fddec7fa58a10be01b045c49099145.zip | |
x86_64: fix abi bit/byte mixups
Diffstat (limited to 'src')
| -rw-r--r-- | src/arch/x86_64/abi.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/arch/x86_64/abi.zig b/src/arch/x86_64/abi.zig index 1794abeb0b..542e132c9c 100644 --- a/src/arch/x86_64/abi.zig +++ b/src/arch/x86_64/abi.zig @@ -137,7 +137,7 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class { return result; }, 128 => { - // "Arguments of types__float128, _Decimal128 and__m128 are + // "Arguments of types __float128, _Decimal128 and __m128 are // split into two halves. The least significant ones belong // to class SSE, the most significant one to class SSEUP." if (ctx == .other) { @@ -213,9 +213,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class { const struct_type = mod.typeToStruct(ty).?; const ty_size = ty.abiSize(mod); if (struct_type.layout == .Packed) { - assert(ty_size <= 128); + assert(ty_size <= 16); result[0] = .integer; - if (ty_size > 64) result[1] = .integer; + if (ty_size > 8) result[1] = .integer; return result; } if (ty_size > 64) @@ -331,9 +331,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class { const union_obj = mod.typeToUnion(ty).?; const ty_size = mod.unionAbiSize(union_obj); if (union_obj.getLayout(ip) == .Packed) { - assert(ty_size <= 128); + assert(ty_size <= 16); result[0] = .integer; - if (ty_size > 64) result[1] = .integer; + if (ty_size > 8) result[1] = .integer; return result; } if (ty_size > 64) @@ -422,11 +422,11 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class { }, .Array => { const ty_size = ty.abiSize(mod); - if (ty_size <= 64) { + if (ty_size <= 8) { result[0] = .integer; return result; } - if (ty_size <= 128) { + if (ty_size <= 16) { result[0] = .integer; result[1] = .integer; return result; |
