The answer is the same for both: 7 or 8 places, same as MIPS. All three use the same IEEE standard for single precision float. (But be careful: some C compilers allow you to specify how many bits of precision you want for various data types. Also, C implemented on a weird machine might be non-standard).
Instruction | Operation |
---|---|
abs.s fd,fs | $fd = |$fs| |
add.s fd,fs,ft | $fd = $fs + $ft |
sub.s fd,fs,ft | $fd = $fs - $ft |
mul.s fd,fs,ft | $fd = $fs * $ft |
div.s fd,fs,ft | $fd = $fs / $ft |
neg.s fd,fs | $fd = -$fs |
Here are some single precision arithmetic instructions.
All of these correspond to one machine instruction.
The double precision version of these instructions has a
"d" in place of the "s".
So add.s
becomes add.d
and
corresponds to the machine code that adds double precision.
The first instruction computes the absolute value
(makes a positive value) of the value in register $fs
If the data in an operand register is illegal or an illegal operation is performed (such as divide by zero) an exception is raised. The IEEE 752 standard describes what is done in these situations. This will be discussed in a later chapter, not yet written (as of June 2002).