在网上找到一个有用的macro
2016-02-03 00:00
525 查看
How about rather than counting down you keep a variable to count up? Like this:.macro xxmov n, p1, cnt=0 .if (\cnt == 0) xor %eax, %eax .endif .if (\cnt != \n) movdqu \@*0x10(\p1), %xmm\@ xxmov \n, \p1, (\cnt + 1) .endif .endm xxmov 14, %rsiWhich generates: 0000000000000000 <.text>: 0: 31 c0 xor %eax,%eax 2: f3 0f 6f 06 movdqu (%rsi),%xmm0 6: f3 0f 6f 4e 10 movdqu 0x10(%rsi),%xmm1 b: f3 0f 6f 56 20 movdqu 0x20(%rsi),%xmm2 10: f3 0f 6f 5e 30 movdqu 0x30(%rsi),%xmm3 15: f3 0f 6f 66 40 movdqu 0x40(%rsi),%xmm4 1a: f3 0f 6f 6e 50 movdqu 0x50(%rsi),%xmm5 1f: f3 0f 6f 76 60 movdqu 0x60(%rsi),%xmm6 24: f3 0f 6f 7e 70 movdqu 0x70(%rsi),%xmm7 29: f3 44 0f 6f 86 80 00 00 00 movdqu 0x80(%rsi),%xmm8 32: f3 44 0f 6f 8e 90 00 00 00 movdqu 0x90(%rsi),%xmm9 3b: f3 44 0f 6f 96 a0 00 00 00 movdqu 0xa0(%rsi),%xmm10 44: f3 44 0f 6f 9e b0 00 00 00 movdqu 0xb0(%rsi),%xmm11 4d: f3 44 0f 6f a6 c0 00 00 00 movdqu 0xc0(%rsi),%xmm12 56: f3 44 0f 6f ae d0 00 00 00 movdqu 0xd0(%rsi),%xmm13Update: Oops, that only works for the first macro usage in the file. If you need to use it more than once in the same file, it looks like using the .altmacrosyntax is the way to go (it can be turned off again with .noaltmacro): .altmacro .macro xxmov n, p .if (\n == 1) xor %eax, %eax .endif .if (\n > 1) xxmov %(\n - 1), \p .endif movdqu (\n - 1)*0x10 (%\p) , %xmm\n .endm &nb 7fe0 sp; xxmov 4, rsi xxmov 14, rsi |
相关文章推荐
- 随机路径选择
- 新网站是否应该使用 Drupal 8?
- spring4.2 定时任务
- 搭建nginx+tomcat+Java的负载均衡环境
- MySQL性能优化之参数配置
- springframework——@Configuration注解详解
- gen_fsm行为模式的简要介绍
- 说说标签算法在视频推荐的那些事儿
- 字符串,整型,长整型转换工具类
- Mac 终端链接远程服务器
- the usage of final class instance
- curl 和file_get_contents
- Exception
- 给服务器免费的ssl证书 http和https共存
- Jquery 和 JS 对象互转
- 个人笔记 html 06 获取验证码之后倒计时功能
- Sublime 优秀插件
- Thrift源码分析2-FrameBuffer
- 用maven把所有类文件打到一个jar里面
- INSTALLING UFW (UNCOMPLICATED FIREWALL) IN DEBIAN