- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在问 mov
需要计算该地址的指令,即(在 at&t 语法中mov i(r, r, i), reg
或 mov reg, i(r, reg, i)
必须在端口 1 上执行,因为它们实际上是带有 3 个操作数 + MOV 的 LEA,或者它们可以在端口 0156 上自由执行。
如果他们确实在端口 1 上执行了 LEA 部分,那么一旦地址计算完成,端口 1 是否会被解除阻塞,或者是否需要首先完成整个内存加载。
在 ICL 上似乎 p7 可以做索引地址模式?
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#define BENCH_ATTR __attribute__((noinline, noclone, aligned(4096)))
#define TERMS 3
void BENCH_ATTR
test_store_port() {
const uint32_t N = (1 << 29);
uint64_t dst, loop_cnt;
uint64_t src[16] __attribute__((aligned(64)));
asm volatile(
"movl %[N], %k[loop_cnt]\n\t"
".p2align 5\n\t"
"1:\n\t"
"movl %k[loop_cnt], %k[dst]\n\t"
"andl $15, %k[dst]\n\t"
#if TERMS == 3
"movl %k[dst], (%[src], %[dst], 4)\n\t"
#else
"movl %k[dst], (%[src])\n\t"
#endif
"decl %k[loop_cnt]\n\t"
"jnz 1b\n\t"
: [ dst ] "+r"(dst), [ loop_cnt ] "+r"(loop_cnt)
: [ N ] "i"(N), [ src ] "r"(src), "m"(*((const uint32_t(*)[16])src))
: "cc");
}
int
main(int argc, char ** argv) {
test_store_port();
}
结果与
#define TERMS 3
:
perf stat -e uops_dispatched.port_2_3 -e uops_dispatched.port_7_8 -e uops_issued.any -e cpu-cycles ./bsf_dep
Performance counter stats for './bsf_dep':
297,191 uops_dispatched.port_2_3
537,039,830 uops_dispatched.port_7_8
2,149,098,661 uops_issued.any
761,661,276 cpu-cycles
0.210463841 seconds time elapsed
0.210366000 seconds user
0.000000000 seconds sys
结果与
#define TERMS 1
:
perf stat -e uops_dispatched.port_2_3 -e uops_dispatched.port_7_8 -e uops_issued.any -e cpu-cycles ./bsf_dep
Performance counter stats for './bsf_dep':
291,370 uops_dispatched.port_2_3
537,040,822 uops_dispatched.port_7_8
2,148,947,408 uops_issued.any
761,476,510 cpu-cycles
0.202235307 seconds time elapsed
0.202209000 seconds user
0.000000000 seconds sys
最佳答案
所有 CPU 都在加载或存储地址端口中的 AGU 上为加载/存储微指令生成地址,而不是在 ALU 端口上。只有 LEA 使用 ALU 执行端口进行移位和加法运算。
如果复杂的寻址模式需要端口 1,https://uops.info/和/或 https://agner.org/optimize/会在他们的指令表中这么说。但他们不需要:加载只需要 p23,并且只存储 p237 用于存储地址 + p4 用于存储数据。
实际上只是 p23 用于索引商店;端口 7 上的简单存储地址 AGU(Haswell 通过 Skylake)只能处理 reg+constant,这意味着如果您在代码中使用索引寻址模式,地址生成可能会成为瓶颈,否则每个时钟可以承受 2 个负载 + 1 个存储。
(早期的 Sandybridge 家族,SnB 和 IvB,甚至会 un-laminate indexed stores,因此也有前端成本。)
冰湖改变了 ,在端口 7 和 8 上有 2 个专用存储 AGU。存储地址 uop 不能再借用负载 AGU,因此存储 AGU 必须是全功能的。 https://uops.info/html-tp/ICL/MOV_M32_R32-Measurements.html确认具有索引寻址模式的存储确实在 ICL 上以 2/时钟运行,因此两个存储 AGU 都是功能齐全的。例如mov [r14+r13*1+0x4],r8d
. (uops.info 没有测试大于 1 的比例因子,但我假设两个 store-AGU 都是相同的,在这种情况下它们都会处理它。)
不幸的是,HSW/SKL 对调优不再重要还需要很多年,因为英特尔仍在销售源自 Skylake 的微架构,因此多年来它们将成为桌面软件安装基础的很大一部分。
关于assembly - x86-64 做地址计算 mov 即 mov i(r, r, i), r 在端口 1 上执行?还是还是p0156?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63975049/
这个问题在这里已经有了答案: Differences between general purpose registers in 8086: [bx] works, [cx] doesn't? (3
我最近开始探索计算机体系结构领域。在研究指令集体系结构时,我遇到了“ mov”指令,该指令将数据从一个位置复制到另一个位置。我知道某些类型的mov'指令是有条件的,而有些则需要添加偏移量或位移来查找特
我正在研究使用模拟 MSP430 CPU 的 Microcorruption CTF。 我见过几个 mov 指令示例,例如: mov sp, r4 ;将堆栈指针的值移至寄存器4 mov #0xfffc
我不明白 MOV 和 MOV ptr 之间的区别。 例如,在这段 C 代码中: unsigned char x, y; x = 2; 汇编中的第二行是: `MOV x, 2` 但是这个 C 代码的第二
MOV可能是每个人在学习ASM时都会学到的第一条指令。 刚才我遇到了一本书Assembly Language Programming in GNU/Linux for IA32 Architectur
下面两行有什么区别? mov ax, bx mov ax, [bx] 如果bx包含值100h,并且内存地址100h处的值是23,那么第二个是否将23复制到ax? 另外,下面两行有什么区别? mov a
我编写了一个基本的 C 程序,它定义了一个整型变量 x,将其设置为零并返回该变量的值: #include int main(int argc, char **argv) { int x;
我是一个初学者,正在编写汇编程序以使用以下代码打印从 1 到 9 的数字: section .text global _start _start:
mov (%rax),%eax有什么区别和 mov %rax,%eax ?我确定这是一个简单的问题,但我在任何地方都找不到答案。 这是提示我的问题的原始代码: mov -0x8(%rbp),%r
有人可以解释一下这三个指令的功能吗? ORG 1000H MOV AX,CS MOV DS,AX 我知道理论上的代码、数据和额外段是什么,但是: 在这个程序中它们是如何实现的? 为什么整个
在 8086 架构的 16 位 MS-DOS 应用程序中,mov bx,ax 和 mov bh,ah 之间的速度有区别吗? 最佳答案 您没有指定架构,但至少在 8086 中指定, 286 , 386和
我正在反汇编一些代码,我发现: mov eax, cr3 mov cr3, eax 这些线的作用是什么? 这是 x86 低级(BIOS/固件/引导加载程序之前)初始化代码。我们甚至还没有设置缓存。 最
使用 nasm 组装此代码时: BITS 64 mov eax, 0x1 mov rax, 0x1 我得到这个输出: b8 01 00 00 00 b8 01 00 00 00 这是 mov eax,
我试图理解 Intel 语法和 AT&T 语法之间的差异(我使用 GNU as)。 我有两个文件,intel.s: .intel_syntax noprefix val: mov eax, v
我需要一种非常精确的方法来加速音频。 我正在为 OpenDCP(一种用于制作数字电影包的开源工具)准备电影,以便在影院放映。 我的源文件通常是 23.976fps 和 48.000kHz 音频的 qu
通过查看英特尔指令卷,我发现了这一点: 1) 88/r MOV r/m8,r8 2) 8A/r MOV r8,r/m8 当我在 NASM 中写下这样的一行,并使用列表选项将其组装时: mov al
Intel 手册说 mov 有两种变体,涉及内存和 32 位立即操作数: MOV r/m32, imm32 MOV r/m64, imm32 第一个复制四个字节,第二个复制八个字节,采用给定的 32
我已经处理了一天了,最后不得不出来问。我想获取一个无声的 prores mov 文件(但显然确实有时间码轨道)并将其与 6 个单声道 wav 文件无损混合,使 6 个单声道 wav 在最终 mov 中
这是我的代码: section .data digit db 0,10 section .text global _start _start: call _printRAXD
我在问 mov需要计算该地址的指令,即(在 at&t 语法中mov i(r, r, i), reg或 mov reg, i(r, reg, i)必须在端口 1 上执行,因为它们实际上是带有 3 个操作
我是一名优秀的程序员,十分优秀!