<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 15, 2016, at 10:58 AM, Félix Cloutier via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I know that one, but I merely need fixed-size big integers. Backing all of my integers with an array seems overly expensive.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Félix</span>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 14 juin 2016 à 23:25:16, T.J. Usiyan <<a href="mailto:griotspeak@gmail.com" class="">griotspeak@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">There is also a fairly robust implementation of arbitrary size integers here <a href="https://github.com/lorentey/BigInt/tree/master/Sources" class="">https://github.com/lorentey/BigInt/tree/master/Sources</a></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jun 14, 2016 at 10:02 PM, Charlie Monroe via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">128-bit Ints have been discussed here a few weeks ago:<div class=""><br class=""></div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160523/018957.html" target="_blank" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160523/018957.html</a></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">On Jun 15, 2016, at 5:50 AM, Félix Cloutier via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class=""></span><div class=""><span class=""><div style="word-wrap:break-word" class="">I'm writing a program that would need Int128s. Since Swift uses LLVM and LLVM has good support for arbitrary-sized integers (well, up to 2^24 bits anyways), I was wondering if there was any interest in having arbitrary-sized integers in Swift.<br class=""><div class="">
<br class=""><span style="font-family:'Lucida Grande';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Félix</span></div></div></span></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div><div class=""><br class=""></div><div class="">When you say “LLVM has good support for arbitrary-sized integers”, what does that mean? Also, I wouldn’t say that "Swift uses LLVM"… The only (complete) Swift compiler that I’m aware of is built on the LLVM infrastructure, and Xcode does use many of LLVM’s (and LLDB's) features to do its IDE voodoo, but the <i class="">language itself</i> doesn’t require any particular compiler to be used. In light of that, I’m not sure it’s wise to be tying Swift’s standard library so closely to something that’s strictly part of LLVM. OTOH, I’m also not sure it’d be any harder to add a few bigint types to a compiler than to a library, so maybe that doesn’t really matter in this case.</div><div class=""><br class=""></div><div class="">What about creating UInt/Int128, UInt/Int256, etc up to the largest size which can fit in the target’s SIMD unit? That should allow for Int128 to be pseudo-natively handled on any CPU Swift is officially targeting, but wider than that and I’m not sure (also it obviously would use the SIMD unit, which may not be what you want)</div><div class=""><br class=""></div><div class="">How would this affect the `IntMax` typealias and its associated functions?</div><div class=""><br class=""></div><div class="">- Dave Sweeris</div></body></html>