[Issue 15454] New: core.checkedint enhancement

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Dec 16 00:28:48 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15454

          Issue ID: 15454
           Summary: core.checkedint enhancement
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: rumbu at rumbu.ro

Change the overflow type of muls and mulu from bool to the underlying integer
type. Since these functions are intended to be treated as intrinsics, the
overflow can be easily obtained directly from the x86 mul / arm umull
instruction.

pure nothrow @nogc @safe uint mulu(uint x, uint y, ref uint overflow); 
pure nothrow @nogc @safe ulong mulu(ulong x, ulong y, ref ulong overflow);
pure nothrow @nogc @safe int muls(int x, int y, ref int overflow); 
pure nothrow @nogc @safe long muls(long x, long y, ref long overflow);

--


More information about the Digitalmars-d-bugs mailing list