同架构模拟的情况基本类似,DynamoRIO AArch64 提供了两种方案:
1. 默认方案:用 CAS 模拟
2. 可选方案:搞了一条超级指令,把整个 LL/SC block 打包成一条指令来处理(除了精确和性能好之外,缺点多多)
1. 默认方案:用 CAS 模拟
2. 可选方案:搞了一条超级指令,把整个 LL/SC block 打包成一条指令来处理(除了精确和性能好之外,缺点多多)
ksco 的工作日志
同架构模拟的情况基本类似,DynamoRIO AArch64 提供了两种方案: 1. 默认方案:用 CAS 模拟 2. 可选方案:搞了一条超级指令,把整个 LL/SC block 打包成一条指令来处理(除了精确和性能好之外,缺点多多)
打算和 AArch64 一样,先给 RISC-V 用 amoswap 模拟实现,之后再实现可选的 super-instruction 选项。明天再写吧。
👏2
基础的 codegen,没有考虑 stolen reg 和 tp reg,把这两个考虑进来后情况还要更复杂一点。
# ---> lr.w/d.aq?.rl? rd, (rs1)
sd scratch1, [scratch_1_slot]
fence rl?
ld rd, 0(rs1)
fence aq?
sd rs1, [tls_lrsc_addr]
li scratch1, SIZE
sd scratch1, [tls_lrsc_size]
sd rd, [tls_lrsc_value]
ld scratch1, [scratch_1_slot]
# ---> sc.w/d.aq?.rl? rd, rs2, (rs1)
sd scratch1, [scratch_1_slot]
sd scratch2, [scratch_2_slot]
ld scratch1, [tls_lrsc_addr]
bne scratch1, rs1, fail
ld scratch1, [tls_lrsc_size]
li scratch2, SIZE
bne scratch1, scratch2, fail
amoswap.aq?.rl? rd, rs2, (rs1)
sne rd, rd, value
j finally
fail:
fence aq?rl?
li rd, 1
finally:
li scratch1, -1
sd scratch1, [tls_lrsc_addr]
ld scratch1, [scratch_1_slot]
ld scratch2, [scratch_2_slot]
https://www.youtube.com/watch?v=vUwsfmVkKtY
用
视频的结论更有意思 🤔️
用
[[clang::musttail]] 写解释器,试图解决 Mike Pall 在著名的 msg00742 中说的寄存器分配和 slow path 冲刷 I$ 的问题。视频的结论更有意思 🤔️
YouTube
A Deep Dive Into Dispatching Techniques in C++ - Jonathan Müller - CppNow 2023
https://www.cppnow.org
https://www.linkedin.com/company/cppnow
---
Dispatching Techniques in C++ - Jonathan Müller - CppNow 2023
Slides: https://github.com/boostcon
---
At the core of an interpreter is a loop that iterates over instructions and executes…
https://www.linkedin.com/company/cppnow
---
Dispatching Techniques in C++ - Jonathan Müller - CppNow 2023
Slides: https://github.com/boostcon
---
At the core of an interpreter is a loop that iterates over instructions and executes…
今天跟某个减肥成功并且保持体重两年的人学到了一个很厉害的减肥技巧,适应于会做饭但讨厌做饭的人(比如我):强迫自己只吃自己做的饭并且不使用任何预加工的食材。
想学习编译器优化,目前零基础,想达到能自己写个还不赖的中后端那种水平,有什么推荐的书、论文、课程或者代码可以钻研吗?(书的话最好能直球一点)🥹
看 psABI 的时候发现龙架构有一堆很神奇的栈操作风格的重定位,似乎是在重定位过程中通过维护一个栈来保存中间信息(?)同时观测到还有一组和 RV 相似的重定位。看 mold 和 LLD 的代码发现都是只支持了后者,有点困惑。
后来发现栈操作风格的重定位是旧世界的东西。source
后来发现栈操作风格的重定位是旧世界的东西。source