authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-05 00:19:21-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-05 00:19:21-04:00
log5a35734a48fddec7fa58a10be01b045c49099145
tree4737ac3142ce17bf0036591c5b13105feb3681ce
parent644d943861ece8ef2c394bf4a4fdf0da9500c2cd

x86_64: fix abi bit/byte mixups


1 files changed, 7 insertions(+), 7 deletions(-)

src/arch/x86_64/abi.zig+7-7
......@@ -137,7 +137,7 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
137137 return result;
138138 },
139139 128 => {
140 // "Arguments of types__float128, _Decimal128 and__m128 are
140 // "Arguments of types __float128, _Decimal128 and __m128 are
141141 // split into two halves. The least significant ones belong
142142 // to class SSE, the most significant one to class SSEUP."
143143 if (ctx == .other) {
......@@ -213,9 +213,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
213213 const struct_type = mod.typeToStruct(ty).?;
214214 const ty_size = ty.abiSize(mod);
215215 if (struct_type.layout == .Packed) {
216 assert(ty_size <= 128);
216 assert(ty_size <= 16);
217217 result[0] = .integer;
218 if (ty_size > 64) result[1] = .integer;
218 if (ty_size > 8) result[1] = .integer;
219219 return result;
220220 }
221221 if (ty_size > 64)
......@@ -331,9 +331,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
331331 const union_obj = mod.typeToUnion(ty).?;
332332 const ty_size = mod.unionAbiSize(union_obj);
333333 if (union_obj.getLayout(ip) == .Packed) {
334 assert(ty_size <= 128);
334 assert(ty_size <= 16);
335335 result[0] = .integer;
336 if (ty_size > 64) result[1] = .integer;
336 if (ty_size > 8) result[1] = .integer;
337337 return result;
338338 }
339339 if (ty_size > 64)
......@@ -422,11 +422,11 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
422422 },
423423 .Array => {
424424 const ty_size = ty.abiSize(mod);
425 if (ty_size <= 64) {
425 if (ty_size <= 8) {
426426 result[0] = .integer;
427427 return result;
428428 }
429 if (ty_size <= 128) {
429 if (ty_size <= 16) {
430430 result[0] = .integer;
431431 result[1] = .integer;
432432 return result;