
#13442: Add a coercion/cast operator to CMM
-------------------------------------+-------------------------------------
Reporter: erikd | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.4.1
Component: Compiler | Version: 8.0.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
While trying to implement casts between floating-point and integral types
#4092) @rwbarton suggested the following CMM:
{{{
stg_wordToFloatzh(W_ w)
{
D_ d;
STK_CHK_P_LL(WDS(1), stg_wordToFloatzh, w);
Sp(-1) = w;
d = Sp(-1);
return (d);
}
}}}
This code works outside of GHC, but when I try to add it as
`rts/CastFloatWord.cmm` the CMM linter complains with:
{{{
Cmm lint error:
in basic block c5
in assignment:
_c2::F64 = I64[Sp + -1 * 8];
Reg ty: F64
Rhs ty: I64
Program was:
{offset
c6: // global
_c1::I64 = R1;
//tick src