Re: mspgcc "undefines" too-many-bits shifts in weird way

Paul Sokolovsky <[email protected]>
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.user
Message-ID <20130423025612.7acbb2bb@x34f>
Hello,

On Tue, 23 Apr 2013 00:56:40 +0200
David Brown <[email protected]> wrote:

> "Shift" does not have a "correct classification" or other "officially 
> correct" mathematical definition.  It is not one of the standard 
> operations defined on integers.

Of course it is - proceed to http://en.wikipedia.org/wiki/Logical_shift
or open up your Computer Science book. (And of course, whenever we speak
of integers in Computer Science, we speak of finite subset of math
integers, and those map directly to bit vectors on which shift is
defined).

> So it does what you define it to do in the context.

No, that's not how science works - there's one definition for one
notion, "you" (as a subjective observer) is excluded.

> But the compiler is calculating "(1 << 32)" as 0
> rather than 1.  This is an inconsistency in the compiler, and
> arguably it is /this/ target that is flawed, not the msp430 target.

But of course, who might have thought of such outcome! ;-)

[]


-- 
Best regards,
 Paul                          mailto:[email protected]

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.