[Vm-dev] clang and bytecodePrimMultiply

Eliot Miranda eliot.miranda at gmail.com
Tue Nov 24 21:58:31 UTC 2015


Hi Holger,

On Tue, Nov 24, 2015 at 11:51 AM, Holger Freyther <holger at freyther.de>
wrote:

>
>
> > On 24 Nov 2015, at 20:44, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >
> > Hi All,
>
> Hi!
>
>
> > 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[1] 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)[2]
>
> i hope this helps
>         holger
>

indeed it does!


> [1] http://smallissimo.blogspot.is/2015_04_01_archive.html
> [2] http://clang.llvm.org/docs/LanguageExtensions.html




-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20151124/e3a88d32/attachment.htm


More information about the Vm-dev mailing list