Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve implementation of context switching for 64-bit POWER #87

wants to merge 3 commits into
base: master


None yet
1 participant
Copy link

commented Feb 15, 2019

This PR improves implementation of fcontext for ppc64-elf, which gets increasingly important in the HPC field.
The changes are as follows:

  • Implement take_fcontext; previously jump_fcontext is used, which doubles the context switching cost.
  • Support OpenPOWER ABI (= OpenPOWER 64 bit ELF ABI) by saving registers for VSX, which will be dominant implementation of POWER architecure (e.g., POWER 8/9).

It passed all the tests on a POWER8 machine.

shintaro-iwasaki added some commits Feb 15, 2019

fcontext/ppc64: properly implement take_fcontext
take_fcontext does not need to save the current context, but it is not
implemented for ppc64; just a copy of jump_fcontext.  This patch removes code
which saves the current context.
fcontext/ppc64: save and restore vector registers
VSX, which is a SIMD extension of POWER, has several nonvolatile vector
registers (v20-v31).  They were not properly saved and thus any vectorized
programs running on recent IBM POWER machines (including POWER 8 and 9) might
suffer from unknown bugs because of corrupted SIMD values.  This commit fixes
this potential bug by saving and restoring them properly.

For details, see 64-Bit ELF V2 ABI Specification: Power Architecture.
fcontext/ppc64: reorder instructions for locality
Move TOC save/restore code so that memory access becomes sequential.  It also
improves readability of the code.

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2019


@shintaro-iwasaki shintaro-iwasaki changed the title Improve implementation of context switching for POWER Improve implementation of context switching for 64-bit POWER Feb 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.