| ... | ... | @@ -1688,12 +1688,6 @@ pub const Object = struct { |
| 1688 | 1688 | else |
| 1689 | 1689 | try wip.load(.normal, param_llvm_ty, arg_ptr, param_alignment, "")); |
| 1690 | 1690 | }, |
| 1691 | | .as_u16 => { |
| 1692 | | assert(!it.byval_attr); |
| 1693 | | const param = wip.arg(llvm_arg_i); |
| 1694 | | llvm_arg_i += 1; |
| 1695 | | args.appendAssumeCapacity(try wip.cast(.bitcast, param, .half, "")); |
| 1696 | | }, |
| 1697 | 1691 | .float_array => { |
| 1698 | 1692 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); |
| 1699 | 1693 | const param_llvm_ty = try o.lowerType(param_ty); |
| ... | ... | @@ -3096,7 +3090,6 @@ pub const Object = struct { |
| 3096 | 3090 | .no_bits, |
| 3097 | 3091 | .abi_sized_int, |
| 3098 | 3092 | .multiple_llvm_types, |
| 3099 | | .as_u16, |
| 3100 | 3093 | .float_array, |
| 3101 | 3094 | .i32_array, |
| 3102 | 3095 | .i64_array, |
| ... | ... | @@ -3771,9 +3764,6 @@ pub const Object = struct { |
| 3771 | 3764 | .multiple_llvm_types => { |
| 3772 | 3765 | try llvm_params.appendSlice(o.gpa, it.types_buffer[0..it.types_len]); |
| 3773 | 3766 | }, |
| 3774 | | .as_u16 => { |
| 3775 | | try llvm_params.append(o.gpa, .i16); |
| 3776 | | }, |
| 3777 | 3767 | .float_array => |count| { |
| 3778 | 3768 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); |
| 3779 | 3769 | const float_ty = try o.lowerType(aarch64_c_abi.getFloatArrayType(param_ty, zcu).?); |
| ... | ... | @@ -5588,12 +5578,6 @@ pub const FuncGen = struct { |
| 5588 | 5578 | llvm_args.appendAssumeCapacity(loaded); |
| 5589 | 5579 | } |
| 5590 | 5580 | }, |
| 5591 | | .as_u16 => { |
| 5592 | | const arg = args[it.zig_index - 1]; |
| 5593 | | const llvm_arg = try self.resolveInst(arg); |
| 5594 | | const casted = try self.wip.cast(.bitcast, llvm_arg, .i16, ""); |
| 5595 | | try llvm_args.append(casted); |
| 5596 | | }, |
| 5597 | 5581 | .float_array => |count| { |
| 5598 | 5582 | const arg = args[it.zig_index - 1]; |
| 5599 | 5583 | const arg_ty = self.typeOf(arg); |
| ... | ... | @@ -5655,7 +5639,6 @@ pub const FuncGen = struct { |
| 5655 | 5639 | .no_bits, |
| 5656 | 5640 | .abi_sized_int, |
| 5657 | 5641 | .multiple_llvm_types, |
| 5658 | | .as_u16, |
| 5659 | 5642 | .float_array, |
| 5660 | 5643 | .i32_array, |
| 5661 | 5644 | .i64_array, |
| ... | ... | @@ -11969,7 +11952,6 @@ const ParamTypeIterator = struct { |
| 11969 | 11952 | abi_sized_int, |
| 11970 | 11953 | multiple_llvm_types, |
| 11971 | 11954 | slice, |
| 11972 | | as_u16, |
| 11973 | 11955 | float_array: u8, |
| 11974 | 11956 | i32_array: u8, |
| 11975 | 11957 | i64_array: u8, |
| ... | ... | @@ -12091,8 +12073,6 @@ const ParamTypeIterator = struct { |
| 12091 | 12073 | .riscv32, .riscv64 => { |
| 12092 | 12074 | it.zig_index += 1; |
| 12093 | 12075 | it.llvm_index += 1; |
| 12094 | | if (ty.toIntern() == .f16_type and |
| 12095 | | !std.Target.riscv.featureSetHas(target.cpu.features, .d)) return .as_u16; |
| 12096 | 12076 | switch (riscv_c_abi.classifyType(ty, zcu)) { |
| 12097 | 12077 | .memory => return .byref_mut, |
| 12098 | 12078 | .byval => return .byval, |
| ... | ... | @@ -12440,7 +12420,8 @@ fn isScalar(zcu: *Zcu, ty: Type) bool { |
| 12440 | 12420 | } |
| 12441 | 12421 | |
| 12442 | 12422 | /// This function returns true if we expect LLVM to lower x86_fp80 correctly |
| 12443 | | /// and false if we expect LLVM to crash if it counters an x86_fp80 type. |
| 12423 | /// and false if we expect LLVM to crash if it encounters an x86_fp80 type, |
| 12424 | /// or if it produces miscompilations. |
| 12444 | 12425 | fn backendSupportsF80(target: std.Target) bool { |
| 12445 | 12426 | return switch (target.cpu.arch) { |
| 12446 | 12427 | .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float), |
| ... | ... | @@ -12449,8 +12430,8 @@ fn backendSupportsF80(target: std.Target) bool { |
| 12449 | 12430 | } |
| 12450 | 12431 | |
| 12451 | 12432 | /// This function returns true if we expect LLVM to lower f16 correctly |
| 12452 | | /// and false if we expect LLVM to crash if it counters an f16 type or |
| 12453 | | /// if it produces miscompilations. |
| 12433 | /// and false if we expect LLVM to crash if it encounters an f16 type, |
| 12434 | /// or if it produces miscompilations. |
| 12454 | 12435 | fn backendSupportsF16(target: std.Target) bool { |
| 12455 | 12436 | return switch (target.cpu.arch) { |
| 12456 | 12437 | // LoongArch can be removed from this list with LLVM 20. |
| ... | ... | @@ -12467,7 +12448,6 @@ fn backendSupportsF16(target: std.Target) bool { |
| 12467 | 12448 | .mipsel, |
| 12468 | 12449 | .mips64, |
| 12469 | 12450 | .mips64el, |
| 12470 | | .riscv32, |
| 12471 | 12451 | .s390x, |
| 12472 | 12452 | => false, |
| 12473 | 12453 | .arm, |
| ... | ... | @@ -12483,7 +12463,7 @@ fn backendSupportsF16(target: std.Target) bool { |
| 12483 | 12463 | } |
| 12484 | 12464 | |
| 12485 | 12465 | /// This function returns true if we expect LLVM to lower f128 correctly, |
| 12486 | | /// and false if we expect LLVm to crash if it encounters and f128 type |
| 12466 | /// and false if we expect LLVM to crash if it encounters an f128 type, |
| 12487 | 12467 | /// or if it produces miscompilations. |
| 12488 | 12468 | fn backendSupportsF128(target: std.Target) bool { |
| 12489 | 12469 | return switch (target.cpu.arch) { |
| ... | ... | @@ -12510,7 +12490,7 @@ fn backendSupportsF128(target: std.Target) bool { |
| 12510 | 12490 | } |
| 12511 | 12491 | |
| 12512 | 12492 | /// LLVM does not support all relevant intrinsics for all targets, so we |
| 12513 | | /// may need to manually generate a libc call |
| 12493 | /// may need to manually generate a compiler-rt call. |
| 12514 | 12494 | fn intrinsicsAllowed(scalar_ty: Type, target: std.Target) bool { |
| 12515 | 12495 | return switch (scalar_ty.toIntern()) { |
| 12516 | 12496 | .f16_type => backendSupportsF16(target), |