authorgravatar for topolarity@tapscott.meCody Tapscott <topolarity@tapscott.me> 2022-11-01 06:20:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-11-02 16:58:56-04:00
log98b60992b334df16db1c7f99be466d252d61c4bc
tree2794126e68b9b08afcc136b682301ba43b119e73
parente50789f1cb13522a3bdace2a2359711163c3fd55

stage2: Ensure f128 alignment matches c_longdouble alignment

On platforms where c_longdouble is 128-bits, interop with C code is simplified by making f128 match the alignment of c_longdouble. I intended to make this change as part of #13257, but I missed this part.

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

src/type.zig+4-1
...@@ -2919,7 +2919,10 @@ pub const Type = extern union {...@@ -2919,7 +2919,10 @@ pub const Type = extern union {
2919 return AbiAlignmentAdvanced{ .scalar = abiAlignment(u80_ty, target) };2919 return AbiAlignmentAdvanced{ .scalar = abiAlignment(u80_ty, target) };
2920 },2920 },
2921 },2921 },
2922 .f128 => return AbiAlignmentAdvanced{ .scalar = 16 },2922 .f128 => switch (CType.longdouble.sizeInBits(target)) {
2923 128 => return AbiAlignmentAdvanced{ .scalar = CType.longdouble.alignment(target) },
2924 else => return AbiAlignmentAdvanced{ .scalar = 16 },
2925 },
29232926
2924 // TODO revisit this when we have the concept of the error tag type2927 // TODO revisit this when we have the concept of the error tag type
2925 .anyerror_void_error_union,2928 .anyerror_void_error_union,