| ... | @@ -1688,12 +1688,6 @@ pub const Object = struct { | ... | @@ -1688,12 +1688,6 @@ pub const Object = struct { |
| 1688 | else | 1688 | else |
| 1689 | try wip.load(.normal, param_llvm_ty, arg_ptr, param_alignment, "")); | 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 | .float_array => { | 1691 | .float_array => { |
| 1698 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); | 1692 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); |
| 1699 | const param_llvm_ty = try o.lowerType(param_ty); | 1693 | const param_llvm_ty = try o.lowerType(param_ty); |
| ... | @@ -3096,7 +3090,6 @@ pub const Object = struct { | ... | @@ -3096,7 +3090,6 @@ pub const Object = struct { |
| 3096 | .no_bits, | 3090 | .no_bits, |
| 3097 | .abi_sized_int, | 3091 | .abi_sized_int, |
| 3098 | .multiple_llvm_types, | 3092 | .multiple_llvm_types, |
| 3099 | .as_u16, | | |
| 3100 | .float_array, | 3093 | .float_array, |
| 3101 | .i32_array, | 3094 | .i32_array, |
| 3102 | .i64_array, | 3095 | .i64_array, |
| ... | @@ -3771,9 +3764,6 @@ pub const Object = struct { | ... | @@ -3771,9 +3764,6 @@ pub const Object = struct { |
| 3771 | .multiple_llvm_types => { | 3764 | .multiple_llvm_types => { |
| 3772 | try llvm_params.appendSlice(o.gpa, it.types_buffer[0..it.types_len]); | 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 | .float_array => |count| { | 3767 | .float_array => |count| { |
| 3778 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); | 3768 | const param_ty = Type.fromInterned(fn_info.param_types.get(ip)[it.zig_index - 1]); |
| 3779 | const float_ty = try o.lowerType(aarch64_c_abi.getFloatArrayType(param_ty, zcu).?); | 3769 | const float_ty = try o.lowerType(aarch64_c_abi.getFloatArrayType(param_ty, zcu).?); |
| ... | @@ -5588,12 +5578,6 @@ pub const FuncGen = struct { | ... | @@ -5588,12 +5578,6 @@ pub const FuncGen = struct { |
| 5588 | llvm_args.appendAssumeCapacity(loaded); | 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 | .float_array => |count| { | 5581 | .float_array => |count| { |
| 5598 | const arg = args[it.zig_index - 1]; | 5582 | const arg = args[it.zig_index - 1]; |
| 5599 | const arg_ty = self.typeOf(arg); | 5583 | const arg_ty = self.typeOf(arg); |
| ... | @@ -5655,7 +5639,6 @@ pub const FuncGen = struct { | ... | @@ -5655,7 +5639,6 @@ pub const FuncGen = struct { |
| 5655 | .no_bits, | 5639 | .no_bits, |
| 5656 | .abi_sized_int, | 5640 | .abi_sized_int, |
| 5657 | .multiple_llvm_types, | 5641 | .multiple_llvm_types, |
| 5658 | .as_u16, | | |
| 5659 | .float_array, | 5642 | .float_array, |
| 5660 | .i32_array, | 5643 | .i32_array, |
| 5661 | .i64_array, | 5644 | .i64_array, |
| ... | @@ -11969,7 +11952,6 @@ const ParamTypeIterator = struct { | ... | @@ -11969,7 +11952,6 @@ const ParamTypeIterator = struct { |
| 11969 | abi_sized_int, | 11952 | abi_sized_int, |
| 11970 | multiple_llvm_types, | 11953 | multiple_llvm_types, |
| 11971 | slice, | 11954 | slice, |
| 11972 | as_u16, | | |
| 11973 | float_array: u8, | 11955 | float_array: u8, |
| 11974 | i32_array: u8, | 11956 | i32_array: u8, |
| 11975 | i64_array: u8, | 11957 | i64_array: u8, |
| ... | @@ -12091,8 +12073,6 @@ const ParamTypeIterator = struct { | ... | @@ -12091,8 +12073,6 @@ const ParamTypeIterator = struct { |
| 12091 | .riscv32, .riscv64 => { | 12073 | .riscv32, .riscv64 => { |
| 12092 | it.zig_index += 1; | 12074 | it.zig_index += 1; |
| 12093 | it.llvm_index += 1; | 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 | switch (riscv_c_abi.classifyType(ty, zcu)) { | 12076 | switch (riscv_c_abi.classifyType(ty, zcu)) { |
| 12097 | .memory => return .byref_mut, | 12077 | .memory => return .byref_mut, |
| 12098 | .byval => return .byval, | 12078 | .byval => return .byval, |
| ... | @@ -12440,7 +12420,8 @@ fn isScalar(zcu: *Zcu, ty: Type) bool { | ... | @@ -12440,7 +12420,8 @@ fn isScalar(zcu: *Zcu, ty: Type) bool { |
| 12440 | } | 12420 | } |
| 12441 | | 12421 | |
| 12442 | /// This function returns true if we expect LLVM to lower x86_fp80 correctly | 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 | fn backendSupportsF80(target: std.Target) bool { | 12425 | fn backendSupportsF80(target: std.Target) bool { |
| 12445 | return switch (target.cpu.arch) { | 12426 | return switch (target.cpu.arch) { |
| 12446 | .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float), | 12427 | .x86_64, .x86 => !std.Target.x86.featureSetHas(target.cpu.features, .soft_float), |
| ... | @@ -12449,8 +12430,8 @@ fn backendSupportsF80(target: std.Target) bool { | ... | @@ -12449,8 +12430,8 @@ fn backendSupportsF80(target: std.Target) bool { |
| 12449 | } | 12430 | } |
| 12450 | | 12431 | |
| 12451 | /// This function returns true if we expect LLVM to lower f16 correctly | 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 | 12433 | /// and false if we expect LLVM to crash if it encounters an f16 type, |
| 12453 | /// if it produces miscompilations. | 12434 | /// or if it produces miscompilations. |
| 12454 | fn backendSupportsF16(target: std.Target) bool { | 12435 | fn backendSupportsF16(target: std.Target) bool { |
| 12455 | return switch (target.cpu.arch) { | 12436 | return switch (target.cpu.arch) { |
| 12456 | // LoongArch can be removed from this list with LLVM 20. | 12437 | // LoongArch can be removed from this list with LLVM 20. |
| ... | @@ -12467,7 +12448,6 @@ fn backendSupportsF16(target: std.Target) bool { | ... | @@ -12467,7 +12448,6 @@ fn backendSupportsF16(target: std.Target) bool { |
| 12467 | .mipsel, | 12448 | .mipsel, |
| 12468 | .mips64, | 12449 | .mips64, |
| 12469 | .mips64el, | 12450 | .mips64el, |
| 12470 | .riscv32, | | |
| 12471 | .s390x, | 12451 | .s390x, |
| 12472 | => false, | 12452 | => false, |
| 12473 | .arm, | 12453 | .arm, |
| ... | @@ -12483,7 +12463,7 @@ fn backendSupportsF16(target: std.Target) bool { | ... | @@ -12483,7 +12463,7 @@ fn backendSupportsF16(target: std.Target) bool { |
| 12483 | } | 12463 | } |
| 12484 | | 12464 | |
| 12485 | /// This function returns true if we expect LLVM to lower f128 correctly, | 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 | /// or if it produces miscompilations. | 12467 | /// or if it produces miscompilations. |
| 12488 | fn backendSupportsF128(target: std.Target) bool { | 12468 | fn backendSupportsF128(target: std.Target) bool { |
| 12489 | return switch (target.cpu.arch) { | 12469 | return switch (target.cpu.arch) { |
| ... | @@ -12510,7 +12490,7 @@ fn backendSupportsF128(target: std.Target) bool { | ... | @@ -12510,7 +12490,7 @@ fn backendSupportsF128(target: std.Target) bool { |
| 12510 | } | 12490 | } |
| 12511 | | 12491 | |
| 12512 | /// LLVM does not support all relevant intrinsics for all targets, so we | 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 | fn intrinsicsAllowed(scalar_ty: Type, target: std.Target) bool { | 12494 | fn intrinsicsAllowed(scalar_ty: Type, target: std.Target) bool { |
| 12515 | return switch (scalar_ty.toIntern()) { | 12495 | return switch (scalar_ty.toIntern()) { |
| 12516 | .f16_type => backendSupportsF16(target), | 12496 | .f16_type => backendSupportsF16(target), |