pkubaj commented on code in PR #3696:
URL: https://github.com/apache/brpc/pull/3696#discussion_r4435172778


##########
src/bthread/context.cpp:
##########
@@ -1012,3 +1012,247 @@ __asm (
 "    call    _exit\n"
 );
 #endif
+
+#if defined(BTHREAD_CONTEXT_PLATFORM_linux_ppc64) && 
defined(BTHREAD_CONTEXT_COMPILER_gcc)
+__asm (
+".text\n"
+".align 2\n"

Review Comment:
   Added: `bthread_context_unittest.cpp` now has a ppc64 ELFv2 section next
   to the x86_64 one. One assembly helper loads f14–f31 and, with AltiVec,
   v20–v31 from an input block, calls `bthread_jump_fcontext` and stores them
   back when the context is resumed, so the compiler cannot touch the
   registers in between; both contexts check their own pattern after being
   resumed, and the output pointer travels in r31 so the GPR part of the frame
   is covered too. A second test checks that the FPSCR rounding mode does not
   leak between contexts and that a new context inherits its creator's. Run on
   powerpc64le and big-endian powerpc64 at -O2, -O0 and without AltiVec;
   dropping any single restore from the switch makes it fail.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to