Your cart is currently empty!
9.1 Assignment If floating point hardware is available, it can be used to greatly accelerate non-integral mathematical operations. For this lab, you are to re-write the program from Lab 8, but this time you must use floating point instructions to perform your calculations. 9.2 Instructions Re-write the program from Lab 8, but…
9.1 Assignment
If floating point hardware is available, it can be used to greatly accelerate non-integral mathematical operations. For this lab, you are to re-write the program from Lab 8, but this time you must use floating point instructions to perform your calculations.
9.2 Instructions
Re-write the program from Lab 8, but this time, use ARM VFP instructions to perform floating point mathematics. You can use printf and scanf for output and input of floating point values. The following example shows how to print floating point values.
1
3
7
10@@ is a float, then printf expects the 64-bit value to be
11@@ passed in two registers. The choice of registers depends
12@@ on the stack pointer.
13@@ printf acts as if r0-r3 are part of the stack and requires
14@@ the 64-bit value to be aligned on an 8-byte boundary. The
15@@ following lines print out the number in d0 by moving it to
16@@ the appropriate registers and calling printf.
17 | tst | sp,#4 | @ check to see if stack is aligned |
20 | ldr | r0,=fmt | @ load pointer to format string |
21 | bl | printf | |
29
30 LAB 9. FLOATING POINT MATH