Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pages 36-37 of lecture notes 08-machine-data.pdf shows how xmm registers are used for simple floating point arithmetic such as fadd, dadd, an dincr which increments

Pages 36-37 of lecture notes "08-machine-data.pdf" shows how xmm registers are used for simple floating point arithmetic such as fadd, dadd, an dincr which increments *p, a pointer to double variable by value v.

For Wed-section you have to follow the aforementioned pages.

For both sections, read 3.11 Floating-Point code.

Write a C function for the following assembly. cvtsd2ss converts scalar double precision number (a double number) to scalar single precision (a float number) while cvtss2sd converts scalar single precision number (a float number) to scalar double precision (a double number).

 unknown1: subss %xmm1, %xmm0 ret 
 unknown2: subsd %xmm1, %xmm0 ret 
 unknown3: movaps %xmm0, %xmm1 cvtsd2ss (%rdi), %xmm0 addss %xmm0, %xmm1 cvtss2sd %xmm1, %xmm2 movsd %xmm2, (%rdi) ret 
 unknown4: movsd (%rdi), %xmm1 movapd %xmm1, %xmm2 subsd %xmm0, %xmm2 movsd %xmm2, (%rdi) movapd %xmm1, %xmm0 ret 
 unknown5: pxor %xmm0, %xmm0 movl $0, %eax jmp .L13 .L14: movss (%rdx,%rax,4), %xmm1 mulss (%rsi,%rax,4), %xmm1 addss %xmm1, %xmm0 addq $1, %rax .L13: cmpq %rdi, %rax jb .L14 rep ret 
 unknown6: pxor %xmm0, %xmm0 movl $0, %eax jmp .L10 .L11: movsd (%rdx,%rax,8), %xmm1 mulsd (%rsi,%rax,8), %xmm1 addsd %xmm1, %xmm0 addq $1, %rax .L10: cmpq %rdi, %rax jb .L11 rep ret 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 10th International Symposium Sstd 2007 Boston Ma Usa July 2007 Proceedings Lncs 4605

Authors: Dimitris Papadias ,Donghui Zhang ,George Kollios

2007th Edition

3540735399, 978-3540735397

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago