[Vm-dev] clang and bytecodePrimMultiply
eliot.miranda at gmail.com
Tue Nov 24 21:58:31 UTC 2015
On Tue, Nov 24, 2015 at 11:51 AM, Holger Freyther <holger at freyther.de>
> > On 24 Nov 2015, at 20:44, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> > Hi All,
> > Given that arg and receiver can both have values > 64k, the result can
> of course overflow and there's no guarantee that because result = rcvr *
> arg, that (result / arg) == rcvr.
> > Am I missing something? Are there flags I should be using? This looks
> like a pretty basic issue.
> I think you were already compiling with the -fwrapv option?
Thanks, that's what I was missing. With -fwrapv the code is generated.
Maybe it ignores it? I think the
> blogpost from Nicolas Cellier applies? I had a similar issue with GNU
> Smalltalk and clang
> and I opted for using the GCC variant (that will be in newer clang
> releases too and we do not
> have to think about the types) in the form of the __builtin_mul_overflow
> (the older variants are
> either smul or smull and might be available in Apple's clang)
> i hope this helps
indeed it does!
>  http://smallissimo.blogspot.is/2015_04_01_archive.html
>  http://clang.llvm.org/docs/LanguageExtensions.html
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev