Support abs as a primitive operation on floating point numbers.
AbandonedPublic

Authored by idontgetoutmuch on Feb 2 2017, 10:28 AM.

Details

Test Plan

See testsuite/tests/numeric/should_run/T13212.hs

idontgetoutmuch retitled this revision from to compiler: fix trac issue #13212.
idontgetoutmuch updated this object.
idontgetoutmuch edited the test plan for this revision. (Show Details)
idontgetoutmuch added reviewers: rwbarton, carter.
idontgetoutmuch updated the Trac tickets for this revision.
mpickering requested changes to this revision.Feb 2 2017, 10:43 AM
mpickering added a reviewer: mpickering.
mpickering added a subscriber: mpickering.
mpickering added inline comments.
testsuite/tests/numeric/should_run/T13212.hs
1

You need to modify the all.T file in this directory to get the test to actually run.

This revision now requires changes to proceed.Feb 2 2017, 10:43 AM
mpickering retitled this revision from compiler: fix trac issue #13212 to Support abs as a primitive operation on floating point numbers..Feb 2 2017, 10:44 AM
mpickering updated this object.
mpickering edited edge metadata.
carter edited edge metadata.Feb 2 2017, 11:21 AM

looks like in some cases this change *could* be a regression, or at least its not clear that its a win to make it a foreign call vs doing the suitable bitwise and masking as Reid and I have discussed

compiler/nativeGen/PPC/CodeGen.hs
1528

this should be fabsf if we're actually just calling the C code ...

But... as Reid and I have discussed... theres better straight up bit fiddling code in many cases

compiler/nativeGen/SPARC/CodeGen.hs
613

for sparc are we just calling c codes? (as with ppc?)

compiler/nativeGen/X86/CodeGen.hs
2576

as reid and I discussed, you probably dont want to change it to be using the c calls at this point... we actually want the bit wise and masking appraoch

2593

same here ... should be the bitwise and mask

compiler/prelude/primops.txt.pp
560

i dont think we want it to be a foreign call ... at least on most tier 1 architectures...

689

foreign call again ..

carter requested changes to this revision.Feb 2 2017, 11:21 AM
carter edited edge metadata.
idontgetoutmuch abandoned this revision.Mar 3 2017, 1:34 AM
idontgetoutmuch marked 2 inline comments as done.