mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-30 00:41:35 +00:00
Add -disallow-128-bit
This commit is contained in:
@@ -201,7 +201,10 @@ when ODIN_NO_RTTI {
|
||||
case 2: idx = int((^u16)(tag_ptr)^) - 1
|
||||
case 4: idx = int((^u32)(tag_ptr)^) - 1
|
||||
case 8: idx = int((^u64)(tag_ptr)^) - 1
|
||||
case 16: idx = int((^u128)(tag_ptr)^) - 1
|
||||
case 16:
|
||||
when ODIN_ALLOW_128_BIT {
|
||||
idx = int((^u128)(tag_ptr)^) - 1
|
||||
}
|
||||
}
|
||||
if idx < 0 {
|
||||
return nil
|
||||
|
||||
@@ -878,7 +878,7 @@ extendhfsf2 :: proc "c" (value: __float16) -> f32 {
|
||||
}
|
||||
|
||||
|
||||
|
||||
when ODIN_ALLOW_128_BIT {
|
||||
@(link_name="__floattidf", linkage=RUNTIME_LINKAGE, require=RUNTIME_REQUIRE)
|
||||
floattidf :: proc "c" (a: i128) -> f64 {
|
||||
DBL_MANT_DIG :: 53
|
||||
@@ -1086,7 +1086,7 @@ fixdfti :: proc "c" (a: u64) -> i128 {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
__write_bits :: proc "contextless" (dst, src: [^]byte, offset: uintptr, size: uintptr) {
|
||||
|
||||
@@ -2,6 +2,8 @@ package runtime
|
||||
|
||||
import "base:intrinsics"
|
||||
|
||||
when ODIN_ALLOW_128_BIT {
|
||||
|
||||
udivmod128 :: proc "c" (a, b: u128, rem: ^u128) -> u128 {
|
||||
_ctz :: intrinsics.count_trailing_zeros
|
||||
_clz :: intrinsics.count_leading_zeros
|
||||
@@ -154,3 +156,5 @@ udivmod128 :: proc "c" (a, b: u128, rem: ^u128) -> u128 {
|
||||
|
||||
return q_all
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user