5.71 · exercise

Predict: Floating Point Instructions

Trace single and double precision arithmetic by hand: add, fused multiply-add, multiply-negate, and the two sign-only instructions. Every answer is the exact decimal value left in the destination register.

0 of 5 correct

Mental Trace

// s1 holds 2.5
// s2 holds 3.5
fadd s0, s1, s2

Mental Trace

// d1 holds 2.0
// d2 holds 3.0
// d3 holds 10.0
fmadd d0, d1, d2, d3

Mental Trace

// d1 holds -42.5
fabs d0, d1

Mental Trace

// s1 holds 15.0
fneg s0, s1

Mental Trace

// s1 holds 2.0
// s2 holds 4.0
fnmul s0, s1, s2