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 {...@@ -137,7 +137,7 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
137 return result;137 return result;
138 },138 },
139 128 => {139 128 => {
140 // "Arguments of types__float128, _Decimal128 and__m128 are140 // "Arguments of types __float128, _Decimal128 and __m128 are
141 // split into two halves. The least significant ones belong141 // split into two halves. The least significant ones belong
142 // to class SSE, the most significant one to class SSEUP."142 // to class SSE, the most significant one to class SSEUP."
143 if (ctx == .other) {143 if (ctx == .other) {
...@@ -213,9 +213,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {...@@ -213,9 +213,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
213 const struct_type = mod.typeToStruct(ty).?;213 const struct_type = mod.typeToStruct(ty).?;
214 const ty_size = ty.abiSize(mod);214 const ty_size = ty.abiSize(mod);
215 if (struct_type.layout == .Packed) {215 if (struct_type.layout == .Packed) {
216 assert(ty_size <= 128);216 assert(ty_size <= 16);
217 result[0] = .integer;217 result[0] = .integer;
218 if (ty_size > 64) result[1] = .integer;218 if (ty_size > 8) result[1] = .integer;
219 return result;219 return result;
220 }220 }
221 if (ty_size > 64)221 if (ty_size > 64)
...@@ -331,9 +331,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {...@@ -331,9 +331,9 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
331 const union_obj = mod.typeToUnion(ty).?;331 const union_obj = mod.typeToUnion(ty).?;
332 const ty_size = mod.unionAbiSize(union_obj);332 const ty_size = mod.unionAbiSize(union_obj);
333 if (union_obj.getLayout(ip) == .Packed) {333 if (union_obj.getLayout(ip) == .Packed) {
334 assert(ty_size <= 128);334 assert(ty_size <= 16);
335 result[0] = .integer;335 result[0] = .integer;
336 if (ty_size > 64) result[1] = .integer;336 if (ty_size > 8) result[1] = .integer;
337 return result;337 return result;
338 }338 }
339 if (ty_size > 64)339 if (ty_size > 64)
...@@ -422,11 +422,11 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {...@@ -422,11 +422,11 @@ pub fn classifySystemV(ty: Type, mod: *Module, ctx: Context) [8]Class {
422 },422 },
423 .Array => {423 .Array => {
424 const ty_size = ty.abiSize(mod);424 const ty_size = ty.abiSize(mod);
425 if (ty_size <= 64) {425 if (ty_size <= 8) {
426 result[0] = .integer;426 result[0] = .integer;
427 return result;427 return result;
428 }428 }
429 if (ty_size <= 128) {429 if (ty_size <= 16) {
430 result[0] = .integer;430 result[0] = .integer;
431 result[1] = .integer;431 result[1] = .integer;
432 return result;432 return result;