HomePhabricator

[NVPTX] Fix lowering of frem for negative values

Authored by ThomasRaoux on May 24 2021, 7:36 AM.

Description

[NVPTX] Fix lowering of frem for negative values

to match fmod frem result must have the dividend sign. Previous implementation
had the wrong sign when passing negative numbers. For ex: frem(-16, 7) was
returning 5 instead of -2. We should just a ftrunc instead of floor when
lowering to get the right behavior.

Differential Revision: https://reviews.llvm.org/D102528

Details

Committed
ThomasRaouxMay 24 2021, 7:45 AM
Differential Revision
D102528: [NVPTX] Fix lowering of frem for negative values
Parents
rG60b33ebe8b9c: [CostModel][X86] Regenerate sse-itoi.ll test checks
Branches
Unknown
Tags
Unknown