3 ms·
> Moreover in many cases int * float is an intrinsic, so on the hardware level there is no conversion operation interposed into the operator. Out of curiosity,
by aw1621107 4y ago
> Moreover in many cases int * float is an intrinsic, so on the hardware level there is no conversion operation interposed into the operator.
Out of curiosity, what instructions support mixed integer/floating-point operands? I can think of integer-/floating-point-only instructions off the top of my head, and I know I've seen conversion instructions, but not mixed ones. I'm hardly an assembly expert, though, so I wouldn't be surprised if I just wasn't aware of such a thing.
- throwawaymaths 4y agoFIMUL
- aw1621107 4y agoHuh, first time I've seen that instruction. Thanks! Does seem that it converts its arguments first, though? > The FIMUL instructions convert an integer source operand to double extended-precision floating-point format before performing the multiplication. (Via https://www.felixcloutier.com/x86/fmul:fmulp:fimul https://www.felixcloutier.com/x86/fmul:fmulp:fimul) In addition, I thought compilers tended to avoid the x87 FPU registers nowadays?