| 855 | } |
| 856 | |
| 857 | b3ConvexHullInternal::Int128 b3ConvexHullInternal::Int128::mul(btInt64_t a, btInt64_t b) |
| 858 | { |
| 859 | Int128 result; |
| 860 | |
| 861 | #ifdef USE_X86_64_ASM |
| 862 | __asm__("imulq %[b]" |
| 863 | : "=a"(result.low), "=d"(result.high) |
| 864 | : "0"(a), [b] "r"(b) |
| 865 | : "cc"); |
| 866 | return result; |
| 867 | |
| 868 | #else |
| 869 | bool negative = a < 0; |
| 870 | if (negative) |
| 871 | { |
| 872 | a = -a; |
| 873 | } |
| 874 | if (b < 0) |
| 875 | { |
| 876 | negative = !negative; |
| 877 | b = -b; |
| 878 | } |
| 879 | DMul<btUint64_t, btUint32_t>::mul((btUint64_t)a, (btUint64_t)b, result.low, result.high); |
| 880 | return negative ? -result : result; |
| 881 | #endif |
| 882 | } |
| 883 | |
| 884 | b3ConvexHullInternal::Int128 b3ConvexHullInternal::Int128::mul(btUint64_t a, btUint64_t b) |
| 885 | { |