cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

roddomi
Journeyman III

volatile LDS operations in IL

Hi,

How can I write volatile LDS operations in IL? In other words, I have the following IL:

lds_store_id(1) r1, r2

lds_load_id(1) r3, r1

I want to make sure the CAL compiler actually emits both LDS memory accesses instead of optimizing it by passing the value in a register.

 

Thank you.

0 Likes
2 Replies

Insert a memory fence instruction. This instruction tells the compiler not to move load/stores around the instruction.

'fence_lds'
0 Likes

Hi Micah,

'fence_lds' also makes sure lds writes are visible to other threads, which my code doesn't require. I guess I can use it for now but isn't it a bit of an overkill?


Thank you.

0 Likes