Skip to content

Conversation

@denizzzka
Copy link
Contributor

@denizzzka denizzzka commented Mar 6, 2025

This code is based on mine earlier implementation for rv32, so both platforms should be supported: rv32 and rv64 with and without compressed instructions and with and without HardFloat.

For now it is tested only on rv64 with HardFloat (QEMU, Ubuntu 24.10, ldc2 from ~master)

Implemented using separate file because I see potential for growth of this assembly code (I want to implement embedded ISA subset and maybe something vendor-specific), and also to put an end to vicious scaring me practice of putting assembly code for completely different platforms into one huge .S file

Path to the new asm file is the same as in the current DMD ~master for core.thread.fiber package

@denizzzka denizzzka force-pushed the riscv_context_switch_squashed branch from 1bec630 to bc02f9f Compare March 6, 2025 20:16
@denizzzka denizzzka force-pushed the riscv_context_switch_squashed branch from 0956c59 to 2c60fba Compare March 7, 2025 13:04
@denizzzka denizzzka marked this pull request as ready for review March 7, 2025 13:05
@denizzzka
Copy link
Contributor Author

@wszqkzqk Hi! Maybe you are also interested in this?

@denizzzka denizzzka force-pushed the riscv_context_switch_squashed branch from 2c60fba to 641ec1d Compare March 8, 2025 21:04
@denizzzka denizzzka force-pushed the riscv_context_switch_squashed branch 3 times, most recently from 8c79355 to 12e2b45 Compare April 1, 2025 22:44
@denizzzka denizzzka force-pushed the riscv_context_switch_squashed branch from 12e2b45 to 21c61d1 Compare May 7, 2025 12:53
@kinke
Copy link
Member

kinke commented Jun 6, 2025

For posterity: I've 'pushed' for this upstream in dlang/dmd#20964, but turns out GDC doesn't use that upstream core/thread/fiber/switch_context_asm.S file anymore, but has its own set of asm files apparently. And the .S file only handles archs that DMD cannot target, so it isn't really used by DMD either. So this separate file here for RISC-V and LDC alone seems okay to me for now.

So thx Dennis for bearing with me.

@kinke kinke merged commit e2f30b8 into ldc-developers:master Jun 6, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants