I need to add at least some simple support for floating point in 64 bit MASM and since there are at least a few people who actually understand how the old co-processor works, I wondered if there was a better way to do these simple calculations. The criterion is to perform each calculation and leave the result popped into st(0) for further calculations. The input data has to be valid and as FP does not support immediate values, the old macros from the 32 bit version of MASM handle that OK with only some minor alignment changes.
Win64 does not specify co-processor performance or FP register usage but I have tried to keep this available for folks who want to do calculations for maths rather than video tasks.
fpadd MACRO arg1,arg2
fld arg1
fld arg2
faddp
ENDM
fpsub MACRO arg1,arg2
fld arg1
fld arg2
fsubp
ENDM
fpdiv MACRO arg1,arg2
fld arg1
fld arg2
fdivp
ENDM
fpmul MACRO arg1,arg2
fld arg1
fld arg2
fmulp
ENDM
fpsqrt MACRO number,target
fld number
fsqrt
fstp target
ENDM