next up previous
Next: Exception and Trap Instructions Up: Description of the MIPS Previous: Data Movement Instructions

Floating Point Instructions

The MIPS has a floating point coprocessor (numbered 1) that operates on single precision (32-bit) and double precision (64-bit) floating point numbers. This coprocessor has its own registers, which are numbered $f0-$f31. Because these registers are only 32-bits wide, two of them are required to hold doubles. To simplify matters, floating point operations only use even-numbered registers--including instructions that operate on single floats.

Values are moved in or out of these registers a word (32-bits) at a time by lwc1, swc1, mtc1, and mfc1 instructions described above or by the l.s, l.d, s.s, and s.d pseudoinstructions described below. The flag set by floating point comparison operations is read by the CPU with its bc1t and bc1f instructions.

In all instructions below, FRdest, FRsrc1, FRsrc2, and FRsrc are floating point registers (e.g., $f2).

abs.d FRdest, FRsrc Floating Point Absolute Value Double
abs.s FRdest, FRsrc Floating Point Absolute Value Single
Compute the absolute value of the floating float double (single) in register FRsrc and put it in register FRdest.

add.d FRdest, FRsrc1, FRsrc2 Floating Point Addition Double
add.s FRdest, FRsrc1, FRsrc2 Floating Point Addition Single
Compute the sum of the floating float doubles (singles) in registers FRsrc1 and FRsrc2 and put it in register FRdest.

c.eq.d FRsrc1, FRsrc2 Compare Equal Double
c.eq.s FRsrc1, FRsrc2 Compare Equal Single
Compare the floating point double in register FRsrc1 against the one in FRsrc2 and set the floating point condition flag true if they are equal.

c.le.d FRsrc1, FRsrc2 Compare Less Than Equal Double
c.le.s FRsrc1, FRsrc2 Compare Less Than Equal Single
Compare the floating point double in register FRsrc1 against the one in FRsrc2 and set the floating point condition flag true if the first is less than or equal to the second.

c.lt.d FRsrc1, FRsrc2 Compare Less Than Double
c.lt.s FRsrc1, FRsrc2 Compare Less Than Single
Compare the floating point double in register FRsrc1 against the one in FRsrc2 and set the condition flag true if the first is less than the second.

cvt.d.s FRdest, FRsrc Convert Single to Double
cvt.d.w FRdest, FRsrc Convert Integer to Double
Convert the single precision floating point number or integer in register FRsrc to a double precision number and put it in register FRdest.

cvt.s.d FRdest, FRsrc Convert Double to Single
cvt.s.w FRdest, FRsrc Convert Integer to Single
Convert the double precision floating point number or integer in register FRsrc to a single precision number and put it in register FRdest.

cvt.w.d FRdest, FRsrc Convert Double to Integer
cvt.w.s FRdest, FRsrc Convert Single to Integer
Convert the double or single precision floating point number in register FRsrc to an integer and put it in register FRdest.

div.d FRdest, FRsrc1, FRsrc2 Floating Point Divide Double
div.s FRdest, FRsrc1, FRsrc2 Floating Point Divide Single
Compute the quotient of the floating float doubles (singles) in registers FRsrc1 and FRsrc2 and put it in register FRdest.

l.d FRdest, address Load Floating Point Double tex2html_wrap_inline1278
l.s FRdest, address Load Floating Point Single tex2html_wrap_inline1278
Load the floating float double (single) at address into register FRdest.

mov.d FRdest, FRsrc Move Floating Point Double
mov.s FRdest, FRsrc Move Floating Point Single
Move the floating float double (single) from register FRsrc to register FRdest.

mul.d FRdest, FRsrc1, FRsrc2 Floating Point Multiply Double
mul.s FRdest, FRsrc1, FRsrc2 Floating Point Multiply Single
Compute the product of the floating float doubles (singles) in registers FRsrc1 and FRsrc2 and put it in register FRdest.

neg.d FRdest, FRsrc Negate Double
neg.s FRdest, FRsrc Negate Single
Negate the floating point double (single) in register FRsrc and put it in register FRdest.

s.d FRdest, address Store Floating Point Double tex2html_wrap_inline1278
s.s FRdest, address Store Floating Point Single tex2html_wrap_inline1278
Store the floating float double (single) in register FRdest at address.

sub.d FRdest, FRsrc1, FRsrc2 Floating Point Subtract Double
sub.s FRdest, FRsrc1, FRsrc2 Floating Point Subtract Single
Compute the difference of the floating float doubles (singles) in registers FRsrc1 and FRsrc2 and put it in register FRdest.


next up previous
Next: Exception and Trap Instructions Up: Description of the MIPS Previous: Data Movement Instructions

Antony Hosking
Fri Apr 12 10:48:03 EST 1996