www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15454] New: core.checkedint enhancement

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 puremagic.com
          Reporter: rumbu 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);

--
Dec 16 2015