tinycc/lib/fetch_and_add_riscv64.S
herman ten brugge b2d351e0ec Fix fetch_and_add code
Change type from signed char to int.
Make assembly code work with tcc and gcc.
2020-06-18 07:21:48 +02:00

17 lines
379 B
ArmAsm

.text
.align 2
.global fetch_and_add_riscv64
.type fetch_and_add_riscv64, %function
fetch_and_add_riscv64:
#ifdef __TINYC__
.int 0x0f50000f
.int 0x004b5202f
.short 0x8082
#else
fence iorw,ow
amoadd.w.aq zero,a1,0(a0)
ret
#endif
.size fetch_and_add_riscv64, .-fetch_and_add_riscv64