| author | |
| committer | |
| log | 5e0b4836a1f48181b0d6df2b272add5aa79654c3 |
| tree | 7ee97e61af253c029d90cd35b26cd03ef0747522 |
| parent | 8fa91939a880ac5394aaac457238251d2c937059 |
6 files changed, 138 insertions(+), 43 deletions(-)
src/arch/aarch64/abi.zig+2-2| ... | ... | @@ -10,13 +10,13 @@ pub const Class = union(enum) { |
| 10 | 10 | byval, |
| 11 | 11 | integer, |
| 12 | 12 | double_integer, |
| 13 | none, | |
| 14 | 13 | float_array: u8, |
| 15 | 14 | }; |
| 16 | 15 | |
| 17 | 16 | /// For `float_array` the second element will be the amount of floats. |
| 18 | 17 | pub fn classifyType(ty: Type, target: std.Target) Class { |
| 19 | if (!ty.hasRuntimeBitsIgnoreComptime()) return .none; | |
| 18 | std.debug.assert(ty.hasRuntimeBitsIgnoreComptime()); | |
| 19 | ||
| 20 | 20 | var maybe_float_bits: ?u16 = null; |
| 21 | 21 | switch (ty.zigTypeTag()) { |
| 22 | 22 | .Struct => { |
src/arch/arm/abi.zig+1-2| ... | ... | @@ -7,7 +7,6 @@ const Type = @import("../../type.zig").Type; |
| 7 | 7 | pub const Class = union(enum) { |
| 8 | 8 | memory, |
| 9 | 9 | byval, |
| 10 | none, | |
| 11 | 10 | i32_array: u8, |
| 12 | 11 | i64_array: u8, |
| 13 | 12 | |
| ... | ... | @@ -24,7 +23,7 @@ pub const Class = union(enum) { |
| 24 | 23 | pub const Context = enum { ret, arg }; |
| 25 | 24 | |
| 26 | 25 | pub fn classifyType(ty: Type, target: std.Target, ctx: Context) Class { |
| 27 | if (!ty.hasRuntimeBitsIgnoreComptime()) return .none; | |
| 26 | std.debug.assert(ty.hasRuntimeBitsIgnoreComptime()); | |
| 28 | 27 | |
| 29 | 28 | var maybe_float_bits: ?u16 = null; |
| 30 | 29 | const max_byval_size = 512; |
src/arch/riscv64/abi.zig+69| ... | ... | @@ -2,6 +2,75 @@ const std = @import("std"); |
| 2 | 2 | const bits = @import("bits.zig"); |
| 3 | 3 | const Register = bits.Register; |
| 4 | 4 | const RegisterManagerFn = @import("../../register_manager.zig").RegisterManager; |
| 5 | const Type = @import("../../type.zig").Type; | |
| 6 | ||
| 7 | pub const Class = enum { memory, byval, integer, double_integer }; | |
| 8 | ||
| 9 | pub fn classifyType(ty: Type, target: std.Target) Class { | |
| 10 | std.debug.assert(ty.hasRuntimeBitsIgnoreComptime()); | |
| 11 | ||
| 12 | const max_byval_size = target.cpu.arch.ptrBitWidth() * 2; | |
| 13 | switch (ty.zigTypeTag()) { | |
| 14 | .Struct => { | |
| 15 | const bit_size = ty.bitSize(target); | |
| 16 | if (ty.containerLayout() == .Packed) { | |
| 17 | if (bit_size > max_byval_size) return .memory; | |
| 18 | return .byval; | |
| 19 | } | |
| 20 | // TODO this doesn't exactly match what clang produces but its better than nothing | |
| 21 | if (bit_size > max_byval_size) return .memory; | |
| 22 | if (bit_size > max_byval_size / 2) return .double_integer; | |
| 23 | return .integer; | |
| 24 | }, | |
| 25 | .Union => { | |
| 26 | const bit_size = ty.bitSize(target); | |
| 27 | if (ty.containerLayout() == .Packed) { | |
| 28 | if (bit_size > max_byval_size) return .memory; | |
| 29 | return .byval; | |
| 30 | } | |
| 31 | // TODO this doesn't exactly match what clang produces but its better than nothing | |
| 32 | if (bit_size > max_byval_size) return .memory; | |
| 33 | if (bit_size > max_byval_size / 2) return .double_integer; | |
| 34 | return .integer; | |
| 35 | }, | |
| 36 | .Bool => return .integer, | |
| 37 | .Float => return .byval, | |
| 38 | .Int, .Enum, .ErrorSet => { | |
| 39 | const bit_size = ty.bitSize(target); | |
| 40 | if (bit_size > max_byval_size) return .memory; | |
| 41 | return .byval; | |
| 42 | }, | |
| 43 | .Vector => { | |
| 44 | const bit_size = ty.bitSize(target); | |
| 45 | if (bit_size > max_byval_size) return .memory; | |
| 46 | return .integer; | |
| 47 | }, | |
| 48 | .Optional => { | |
| 49 | std.debug.assert(ty.isPtrLikeOptional()); | |
| 50 | return .byval; | |
| 51 | }, | |
| 52 | .Pointer => { | |
| 53 | std.debug.assert(!ty.isSlice()); | |
| 54 | return .byval; | |
| 55 | }, | |
| 56 | .ErrorUnion, | |
| 57 | .Frame, | |
| 58 | .AnyFrame, | |
| 59 | .NoReturn, | |
| 60 | .Void, | |
| 61 | .Type, | |
| 62 | .ComptimeFloat, | |
| 63 | .ComptimeInt, | |
| 64 | .Undefined, | |
| 65 | .Null, | |
| 66 | .BoundFn, | |
| 67 | .Fn, | |
| 68 | .Opaque, | |
| 69 | .EnumLiteral, | |
| 70 | .Array, | |
| 71 | => unreachable, | |
| 72 | } | |
| 73 | } | |
| 5 | 74 | |
| 6 | 75 | pub const callee_preserved_regs = [_]Register{ |
| 7 | 76 | .s0, .s1, .s2, .s3, .s4, .s5, .s6, .s7, .s8, .s9, .s10, .s11, |
src/codegen/llvm.zig+45-15| ... | ... | @@ -25,6 +25,7 @@ const x86_64_abi = @import("../arch/x86_64/abi.zig"); |
| 25 | 25 | const wasm_c_abi = @import("../arch/wasm/abi.zig"); |
| 26 | 26 | const aarch64_c_abi = @import("../arch/aarch64/abi.zig"); |
| 27 | 27 | const arm_c_abi = @import("../arch/arm/abi.zig"); |
| 28 | const riscv_c_abi = @import("../arch/riscv64/abi.zig"); | |
| 28 | 29 | |
| 29 | 30 | const Error = error{ OutOfMemory, CodegenFail }; |
| 30 | 31 | |
| ... | ... | @@ -10117,8 +10118,9 @@ fn firstParamSRet(fn_info: Type.Payload.Function.Data, target: std.Target) bool |
| 10117 | 10118 | .arm, .armeb => switch (arm_c_abi.classifyType(fn_info.return_type, target, .ret)) { |
| 10118 | 10119 | .memory, .i64_array => return true, |
| 10119 | 10120 | .i32_array => |size| return size != 1, |
| 10120 | .none, .byval => return false, | |
| 10121 | .byval => return false, | |
| 10121 | 10122 | }, |
| 10123 | .riscv32, .riscv64 => return riscv_c_abi.classifyType(fn_info.return_type, target) == .memory, | |
| 10122 | 10124 | else => return false, // TODO investigate C ABI for other architectures |
| 10123 | 10125 | }, |
| 10124 | 10126 | else => return false, |
| ... | ... | @@ -10230,7 +10232,7 @@ fn lowerFnRetTy(dg: *DeclGen, fn_info: Type.Payload.Function.Data) !*llvm.Type { |
| 10230 | 10232 | }, |
| 10231 | 10233 | .aarch64, .aarch64_be => { |
| 10232 | 10234 | switch (aarch64_c_abi.classifyType(fn_info.return_type, target)) { |
| 10233 | .memory, .none => return dg.context.voidType(), | |
| 10235 | .memory => return dg.context.voidType(), | |
| 10234 | 10236 | .float_array => return dg.lowerType(fn_info.return_type), |
| 10235 | 10237 | .byval => return dg.lowerType(fn_info.return_type), |
| 10236 | 10238 | .integer => { |
| ... | ... | @@ -10249,7 +10251,23 @@ fn lowerFnRetTy(dg: *DeclGen, fn_info: Type.Payload.Function.Data) !*llvm.Type { |
| 10249 | 10251 | return dg.context.voidType(); |
| 10250 | 10252 | }, |
| 10251 | 10253 | .byval => return dg.lowerType(fn_info.return_type), |
| 10252 | .none => unreachable, | |
| 10254 | } | |
| 10255 | }, | |
| 10256 | .riscv32, .riscv64 => { | |
| 10257 | switch (riscv_c_abi.classifyType(fn_info.return_type, target)) { | |
| 10258 | .memory => return dg.context.voidType(), | |
| 10259 | .integer => { | |
| 10260 | const bit_size = fn_info.return_type.bitSize(target); | |
| 10261 | return dg.context.intType(@intCast(c_uint, bit_size)); | |
| 10262 | }, | |
| 10263 | .double_integer => { | |
| 10264 | var llvm_types_buffer: [2]*llvm.Type = .{ | |
| 10265 | dg.context.intType(64), | |
| 10266 | dg.context.intType(64), | |
| 10267 | }; | |
| 10268 | return dg.context.structType(&llvm_types_buffer, 2, .False); | |
| 10269 | }, | |
| 10270 | .byval => return dg.lowerType(fn_info.return_type), | |
| 10253 | 10271 | } |
| 10254 | 10272 | }, |
| 10255 | 10273 | // TODO investigate C ABI for other architectures |
| ... | ... | @@ -10328,15 +10346,6 @@ const ParamTypeIterator = struct { |
| 10328 | 10346 | .C => { |
| 10329 | 10347 | const is_scalar = isScalar(ty); |
| 10330 | 10348 | switch (it.target.cpu.arch) { |
| 10331 | .riscv32, .riscv64 => { | |
| 10332 | it.zig_index += 1; | |
| 10333 | it.llvm_index += 1; | |
| 10334 | if (ty.tag() == .f16) { | |
| 10335 | return .as_u16; | |
| 10336 | } else { | |
| 10337 | return .byval; | |
| 10338 | } | |
| 10339 | }, | |
| 10340 | 10349 | .mips, .mipsel => { |
| 10341 | 10350 | it.zig_index += 1; |
| 10342 | 10351 | it.llvm_index += 1; |
| ... | ... | @@ -10451,7 +10460,6 @@ const ParamTypeIterator = struct { |
| 10451 | 10460 | it.zig_index += 1; |
| 10452 | 10461 | it.llvm_index += 1; |
| 10453 | 10462 | switch (aarch64_c_abi.classifyType(ty, it.target)) { |
| 10454 | .none => unreachable, | |
| 10455 | 10463 | .memory => return .byref, |
| 10456 | 10464 | .float_array => |len| return Lowering{ .float_array = len }, |
| 10457 | 10465 | .byval => return .byval, |
| ... | ... | @@ -10467,7 +10475,6 @@ const ParamTypeIterator = struct { |
| 10467 | 10475 | it.zig_index += 1; |
| 10468 | 10476 | it.llvm_index += 1; |
| 10469 | 10477 | switch (arm_c_abi.classifyType(ty, it.target, .arg)) { |
| 10470 | .none => unreachable, | |
| 10471 | 10478 | .memory => { |
| 10472 | 10479 | it.byval_attr = true; |
| 10473 | 10480 | return .byref; |
| ... | ... | @@ -10477,6 +10484,21 @@ const ParamTypeIterator = struct { |
| 10477 | 10484 | .i64_array => |size| return Lowering{ .i64_array = size }, |
| 10478 | 10485 | } |
| 10479 | 10486 | }, |
| 10487 | .riscv32, .riscv64 => { | |
| 10488 | it.zig_index += 1; | |
| 10489 | it.llvm_index += 1; | |
| 10490 | if (ty.tag() == .f16) { | |
| 10491 | return .as_u16; | |
| 10492 | } | |
| 10493 | switch (riscv_c_abi.classifyType(ty, it.target)) { | |
| 10494 | .memory => { | |
| 10495 | return .byref; | |
| 10496 | }, | |
| 10497 | .byval => return .byval, | |
| 10498 | .integer => return .abi_sized_int, | |
| 10499 | .double_integer => return Lowering{ .i64_array = 2 }, | |
| 10500 | } | |
| 10501 | }, | |
| 10480 | 10502 | // TODO investigate C ABI for other architectures |
| 10481 | 10503 | else => { |
| 10482 | 10504 | it.zig_index += 1; |
| ... | ... | @@ -10523,8 +10545,16 @@ fn ccAbiPromoteInt( |
| 10523 | 10545 | }; |
| 10524 | 10546 | if (int_info.bits <= 16) return int_info.signedness; |
| 10525 | 10547 | switch (target.cpu.arch) { |
| 10548 | .riscv64 => { | |
| 10549 | if (int_info.bits == 32) { | |
| 10550 | // LLVM always signextends 32 bit ints, unsure if bug. | |
| 10551 | return .signed; | |
| 10552 | } | |
| 10553 | if (int_info.bits < 64) { | |
| 10554 | return int_info.signedness; | |
| 10555 | } | |
| 10556 | }, | |
| 10526 | 10557 | .sparc64, |
| 10527 | .riscv64, | |
| 10528 | 10558 | .powerpc64, |
| 10529 | 10559 | .powerpc64le, |
| 10530 | 10560 | => { |
test/c_abi/cfuncs.c+20-10| ... | ... | @@ -16,6 +16,10 @@ static void assert_or_panic(bool ok) { |
| 16 | 16 | # define ZIG_PPC32 |
| 17 | 17 | #endif |
| 18 | 18 | |
| 19 | #if defined __riscv && defined _ILP32 | |
| 20 | # define ZIG_RISCV32 | |
| 21 | #endif | |
| 22 | ||
| 19 | 23 | #ifdef __i386__ |
| 20 | 24 | # define ZIG_NO_I128 |
| 21 | 25 | #endif |
| ... | ... | @@ -32,6 +36,10 @@ static void assert_or_panic(bool ok) { |
| 32 | 36 | # define ZIG_NO_I128 |
| 33 | 37 | #endif |
| 34 | 38 | |
| 39 | #ifdef ZIG_RISCV32 | |
| 40 | # define ZIG_NO_I128 | |
| 41 | #endif | |
| 42 | ||
| 35 | 43 | #ifdef __i386__ |
| 36 | 44 | # define ZIG_NO_COMPLEX |
| 37 | 45 | #endif |
| ... | ... | @@ -48,6 +56,10 @@ static void assert_or_panic(bool ok) { |
| 48 | 56 | # define ZIG_NO_COMPLEX |
| 49 | 57 | #endif |
| 50 | 58 | |
| 59 | #ifdef __riscv | |
| 60 | # define ZIG_NO_COMPLEX | |
| 61 | #endif | |
| 62 | ||
| 51 | 63 | #ifndef ZIG_NO_I128 |
| 52 | 64 | struct i128 { |
| 53 | 65 | __int128 value; |
| ... | ... | @@ -265,7 +277,7 @@ void run_c_tests(void) { |
| 265 | 277 | } |
| 266 | 278 | #endif |
| 267 | 279 | |
| 268 | #if !defined __mips__ && !defined __riscv && !defined ZIG_PPC32 | |
| 280 | #if !defined __mips__ && !defined ZIG_PPC32 | |
| 269 | 281 | { |
| 270 | 282 | struct BigStruct s = {1, 2, 3, 4, 5}; |
| 271 | 283 | zig_big_struct(s); |
| ... | ... | @@ -273,7 +285,7 @@ void run_c_tests(void) { |
| 273 | 285 | #endif |
| 274 | 286 | |
| 275 | 287 | #if !defined __i386__ && !defined __arm__ && !defined __mips__ && \ |
| 276 | !defined __riscv && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 288 | !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 277 | 289 | { |
| 278 | 290 | struct SmallStructInts s = {1, 2, 3, 4}; |
| 279 | 291 | zig_small_struct_ints(s); |
| ... | ... | @@ -299,14 +311,14 @@ void run_c_tests(void) { |
| 299 | 311 | } |
| 300 | 312 | |
| 301 | 313 | #if !defined __i386__ && !defined __arm__ && !defined __mips__ && \ |
| 302 | !defined __riscv && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 314 | !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 303 | 315 | { |
| 304 | 316 | struct SplitStructInts s = {1234, 100, 1337}; |
| 305 | 317 | zig_split_struct_ints(s); |
| 306 | 318 | } |
| 307 | 319 | #endif |
| 308 | 320 | |
| 309 | #if !defined __arm__ && !defined __riscv && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 321 | #if !defined __arm__ && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 310 | 322 | { |
| 311 | 323 | struct MedStructMixed s = {1234, 100.0f, 1337.0f}; |
| 312 | 324 | zig_med_struct_mixed(s); |
| ... | ... | @@ -314,14 +326,14 @@ void run_c_tests(void) { |
| 314 | 326 | #endif |
| 315 | 327 | |
| 316 | 328 | #if !defined __i386__ && !defined __arm__ && !defined __mips__ && \ |
| 317 | !defined __riscv && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 329 | !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 318 | 330 | { |
| 319 | 331 | struct SplitStructMixed s = {1234, 100, 1337.0f}; |
| 320 | 332 | zig_split_struct_mixed(s); |
| 321 | 333 | } |
| 322 | 334 | #endif |
| 323 | 335 | |
| 324 | #if !defined __mips__ && !defined __riscv && !defined ZIG_PPC32 | |
| 336 | #if !defined __mips__ && !defined ZIG_PPC32 | |
| 325 | 337 | { |
| 326 | 338 | struct BigStruct s = {30, 31, 32, 33, 34}; |
| 327 | 339 | struct BigStruct res = zig_big_struct_both(s); |
| ... | ... | @@ -333,7 +345,7 @@ void run_c_tests(void) { |
| 333 | 345 | } |
| 334 | 346 | #endif |
| 335 | 347 | |
| 336 | #if !defined __riscv && !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 348 | #if !defined ZIG_PPC32 && !defined _ARCH_PPC64 | |
| 337 | 349 | { |
| 338 | 350 | struct Rect r1 = {1, 21, 16, 4}; |
| 339 | 351 | struct Rect r2 = {178, 189, 21, 15}; |
| ... | ... | @@ -341,7 +353,7 @@ void run_c_tests(void) { |
| 341 | 353 | } |
| 342 | 354 | #endif |
| 343 | 355 | |
| 344 | #if !defined __mips__ && !defined __riscv && !defined ZIG_PPC32 | |
| 356 | #if !defined __mips__ && !defined ZIG_PPC32 | |
| 345 | 357 | { |
| 346 | 358 | struct FloatRect r1 = {1, 21, 16, 4}; |
| 347 | 359 | struct FloatRect r2 = {178, 189, 21, 15}; |
| ... | ... | @@ -354,9 +366,7 @@ void run_c_tests(void) { |
| 354 | 366 | |
| 355 | 367 | assert_or_panic(zig_ret_u8() == 0xff); |
| 356 | 368 | assert_or_panic(zig_ret_u16() == 0xffff); |
| 357 | #ifndef __riscv | |
| 358 | 369 | assert_or_panic(zig_ret_u32() == 0xffffffff); |
| 359 | #endif | |
| 360 | 370 | assert_or_panic(zig_ret_u64() == 0xffffffffffffffff); |
| 361 | 371 | |
| 362 | 372 | assert_or_panic(zig_ret_i8() == -1); |
test/c_abi/main.zig+1-14| ... | ... | @@ -171,7 +171,7 @@ extern fn c_cmultf(a: ComplexFloat, b: ComplexFloat) ComplexFloat; |
| 171 | 171 | extern fn c_cmultd(a: ComplexDouble, b: ComplexDouble) ComplexDouble; |
| 172 | 172 | |
| 173 | 173 | const complex_abi_compatible = builtin.cpu.arch != .i386 and !builtin.cpu.arch.isMIPS() and |
| 174 | !builtin.cpu.arch.isARM() and !builtin.cpu.arch.isPPC(); | |
| 174 | !builtin.cpu.arch.isARM() and !builtin.cpu.arch.isPPC() and !builtin.cpu.arch.isRISCV(); | |
| 175 | 175 | |
| 176 | 176 | test "C ABI complex float" { |
| 177 | 177 | if (!complex_abi_compatible) return error.SkipZigTest; |
| ... | ... | @@ -265,7 +265,6 @@ extern fn c_big_struct(BigStruct) void; |
| 265 | 265 | |
| 266 | 266 | test "C ABI big struct" { |
| 267 | 267 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 268 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 269 | 268 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 270 | 269 | |
| 271 | 270 | var s = BigStruct{ |
| ... | ... | @@ -292,7 +291,6 @@ const BigUnion = extern union { |
| 292 | 291 | extern fn c_big_union(BigUnion) void; |
| 293 | 292 | |
| 294 | 293 | test "C ABI big union" { |
| 295 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 296 | 294 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 297 | 295 | |
| 298 | 296 | var x = BigUnion{ |
| ... | ... | @@ -327,7 +325,6 @@ extern fn c_ret_med_struct_mixed() MedStructMixed; |
| 327 | 325 | test "C ABI medium struct of ints and floats" { |
| 328 | 326 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 329 | 327 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 330 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 331 | 328 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 332 | 329 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 333 | 330 | |
| ... | ... | @@ -361,7 +358,6 @@ extern fn c_ret_small_struct_ints() SmallStructInts; |
| 361 | 358 | test "C ABI small struct of ints" { |
| 362 | 359 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 363 | 360 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 364 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 365 | 361 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 366 | 362 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 367 | 363 | |
| ... | ... | @@ -444,7 +440,6 @@ extern fn c_split_struct_ints(SplitStructInt) void; |
| 444 | 440 | test "C ABI split struct of ints" { |
| 445 | 441 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 446 | 442 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 447 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 448 | 443 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 449 | 444 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 450 | 445 | |
| ... | ... | @@ -473,7 +468,6 @@ extern fn c_ret_split_struct_mixed() SplitStructMixed; |
| 473 | 468 | test "C ABI split struct of ints and floats" { |
| 474 | 469 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 475 | 470 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 476 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 477 | 471 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 478 | 472 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 479 | 473 | |
| ... | ... | @@ -502,7 +496,6 @@ extern fn c_multiple_struct_floats(FloatRect, FloatRect) void; |
| 502 | 496 | |
| 503 | 497 | test "C ABI sret and byval together" { |
| 504 | 498 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 505 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 506 | 499 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 507 | 500 | |
| 508 | 501 | var s = BigStruct{ |
| ... | ... | @@ -555,7 +548,6 @@ extern fn c_big_struct_floats(Vector5) void; |
| 555 | 548 | |
| 556 | 549 | test "C ABI structs of floats as parameter" { |
| 557 | 550 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 558 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 559 | 551 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 560 | 552 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 561 | 553 | |
| ... | ... | @@ -596,7 +588,6 @@ export fn zig_multiple_struct_ints(x: Rect, y: Rect) void { |
| 596 | 588 | } |
| 597 | 589 | |
| 598 | 590 | test "C ABI structs of ints as multiple parameters" { |
| 599 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 600 | 591 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 601 | 592 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 602 | 593 | |
| ... | ... | @@ -635,7 +626,6 @@ export fn zig_multiple_struct_floats(x: FloatRect, y: FloatRect) void { |
| 635 | 626 | |
| 636 | 627 | test "C ABI structs of floats as multiple parameters" { |
| 637 | 628 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 638 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 639 | 629 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 640 | 630 | |
| 641 | 631 | var r1 = FloatRect{ |
| ... | ... | @@ -741,7 +731,6 @@ extern fn c_ret_struct_with_array() StructWithArray; |
| 741 | 731 | test "Struct with array as padding." { |
| 742 | 732 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 743 | 733 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 744 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 745 | 734 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 746 | 735 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 747 | 736 | |
| ... | ... | @@ -768,7 +757,6 @@ extern fn c_ret_float_array_struct() FloatArrayStruct; |
| 768 | 757 | |
| 769 | 758 | test "Float array like struct" { |
| 770 | 759 | if (comptime builtin.cpu.arch.isMIPS()) return error.SkipZigTest; |
| 771 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 772 | 760 | if (comptime builtin.cpu.arch.isPPC()) return error.SkipZigTest; |
| 773 | 761 | |
| 774 | 762 | c_float_array_struct(.{ |
| ... | ... | @@ -796,7 +784,6 @@ extern fn c_ret_small_vec() SmallVec; |
| 796 | 784 | |
| 797 | 785 | test "small simd vector" { |
| 798 | 786 | if (builtin.cpu.arch == .i386) return error.SkipZigTest; |
| 799 | if (comptime builtin.cpu.arch.isRISCV()) return error.SkipZigTest; | |
| 800 | 787 | if (comptime builtin.cpu.arch.isPPC64()) return error.SkipZigTest; |
| 801 | 788 | |
| 802 | 789 | c_small_vec(.{ 1, 2 }); |