https://llvm.org/bugs/show_bug.cgi?id=24599

Richard Smith <richard-l...@metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Richard Smith <richard-l...@metafoo.co.uk> ---
> Target: powerpc64le-unknown-linux-gnu

Ah, this was a bug in the PPC64LE backend. Reduced testcase:

unsigned f(double d) { return d; }

int main(){
   volatile double d1 = 10.0L;
   return unsigned(d1);
}

Here's the assembly from 3.5 and 3.6:

    fctidz 0, 1
    stfd 0, -16(1)
    lwz 3, -12(1)
    blr

and here's the assembly from 3.7 onwards:

    xscvdpuxws 0, 1
    mfvsrwz 3, 0
    clrldi     3, 3, 32
    blr

Note that the 3.5 and 3.6 code is converting the double to a 64-bit integer,
then trying to truncate to 32 bits... but it looks like it's picking the wrong
32 bits.

Anyway, marking as fixed since it's working on trunk and in 3.7.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to