Rounding Mode for fptrunc Instruction


What is the rounding mode for the fptrunc instruction? Round to zero? Round to nearest? Or undefined?


Rounding mode handling is currently primitive. FPTRUNC is (de facto) round to nearest, as is the corresponding BE node FP_ROUND. FP_ROUND_IN_REG is round to nearest on X86 and round to zero on PowerPC. Better would be to have the rounding mode attached to the nodes (or multiple nodes), but nobody's done it yet. We are a long ways from having FENV_ACCESS work.