[Issue 2809] Wrong constant folding for unsigned shift

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 15 14:30:31 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=2809


simon <s.d.hammett at googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |s.d.hammett at googlemail.com


--- Comment #3 from simon <s.d.hammett at googlemail.com> 2010-11-15 14:29:19 PST ---
Mr Bs test case is wrong:

static assert((cast(short)-1 >>> 1) == int.max);

should be:

static assert((cast(short)-1 >>> 1) == short.max);

unsigned right shift is perfectly well defined,
though giving it it's own operator seems like overkill.

I think it would be better as a function in std.intrinsic.

You aren't going to use unsigned shift unless you know what you doing and care
about performance.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list