Skip to content

NCG x86: implement wordToFloat directly in asm

Currently the x86 NCG calls into C to convert a word into a float. We should use CVTSI2SS/CVTSI2SD instructions instead (SSE/SSE2).

Code to fix in GHC.CmmToAsm.X86.CodeGen:

genWordToFloat :: BlockId -> Width -> CmmFormal -> CmmActual -> NatM InstrBlock
genWordToFloat bid width dst src =
  -- TODO: generate assembly instead
  genPrimCCall bid (word2FloatLabel width) [dst] [src]
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information