5.13
A.
+----+----+----+----+-----+-----+
|%rbp|%rcx|%rax|%rbx|%xmm1|%xmm0|
+----+----+----+----+-----+-----++----+
+----|----|----|----------|--->| |
| +----|----|----------|--->|load| vmovad 0(%rbp,%rcx,8),%xmm1
| | | | +-----|----| |
| | | | | | +----+
| +----|----|----------|--->| |
| | | | | | |load|---+
| | +----|----------|--->| | |
| | | | | | +----+ | vmulsd (%rax,%rcx,8),%xmm1,%xmm0
| | | | | | | |<--+
| | | | +-----|--->|mul |
| | | | +-----|----| |
| | | | | | +----+
| | | | +-----|--->| |
| | | | | +--->|add | vaddsd %xmm1,%xmm0,%xmm0
| | | | | +----| |
| | | | | | +----+
| +----|----|----------|--->| |
| | | | | |add | addq $1, %rcx
| +----|----|----------|----| |
| | | | | | +----+
| +----|----|----------|--->| |
| | | | | | |cmp |---+ cmpq %rbx, %rcx
| | | +----|-----|--->| | |
| | | | | | +----+ |
| | | | | | | | |
| | | | | | |jne |<--+ jne .L15
| | | | | | | |
| | | | | | +----+
v v v v v v
+----+----+----+----+-----+-----+
|%rbp|%rcx|%rax|%rbx|%xmm1|%xmm0|
+----+----+----+----+-----+-----+
+----+ +-----+
|%rcx| |%xmm0|
+----+ +-----+
| |
| +----+ | <--------- key path
+---->|load|------+ |
| +----+ | |
| v v
| +----+ +-+--+ +-+--+
+---->|load|--->|mul |--->|add |
| +----+ +----+ +----+
| |
| |
v |
+----+ |
|add | |
+----+ |
| |
v v
+-+--+ +-----+
|%rcx| |%xmm0|
+----+ +-----+
B.
5-12
float add cell, CPE is 3.0
C.
5-12
long add cell, 1.0
D.
only float add on key path
!INCLUDE "./code/5.13.c"
当前内容版权归 DreamAndDead 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 DreamAndDead .