data_t = double, OP Inner loop of inner4. udata in %rbp, vdata in %rax, sum in %xmm0 i in %rex, limit in %rbx 1 .L15: loop: Get udatali) vmovsd 0(%rbp,%rcx,8), %xmm1 vmulsd (%rax, %rcx,8), %xmm1, %xmm1 vaddsd %xmm1, %xmm0, %xmm0 $1, %rcx %rbx, %rcx Multiply by vdata[i] Add to sum 5 addq Increment i cmpq Compare i:limit jne .L15 If !=, goto loop Assume that the functional units have the characteristics listed in Figure 5.12. A. Diagram how this instruction sequence would be decoded into operations and show how the data dependencies between them would create a critical path of operations, in the style of Figures 5.13 and 5.14. B. For data type double, what lower bound on the CPE is determined by the critical path? C. Assuming similar instruction sequences for the integer code as well, what lower bound on the CPE is determined by the critical path for integer data? D. Explain how the floating-point versions can have CPES of 3.00, even though

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Solve for a b c and d
Inner loop of inner4. data_t = double, OP = *
udata in %rbp, vdata in %rax, sum in %xmmo
i in %rcx, limit in %rbx
1
.L15:
loop:
vmovsd 0(%rbp,%rcx,8), %xmm1
vmulsd (%rax,%rcx,8), %xmm1, %xmm1
vaddsd %xmm1, %xmm0, %xmmo
$1, %rcx
%rbx, %rcx
2
Get udata[i]
3
Multiply by vdata[i]
4
Add to sum
addq
Increment i
Compare i:limit
If !=, goto loop
стра
7
jne
.L15
Assume that the functional units have the characteristics listed in Figure 5.12.
A. Diagram how this instruction sequence would be decoded into operations
and show how the data dependencies between them would create a critical
path of operations, in the style of Figures 5.13 and 5.14.
B. For data type double, what lower bound on the CPE is determined by the
critical path?
C. Assuming similar instruction sequences for the integer code as well, what
lower bound on the CPE is determined by the critical path for integer data?
D. Explain how the floating-point versions can have CPES of 3.00, even though
the multiplication operation requires 5 clock cycles.
Transcribed Image Text:Inner loop of inner4. data_t = double, OP = * udata in %rbp, vdata in %rax, sum in %xmmo i in %rcx, limit in %rbx 1 .L15: loop: vmovsd 0(%rbp,%rcx,8), %xmm1 vmulsd (%rax,%rcx,8), %xmm1, %xmm1 vaddsd %xmm1, %xmm0, %xmmo $1, %rcx %rbx, %rcx 2 Get udata[i] 3 Multiply by vdata[i] 4 Add to sum addq Increment i Compare i:limit If !=, goto loop стра 7 jne .L15 Assume that the functional units have the characteristics listed in Figure 5.12. A. Diagram how this instruction sequence would be decoded into operations and show how the data dependencies between them would create a critical path of operations, in the style of Figures 5.13 and 5.14. B. For data type double, what lower bound on the CPE is determined by the critical path? C. Assuming similar instruction sequences for the integer code as well, what lower bound on the CPE is determined by the critical path for integer data? D. Explain how the floating-point versions can have CPES of 3.00, even though the multiplication operation requires 5 clock cycles.
Suppose we wish to write a procedure that computes the inner product of two
vectors u and v. An abstract version of the function has a CPE of 14–18 with x86-
64 for different types of integer and floating-point data. By doing the same sort
of transformations we did to transform the abstract program combine1 into the
more efficient combine4, we get the following code:
/* Inner product. Accumulate in temporary */
void inner4(vec_ptr u, vec_ptr v, data_t *dest)
1
{
long i;
long length
data_t *udata = get_vec_start(u);
data_t *vdata = get_vec_start (v);
data_t sum = (data_t) 0;
4
vec_length(u);
%3D
8.
9.
for (i = 0; i < length; i++) {
sum = sum + udata[i] * vdata[i];
10
11
12
}
13
*dest = sum;
14
Our measurements show that this function has CPES of 1.50 for integer data
and 3.00 for floating-point data. For data type double, the x86-64 assembly code
for the inner loop is as follows:
Transcribed Image Text:Suppose we wish to write a procedure that computes the inner product of two vectors u and v. An abstract version of the function has a CPE of 14–18 with x86- 64 for different types of integer and floating-point data. By doing the same sort of transformations we did to transform the abstract program combine1 into the more efficient combine4, we get the following code: /* Inner product. Accumulate in temporary */ void inner4(vec_ptr u, vec_ptr v, data_t *dest) 1 { long i; long length data_t *udata = get_vec_start(u); data_t *vdata = get_vec_start (v); data_t sum = (data_t) 0; 4 vec_length(u); %3D 8. 9. for (i = 0; i < length; i++) { sum = sum + udata[i] * vdata[i]; 10 11 12 } 13 *dest = sum; 14 Our measurements show that this function has CPES of 1.50 for integer data and 3.00 for floating-point data. For data type double, the x86-64 assembly code for the inner loop is as follows:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education