titzer / virgil

A fast and lightweight native programming language
1.23k stars 44 forks source link

Add exchange instructions to x86-64Assembler #261

Closed khagankhan closed 3 months ago

khagankhan commented 3 months ago

Adds support for exchange instructions in x86-64 that can be used for atomic stores and other purposes.

khagankhan commented 3 months ago

Do we need xchgq_m_r and xchgd_m_r or can we (I think we can) simply use asm.d.xchg_m_r and asm.q.xchg_m_r?

titzer commented 3 months ago

Do we need xchgq_m_r and xchgd_m_r or can we (I think we can) simply use asm.d.xchg_m_r and asm.q.xchg_m_r?

I think I prefer the explicit suffixes here.