FP arithmetic on KM

Hi,
Using FP arithmetic on KM seems a hedious task. :frowning:
Strange as it might seem, suppose such task is needed on a km driver.
I could:

  1. Use KeSaveFloatingPointState to save the FP context in a resident
    (e.g. in the device extension) KFLOATING_SAVE variable;
  2. Perform the FP operation (e.g. a DOUBLE division);
  3. Restore the FP context, using KeRestoreFloatingPointState.

This scheme works fine for a single operation (A), but what if I need to
perform a sequence of FP operations:

save(A), restore(A), save(B), restore(B) = Ok
save(A), save(B), save(C) … restore(C), restore(B), restore(A) = NOT
Ok… :frowning:

(When dividing, one possible solution would be to use integer arithmetic
instead, “expanding” the divident (SHL), perform the division and then
“shrink”
the result (SHR) again. But I’m not sure if the results are reliable…)

Does anyone know how the “community” has been handling/solving the
FP problem on KM drivers? Any tips/points/links are mostly appreciated.

Thank you,

Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com

«Humour and love are God’s answers
to Human weaknesses»


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com