50 likes | 71 Views
The MIPS Floating Point Accelerator (FPA) chip (now, usually part of the processor chip) has a condition bit that is set to 0 or 1 to indicate if a condition is false or true . Several FPA instructions affect this bit and several CPU instructions test this bit.
E N D
The MIPS Floating Point Accelerator (FPA) chip (now, usually part of the processor chip) has a condition bit that is set to 0 or 1to indicate if a condition is false or true. Several FPA instructions affectthis bit and several CPU instructions testthis bit. Early MIPS floating point was done on a separate chip. Special instructions were used to bridge the gap between the two chips (such as the two move instructions mtc1 and mfc1 we have already seen). Although these days there is usually just one processor chip, some of the instructions act as if the chips were separate. Floating Point Processor Condition Bit
Floating Point Comparison Instructions • These instructions change the value in the condition bit, a part of the processor. • The condition bit is set(made equal to one) if the condition is true. • Otherwisethe condition bit is cleared(made equal to zero).
Floating Point Comparison Instructions • Testing if two floating point numbers are exactly equal is sometimes NOT a good idea. • Floating point calculations are not exact. • Sometimes values are not equal even though mathematically they should be. • It is best to use "less than" or "less than or equal" instead of testing for exact equality.
Branch Instructions and usage • There is a branch delay slot after branch instructions. l.s $f0,A l.s $f2,B c.lt.s$f0,$f2 # is A < B? bc1t printA# yes -- print A nop c.lt.s $f2,$f0 # is B < A? bc1t printB# yes -- print B nop
0xc1300000 An example. Which number is this? • The decimal number is - 99.0 (negative)