diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2022-10-24 23:05:25 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2022-10-25 05:22:55 -0400 |
| commit | 6021edd7cee104f69c9ceb1af27e46637cab79e3 (patch) | |
| tree | 2eeb2f36c219ca24b44b6d24e5d68879a0228e47 /lib/include/zig.h | |
| parent | 54326cc55485fa71ce729cd553cb9af9ea816faa (diff) | |
| download | zig-6021edd7cee104f69c9ceb1af27e46637cab79e3.tar.gz zig-6021edd7cee104f69c9ceb1af27e46637cab79e3.zip | |
cbe: add support for all float literals types
Diffstat (limited to 'lib/include/zig.h')
| -rw-r--r-- | lib/include/zig.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/include/zig.h b/lib/include/zig.h index 0d9e1ab3c2..5327c59b8f 100644 --- a/lib/include/zig.h +++ b/lib/include/zig.h @@ -340,7 +340,7 @@ zig_int_operators(64) #define zig_int_helpers(w) \ static inline zig_i##w zig_shr_i##w(zig_i##w lhs, zig_u8 rhs) { \ - zig_i##w sign_mask = lhs < zig_as_i##w(0) ? zig_as_i##w(-1) : zig_as_i##w(0); \ + zig_i##w sign_mask = lhs < zig_as_i##w(0) ? -zig_as_i##w(1) : zig_as_i##w(0); \ return ((lhs ^ sign_mask) >> rhs) ^ sign_mask; \ } \ \ @@ -1166,7 +1166,7 @@ static inline zig_i128 zig_mod_i128(zig_i128 lhs, zig_i128 rhs) { #define zig_mod_u128 zig_rem_u128 static inline zig_i128 zig_shr_i128(zig_i128 lhs, zig_u8 rhs) { - zig_i128 sign_mask = zig_cmp_i128(lhs, zig_as_i128(0, 0)) < zig_as_i8(0) ? zig_as_i128(-1, UINT64_MAX) : zig_as_i128(0, 0); + zig_i128 sign_mask = zig_cmp_i128(lhs, zig_as_i128(0, 0)) < zig_as_i8(0) ? -zig_as_i128(0, 1) : zig_as_i128(0, 0); return zig_xor_i128(zig_bitcast_i128(zig_shr_u128(zig_bitcast_u128(zig_xor_i128(lhs, sign_mask)), rhs)), sign_mask); } |
