Upgrade to Qt 6 (#130)
Why? Open Source Qt 5 will stop receiving updates rather sooner than later so it's worth switching to Qt 6 to remain compatible with modern systems. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/130
This commit is contained in:
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
36
externals/clang_rt_builtins/udivti3.c
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
typedef unsigned __int128 tu_int;
|
||||
|
||||
tu_int __udivti3(tu_int a, tu_int b)
|
||||
{
|
||||
if (b == 0) {
|
||||
// Handle division by zero (could also trigger a fault)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (b > a) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int shift;
|
||||
for (shift = 0;; shift++) {
|
||||
if (shift >= 128) {
|
||||
break;
|
||||
}
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b > a || (shifted_b >> shift) != b) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
shift--;
|
||||
|
||||
tu_int quotient = 0;
|
||||
for (; shift >= 0; shift--) {
|
||||
tu_int shifted_b = b << shift;
|
||||
if (shifted_b <= a) {
|
||||
quotient |= (tu_int) 1 << shift;
|
||||
a -= shifted_b;
|
||||
}
|
||||
}
|
||||
|
||||
return quotient;
|
||||
}
|
||||
Reference in New Issue
Block a user