Question: Create an ARMv8 A64 assembly language program that finds the maximum of y=-2x - 22x + 11x + 57 in the range -10 x4,
Create an ARMv8 A64 assembly language program that finds the maximum of y=-2x - 22x + 11x + 57 in the range -10 x4, by stepping through the range one by one in a loop and testing. Use only long integers for x, and do not factor the expression. Use the printf() function to display to the screen the values of x, y and the current maximum on each iteration of your loop. You are to create 2 versions of your program: 1. Write the program without macros (i.e. don't use m4), and use only the mul, add, and mov instructions to do your calculations. Use a pre-test loop, where the test is at the top of the loop. 2. Optimize the above program by putting the loop test at the bottom of the loop (make sure it is still a pre-test loop), and by making use of the madd instruction. Also, add macros to the above program to make it more readable (use m4). In particular, provide macros for heavily used registers.
Step by Step Solution
3.44 Rating (151 Votes )
There are 3 Steps involved in it
Below are the two versions of the ARMv8 A64 assembly language program as per your requirements Version 1 Without Macros Pretest Loop Using mul add mov ... View full answer
Get step-by-step solutions from verified subject matter experts
