Open xclerc opened 4 months ago
The following code (assuming the operators are redefined for unboxed floats):
let f ~(s: float#) (t : float#) = t + t * s
generates the following:
movapd xmm2,xmm1 mulsd xmm2,xmm0 addsd xmm1,xmm2
while we would like:
mulsd xmm0, xmm1 addsd xmm0, xmm1
The issue could probably be solved by a bunch of peephole rules, but that sounds quite fragile. It might be better to fix the issue at selection.
The following code (assuming the operators are redefined for unboxed floats):
generates the following:
while we would like: