- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
这个问题在这里已经有了答案:
rsp doesn't move when entering new function [duplicate]
(1 个回答)
6 个月前关闭。
我有执行一些 SSE 计算的 C 函数。当我用 GCC 编译它时,我得到下一个代码
/* Start of function */
mov (%rdi),%rax
movslq %ecx,%rcx
...
mov 0x8(%rdi),%rax
pxor %xmm12,%xmm3
movaps %xmm0,-0x28(%rsp)
movaps %xmm6,%xmm1
...
movaps 0x50(%rax,%rcx,1),%xmm2
movaps 0x60(%rax,%rcx,1),%xmm15
pxor %xmm2,%xmm0
pxor %xmm2,%xmm6
movaps -0x28(%rsp),%xmm2
pxor %xmm15,%xmm5
pxor %xmm15,%xmm2
movaps 0x70(%rax,%rcx,1),%xmm15
movaps (%rax,%rcx,1),%xmm11
mov 0x10(%rdi),%rax
movaps %xmm15,-0x18(%rsp)
pxor %xmm11,%xmm4
pxor %xmm12,%xmm11
pxor %xmm15,%xmm12
movaps
指令 - 它通过堆栈顶部访问内存:
movaps %xmm15,-0x18(%rsp)
最佳答案
在程序集级别没有“未定义的内存”这样的东西。只要行为符合预期,gcc 可以自由地发出以它认为合适的任何方式访问堆栈的代码。
我对为什么会发生这种情况的猜测是,这是一个叶子函数,调整堆栈指针是徒劳的。您可以尝试通过检查任何 call
的程序集来验证这一点。指示。 (您也可以检查 C 源代码,但内联可能会使它不太可靠。)
某些平台(包括 x86-64)的 ABI 明确允许这种技巧。来自 the AMD64 ABI documentation :
The 128-byte area beyond the location pointed to by %rsp is considered to be reserved and shall not be modified by signal or interrupt handlers. Therefore, functions may use this area for temporary data that is not needed across function calls. In particular, leaf functions may use this area for their entire stack frame, rather than adjusting the stack pointer in the prologue and epilogue. This area is known as the red zone.
关于assembly - GCC 访问栈顶上方的内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20661190/
php应用越来越多,也越来越广泛,为了增加网站的丰富多彩,从而出现了很多新的技术。ajax是现代网站中不能缺少的一项技术,他可以异步刷新数据,而实现很多效果,比如刷新验证码,微博中的赞功能,都是运用
我想在用户将tableView滚动到顶部时进行分页,因为我已经使用了这种UIScrollView方法。但是它将多次调用api 最佳答案 不好意思 当服务器提供数据计数数量 -(void)tableVi
我有以下 swift 代码,我想要实现的是从顶部滑出的 segue。我希望第二个 VCView 位于第一个 VCView 下方,并且让第一个 VCView 滑出显示第二个 VCView。 目前没有动画
我正在使用 ECSliding我有这个问题! 在我的项目中有这个文件: InitViewController (ECSlidingController) FirstViewController (UI
当我们浏览网页时,我们想对网页内容如文章、评论中的观点持赞同或反对意见时,可以通过点击网页中的“顶”和“踩”来进行投票。而整个交互过程,开发者可以通过ajax异步来实现,从而提高用户体验
您好,我遇到了这样的问题, 我有两个 View ,例如我的第一个 View 是 A,其图像如下所示 我正在这个 View A 上打开 View B 例如,当我触摸没有按钮的区域时,在 View B 中
我正在尝试从图像生成鸟瞰图。对于相机固有特性和畸变,我使用的是从驾驶模拟器中检索到的硬编码值,该驾驶模拟器的车顶上安装了相机。 代码的基础来自“使用 OpenCV 库学习 OpenCV 计算机视觉”,
我正在尝试使用 Linux perf 进行一些性能分析。我有一个构建时去掉了符号的应用程序,令我惊讶的是 Linux perf top 无法显示 disassmbly 行。它只显示原始 EIP。 我们
本文实例为大家分享了基于PHP+jQuery+MySql实现红蓝(顶踩)投票代码,供大家参考,具体内容如下 数据库操作: ?
我正在使用 VueJS 和 Bootstrap 开发应用程序。我试图将一个 div 与图像居中,同时让复选框标 checkout 现在右上角,如下所示。 但是当鼠标悬停在卡片上时,图像会稍微向左移动,
我是一名优秀的程序员,十分优秀!