Skip to content

Commit 50339f5

Browse files
BratishkaErikandrewrk
authored andcommitted
all: zig fmt and rename "@xtoy" to "@YFromX"
Signed-off-by: Eric Joldasov <[email protected]>
1 parent a6c8ee5 commit 50339f5

File tree

665 files changed

+6214
-5899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

665 files changed

+6214
-5899
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ set(ZIG_STAGE2_SOURCES
376376
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfdi.zig"
377377
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfsi.zig"
378378
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/fixxfti.zig"
379-
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/float_to_int.zig"
379+
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/int_from_float.zig"
380380
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdidf.zig"
381381
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdihf.zig"
382382
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/floatdisf.zig"
@@ -417,7 +417,7 @@ set(ZIG_STAGE2_SOURCES
417417
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/getf2.zig"
418418
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/gexf2.zig"
419419
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/int.zig"
420-
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/int_to_float.zig"
420+
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/float_from_int.zig"
421421
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log.zig"
422422
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log10.zig"
423423
"${CMAKE_SOURCE_DIR}/lib/compiler_rt/log2.zig"

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
487487
.cpu_arch = .wasm32,
488488
.os_tag = .wasi,
489489
};
490-
target.cpu_features_add.addFeature(@enumToInt(std.Target.wasm.Feature.bulk_memory));
490+
target.cpu_features_add.addFeature(@intFromEnum(std.Target.wasm.Feature.bulk_memory));
491491

492492
const exe = addCompilerStep(b, .ReleaseSmall, target);
493493

doc/langref.html.in

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

lib/compiler_rt.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ comptime {
5555
_ = @import("compiler_rt/trunctfdf2.zig");
5656
_ = @import("compiler_rt/trunctfxf2.zig");
5757

58-
_ = @import("compiler_rt/float_to_int.zig");
58+
_ = @import("compiler_rt/int_from_float.zig");
5959
_ = @import("compiler_rt/fixhfsi.zig");
6060
_ = @import("compiler_rt/fixhfdi.zig");
6161
_ = @import("compiler_rt/fixhfti.zig");
@@ -87,7 +87,7 @@ comptime {
8787
_ = @import("compiler_rt/fixunsxfdi.zig");
8888
_ = @import("compiler_rt/fixunsxfti.zig");
8989

90-
_ = @import("compiler_rt/int_to_float.zig");
90+
_ = @import("compiler_rt/float_from_int.zig");
9191
_ = @import("compiler_rt/floatsihf.zig");
9292
_ = @import("compiler_rt/floatsisf.zig");
9393
_ = @import("compiler_rt/floatsidf.zig");

lib/compiler_rt/aarch64_outline_atomics.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const always_has_lse = std.Target.aarch64.featureSetHas(builtin.cpu.features, .l
88
/// It is intentionally not exported in order to make the machine code that
99
/// uses it a statically predicted direct branch rather than using the PLT,
1010
/// which ARM is concerned would have too much overhead.
11-
var __aarch64_have_lse_atomics: u8 = @boolToInt(always_has_lse);
11+
var __aarch64_have_lse_atomics: u8 = @intFromBool(always_has_lse);
1212

1313
fn __aarch64_cas1_relax() align(16) callconv(.Naked) void {
1414
@setRuntimeSafety(false);

lib/compiler_rt/atomics.zig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,21 +119,21 @@ var spinlocks: SpinlockTable = SpinlockTable{};
119119

120120
fn __atomic_load(size: u32, src: [*]u8, dest: [*]u8, model: i32) callconv(.C) void {
121121
_ = model;
122-
var sl = spinlocks.get(@ptrToInt(src));
122+
var sl = spinlocks.get(@intFromPtr(src));
123123
defer sl.release();
124124
@memcpy(dest[0..size], src);
125125
}
126126

127127
fn __atomic_store(size: u32, dest: [*]u8, src: [*]u8, model: i32) callconv(.C) void {
128128
_ = model;
129-
var sl = spinlocks.get(@ptrToInt(dest));
129+
var sl = spinlocks.get(@intFromPtr(dest));
130130
defer sl.release();
131131
@memcpy(dest[0..size], src);
132132
}
133133

134134
fn __atomic_exchange(size: u32, ptr: [*]u8, val: [*]u8, old: [*]u8, model: i32) callconv(.C) void {
135135
_ = model;
136-
var sl = spinlocks.get(@ptrToInt(ptr));
136+
var sl = spinlocks.get(@intFromPtr(ptr));
137137
defer sl.release();
138138
@memcpy(old[0..size], ptr);
139139
@memcpy(ptr[0..size], val);
@@ -149,7 +149,7 @@ fn __atomic_compare_exchange(
149149
) callconv(.C) i32 {
150150
_ = success;
151151
_ = failure;
152-
var sl = spinlocks.get(@ptrToInt(ptr));
152+
var sl = spinlocks.get(@intFromPtr(ptr));
153153
defer sl.release();
154154
for (ptr[0..size], 0..) |b, i| {
155155
if (expected[i] != b) break;
@@ -168,7 +168,7 @@ fn __atomic_compare_exchange(
168168
inline fn atomic_load_N(comptime T: type, src: *T, model: i32) T {
169169
_ = model;
170170
if (@sizeOf(T) > largest_atomic_size) {
171-
var sl = spinlocks.get(@ptrToInt(src));
171+
var sl = spinlocks.get(@intFromPtr(src));
172172
defer sl.release();
173173
return src.*;
174174
} else {
@@ -199,7 +199,7 @@ fn __atomic_load_16(src: *u128, model: i32) callconv(.C) u128 {
199199
inline fn atomic_store_N(comptime T: type, dst: *T, value: T, model: i32) void {
200200
_ = model;
201201
if (@sizeOf(T) > largest_atomic_size) {
202-
var sl = spinlocks.get(@ptrToInt(dst));
202+
var sl = spinlocks.get(@intFromPtr(dst));
203203
defer sl.release();
204204
dst.* = value;
205205
} else {
@@ -230,9 +230,9 @@ fn __atomic_store_16(dst: *u128, value: u128, model: i32) callconv(.C) void {
230230
fn wideUpdate(comptime T: type, ptr: *T, val: T, update: anytype) T {
231231
const WideAtomic = std.meta.Int(.unsigned, smallest_atomic_fetch_exch_size * 8);
232232

233-
const addr = @ptrToInt(ptr);
233+
const addr = @intFromPtr(ptr);
234234
const wide_addr = addr & ~(@as(T, smallest_atomic_fetch_exch_size) - 1);
235-
const wide_ptr = @alignCast(smallest_atomic_fetch_exch_size, @intToPtr(*WideAtomic, wide_addr));
235+
const wide_ptr = @alignCast(smallest_atomic_fetch_exch_size, @ptrFromInt(*WideAtomic, wide_addr));
236236

237237
const inner_offset = addr & (@as(T, smallest_atomic_fetch_exch_size) - 1);
238238
const inner_shift = @intCast(std.math.Log2Int(T), inner_offset * 8);
@@ -255,7 +255,7 @@ fn wideUpdate(comptime T: type, ptr: *T, val: T, update: anytype) T {
255255
inline fn atomic_exchange_N(comptime T: type, ptr: *T, val: T, model: i32) T {
256256
_ = model;
257257
if (@sizeOf(T) > largest_atomic_size) {
258-
var sl = spinlocks.get(@ptrToInt(ptr));
258+
var sl = spinlocks.get(@intFromPtr(ptr));
259259
defer sl.release();
260260
const value = ptr.*;
261261
ptr.* = val;
@@ -305,7 +305,7 @@ inline fn atomic_compare_exchange_N(
305305
_ = success;
306306
_ = failure;
307307
if (@sizeOf(T) > largest_atomic_size) {
308-
var sl = spinlocks.get(@ptrToInt(ptr));
308+
var sl = spinlocks.get(@intFromPtr(ptr));
309309
defer sl.release();
310310
const value = ptr.*;
311311
if (value == expected.*) {
@@ -362,7 +362,7 @@ inline fn fetch_op_N(comptime T: type, comptime op: std.builtin.AtomicRmwOp, ptr
362362
};
363363

364364
if (@sizeOf(T) > largest_atomic_size) {
365-
var sl = spinlocks.get(@ptrToInt(ptr));
365+
var sl = spinlocks.get(@intFromPtr(ptr));
366366
defer sl.release();
367367

368368
const value = ptr.*;

lib/compiler_rt/clear_cache.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {
6363
.addr = start,
6464
.len = end - start,
6565
};
66-
const result = sysarch(ARM_SYNC_ICACHE, @ptrToInt(&arg));
66+
const result = sysarch(ARM_SYNC_ICACHE, @intFromPtr(&arg));
6767
std.debug.assert(result == 0);
6868
exportIt();
6969
},

lib/compiler_rt/cmpdf2.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ comptime {
2626
/// Note that this matches the definition of `__ledf2`, `__eqdf2`, `__nedf2`, `__cmpdf2`,
2727
/// and `__ltdf2`.
2828
fn __cmpdf2(a: f64, b: f64) callconv(.C) i32 {
29-
return @enumToInt(comparef.cmpf2(f64, comparef.LE, a, b));
29+
return @intFromEnum(comparef.cmpf2(f64, comparef.LE, a, b));
3030
}
3131

3232
/// "These functions return a value less than or equal to zero if neither argument is NaN,
@@ -56,13 +56,13 @@ pub fn __ltdf2(a: f64, b: f64) callconv(.C) i32 {
5656
}
5757

5858
fn __aeabi_dcmpeq(a: f64, b: f64) callconv(.AAPCS) i32 {
59-
return @boolToInt(comparef.cmpf2(f64, comparef.LE, a, b) == .Equal);
59+
return @intFromBool(comparef.cmpf2(f64, comparef.LE, a, b) == .Equal);
6060
}
6161

6262
fn __aeabi_dcmplt(a: f64, b: f64) callconv(.AAPCS) i32 {
63-
return @boolToInt(comparef.cmpf2(f64, comparef.LE, a, b) == .Less);
63+
return @intFromBool(comparef.cmpf2(f64, comparef.LE, a, b) == .Less);
6464
}
6565

6666
fn __aeabi_dcmple(a: f64, b: f64) callconv(.AAPCS) i32 {
67-
return @boolToInt(comparef.cmpf2(f64, comparef.LE, a, b) != .Greater);
67+
return @intFromBool(comparef.cmpf2(f64, comparef.LE, a, b) != .Greater);
6868
}

lib/compiler_rt/cmphf2.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ comptime {
2020
/// Note that this matches the definition of `__lehf2`, `__eqhf2`, `__nehf2`, `__cmphf2`,
2121
/// and `__lthf2`.
2222
fn __cmphf2(a: f16, b: f16) callconv(.C) i32 {
23-
return @enumToInt(comparef.cmpf2(f16, comparef.LE, a, b));
23+
return @intFromEnum(comparef.cmpf2(f16, comparef.LE, a, b));
2424
}
2525

2626
/// "These functions return a value less than or equal to zero if neither argument is NaN,

lib/compiler_rt/cmpsf2.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ comptime {
2626
/// Note that this matches the definition of `__lesf2`, `__eqsf2`, `__nesf2`, `__cmpsf2`,
2727
/// and `__ltsf2`.
2828
fn __cmpsf2(a: f32, b: f32) callconv(.C) i32 {
29-
return @enumToInt(comparef.cmpf2(f32, comparef.LE, a, b));
29+
return @intFromEnum(comparef.cmpf2(f32, comparef.LE, a, b));
3030
}
3131

3232
/// "These functions return a value less than or equal to zero if neither argument is NaN,
@@ -56,13 +56,13 @@ pub fn __ltsf2(a: f32, b: f32) callconv(.C) i32 {
5656
}
5757

5858
fn __aeabi_fcmpeq(a: f32, b: f32) callconv(.AAPCS) i32 {
59-
return @boolToInt(comparef.cmpf2(f32, comparef.LE, a, b) == .Equal);
59+
return @intFromBool(comparef.cmpf2(f32, comparef.LE, a, b) == .Equal);
6060
}
6161

6262
fn __aeabi_fcmplt(a: f32, b: f32) callconv(.AAPCS) i32 {
63-
return @boolToInt(comparef.cmpf2(f32, comparef.LE, a, b) == .Less);
63+
return @intFromBool(comparef.cmpf2(f32, comparef.LE, a, b) == .Less);
6464
}
6565

6666
fn __aeabi_fcmple(a: f32, b: f32) callconv(.AAPCS) i32 {
67-
return @boolToInt(comparef.cmpf2(f32, comparef.LE, a, b) != .Greater);
67+
return @intFromBool(comparef.cmpf2(f32, comparef.LE, a, b) != .Greater);
6868
}

lib/compiler_rt/cmptf2.zig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ comptime {
3434
/// Note that this matches the definition of `__letf2`, `__eqtf2`, `__netf2`, `__cmptf2`,
3535
/// and `__lttf2`.
3636
fn __cmptf2(a: f128, b: f128) callconv(.C) i32 {
37-
return @enumToInt(comparef.cmpf2(f128, comparef.LE, a, b));
37+
return @intFromEnum(comparef.cmpf2(f128, comparef.LE, a, b));
3838
}
3939

4040
/// "These functions return a value less than or equal to zero if neither argument is NaN,
@@ -71,34 +71,34 @@ const SparcFCMP = enum(i32) {
7171
};
7272

7373
fn _Qp_cmp(a: *const f128, b: *const f128) callconv(.C) i32 {
74-
return @enumToInt(comparef.cmpf2(f128, SparcFCMP, a.*, b.*));
74+
return @intFromEnum(comparef.cmpf2(f128, SparcFCMP, a.*, b.*));
7575
}
7676

7777
fn _Qp_feq(a: *const f128, b: *const f128) callconv(.C) bool {
78-
return @intToEnum(SparcFCMP, _Qp_cmp(a, b)) == .Equal;
78+
return @enumFromInt(SparcFCMP, _Qp_cmp(a, b)) == .Equal;
7979
}
8080

8181
fn _Qp_fne(a: *const f128, b: *const f128) callconv(.C) bool {
82-
return @intToEnum(SparcFCMP, _Qp_cmp(a, b)) != .Equal;
82+
return @enumFromInt(SparcFCMP, _Qp_cmp(a, b)) != .Equal;
8383
}
8484

8585
fn _Qp_flt(a: *const f128, b: *const f128) callconv(.C) bool {
86-
return @intToEnum(SparcFCMP, _Qp_cmp(a, b)) == .Less;
86+
return @enumFromInt(SparcFCMP, _Qp_cmp(a, b)) == .Less;
8787
}
8888

8989
fn _Qp_fgt(a: *const f128, b: *const f128) callconv(.C) bool {
90-
return @intToEnum(SparcFCMP, _Qp_cmp(a, b)) == .Greater;
90+
return @enumFromInt(SparcFCMP, _Qp_cmp(a, b)) == .Greater;
9191
}
9292

9393
fn _Qp_fge(a: *const f128, b: *const f128) callconv(.C) bool {
94-
return switch (@intToEnum(SparcFCMP, _Qp_cmp(a, b))) {
94+
return switch (@enumFromInt(SparcFCMP, _Qp_cmp(a, b))) {
9595
.Equal, .Greater => true,
9696
.Less, .Unordered => false,
9797
};
9898
}
9999

100100
fn _Qp_fle(a: *const f128, b: *const f128) callconv(.C) bool {
101-
return switch (@intToEnum(SparcFCMP, _Qp_cmp(a, b))) {
101+
return switch (@enumFromInt(SparcFCMP, _Qp_cmp(a, b))) {
102102
.Equal, .Less => true,
103103
.Greater, .Unordered => false,
104104
};

lib/compiler_rt/cmpxf2.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ comptime {
2020
/// Note that this matches the definition of `__lexf2`, `__eqxf2`, `__nexf2`, `__cmpxf2`,
2121
/// and `__ltxf2`.
2222
fn __cmpxf2(a: f80, b: f80) callconv(.C) i32 {
23-
return @enumToInt(comparef.cmp_f80(comparef.LE, a, b));
23+
return @intFromEnum(comparef.cmp_f80(comparef.LE, a, b));
2424
}
2525

2626
/// "These functions return a value less than or equal to zero if neither argument is NaN,

lib/compiler_rt/comparef.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub inline fn cmp_f80(comptime RT: type, a: f80, b: f80) RT {
7777
if ((a_rep.fraction | b_rep.fraction) | ((a_rep.exp | b_rep.exp) & special_exp) == 0)
7878
return .Equal;
7979

80-
if (@boolToInt(a_rep.exp == b_rep.exp) & @boolToInt(a_rep.fraction == b_rep.fraction) != 0) {
80+
if (@intFromBool(a_rep.exp == b_rep.exp) & @intFromBool(a_rep.fraction == b_rep.fraction) != 0) {
8181
return .Equal;
8282
} else if (a_rep.exp & sign_bit != b_rep.exp & sign_bit) {
8383
// signs are different
@@ -109,7 +109,7 @@ pub inline fn unordcmp(comptime T: type, a: T, b: T) i32 {
109109
const aAbs: rep_t = @bitCast(rep_t, a) & absMask;
110110
const bAbs: rep_t = @bitCast(rep_t, b) & absMask;
111111

112-
return @boolToInt(aAbs > infRep or bAbs > infRep);
112+
return @intFromBool(aAbs > infRep or bAbs > infRep);
113113
}
114114

115115
test {

lib/compiler_rt/divdf3.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ inline fn div(a: f64, b: f64) f64 {
199199
} else if (writtenExponent < 1) {
200200
if (writtenExponent == 0) {
201201
// Check whether the rounded result is normal.
202-
const round = @boolToInt((residual << 1) > bSignificand);
202+
const round = @intFromBool((residual << 1) > bSignificand);
203203
// Clear the implicit bit.
204204
var absResult = quotient & significandMask;
205205
// Round.
@@ -213,7 +213,7 @@ inline fn div(a: f64, b: f64) f64 {
213213
// code to round them correctly.
214214
return @bitCast(f64, quotientSign);
215215
} else {
216-
const round = @boolToInt((residual << 1) > bSignificand);
216+
const round = @intFromBool((residual << 1) > bSignificand);
217217
// Clear the implicit bit
218218
var absResult = quotient & significandMask;
219219
// Insert the exponent

lib/compiler_rt/divsf3.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ inline fn div(a: f32, b: f32) f32 {
179179
} else if (writtenExponent < 1) {
180180
if (writtenExponent == 0) {
181181
// Check whether the rounded result is normal.
182-
const round = @boolToInt((residual << 1) > bSignificand);
182+
const round = @intFromBool((residual << 1) > bSignificand);
183183
// Clear the implicit bit.
184184
var absResult = quotient & significandMask;
185185
// Round.
@@ -193,7 +193,7 @@ inline fn div(a: f32, b: f32) f32 {
193193
// code to round them correctly.
194194
return @bitCast(f32, quotientSign);
195195
} else {
196-
const round = @boolToInt((residual << 1) > bSignificand);
196+
const round = @intFromBool((residual << 1) > bSignificand);
197197
// Clear the implicit bit
198198
var absResult = quotient & significandMask;
199199
// Insert the exponent

lib/compiler_rt/divtf3.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ inline fn div(a: f128, b: f128) f128 {
214214
} else if (writtenExponent < 1) {
215215
if (writtenExponent == 0) {
216216
// Check whether the rounded result is normal.
217-
const round = @boolToInt((residual << 1) > bSignificand);
217+
const round = @intFromBool((residual << 1) > bSignificand);
218218
// Clear the implicit bit.
219219
var absResult = quotient & significandMask;
220220
// Round.
@@ -228,7 +228,7 @@ inline fn div(a: f128, b: f128) f128 {
228228
// code to round them correctly.
229229
return @bitCast(f128, quotientSign);
230230
} else {
231-
const round = @boolToInt((residual << 1) >= bSignificand);
231+
const round = @intFromBool((residual << 1) >= bSignificand);
232232
// Clear the implicit bit
233233
var absResult = quotient & significandMask;
234234
// Insert the exponent

lib/compiler_rt/divxf3.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ pub fn __divxf3(a: f80, b: f80) callconv(.C) f80 {
195195
// code to round them correctly.
196196
return @bitCast(T, quotientSign);
197197
} else {
198-
const round = @boolToInt(residual > (bSignificand >> 1));
198+
const round = @intFromBool(residual > (bSignificand >> 1));
199199
// Insert the exponent
200200
var absResult = quotient | (@intCast(Z, writtenExponent) << significandBits);
201201
// Round

lib/compiler_rt/exp.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ pub fn expf(x_: f32) callconv(.C) f32 {
7474
if (hx > 0x3EB17218) {
7575
// |x| > 1.5 * ln2
7676
if (hx > 0x3F851592) {
77-
k = @floatToInt(i32, invln2 * x + half[@intCast(usize, sign)]);
77+
k = @intFromFloat(i32, invln2 * x + half[@intCast(usize, sign)]);
7878
} else {
7979
k = 1 - sign - sign;
8080
}
8181

82-
const fk = @intToFloat(f32, k);
82+
const fk = @floatFromInt(f32, k);
8383
hi = x - fk * ln2hi;
8484
lo = fk * ln2lo;
8585
x = hi - lo;
@@ -157,12 +157,12 @@ pub fn exp(x_: f64) callconv(.C) f64 {
157157
if (hx > 0x3FD62E42) {
158158
// |x| >= 1.5 * ln2
159159
if (hx > 0x3FF0A2B2) {
160-
k = @floatToInt(i32, invln2 * x + half[@intCast(usize, sign)]);
160+
k = @intFromFloat(i32, invln2 * x + half[@intCast(usize, sign)]);
161161
} else {
162162
k = 1 - sign - sign;
163163
}
164164

165-
const dk = @intToFloat(f64, k);
165+
const dk = @floatFromInt(f64, k);
166166
hi = x - dk * ln2hi;
167167
lo = dk * ln2lo;
168168
x = hi - lo;

0 commit comments

Comments
 (0)