-
-
Notifications
You must be signed in to change notification settings - Fork 416
Do not run Fiber unit test on certain systems #710
Conversation
Systems which do use the C backend but the C library returns ENOSYS at runtime. (This happens on ARM with glibc < 2.17 for example). We do not want to abort all testing in this case. We also don't want the static ctor to assert in this case whenever someone wants to use core.thread.
Maybe we should rip out the |
OK we can remove ucontext_t if you want. One remaining question: Would you say the floating point status register should be saved? It basically contains things like rounding mode, exception trap bits and exception 'occurred' bits: If we really want to micro-optimize fibers we probably have to enable inlining first. If the fiber_switchContext routines were implemented with extended inline ASM gdc should be able to inline those and hopefully the complete 'yield' function could be inlined. |
I think that would make sense, it's a bad default and as you said an asm implementation is quite simple.
We currently don't save/restore this. I tend to think of fiber context switching as a subroutine call.
Could be useful, but I wouldn't expect much gain, because the function call overhead is minimal. Also having the asm code in an extra |
Where is the ARM asm code btw? |
Does I guess we can remove that version(GNU) code and put in x86 and x86_64 code paths into |
You'd still need code to switch the stack pointer. |
@MartinNowak it's not published yet. I want to test it on a system without FPU first. @ibuclaw |
@jpf91 oh right, I see it. @MartinNowak would it be OK to copy D IASM code in fiber_switchContext to threadasm.S? That way I could add |
(And be one step ahead of removing ucontext_t) |
Sure, I wouldn't even mind to switch from D IASM to external .S file altogether. |
@MartinNowak the pull request for the ARM code is here #713 |
Systems which do use the C backend but the C library returns ENOSYS at runtime. (This happens on ARM with glibc < 2.17 for example).
We do not want to abort all testing in this case. We also don't want the static ctor to assert in this case whenever someone wants to use core.thread.
Note: This is part of a set of changes which are required to get test suite & unit tests passing on ARM GDC. All necessary changes for GDC are here for reference:
https://github.com/jpf91/GDC/commits/arm-old
Once these pull requests are merged upstream I'll merge them into GDC as well.