(208 lines)
1 .text2 .globl aco_yield_asm3 #if defined(__APPLE__)4 #else6 #endif7 .intel_syntax noprefix9 /*12 struct aco_t {13 void* reg[X];15 }26 > By default, the signal handler is invoked on the normal process27 > stack. It is possible to arrange that the signal handler29 > how to do this and when it might be useful.39 fnstcw * m2byte40 Store FPU control word to m2byte without checking for41 pending unmasked floating-point exceptions.43 fldcw m2byte44 Load FPU control word from m2byte.46 stmxcsr m3247 Store contents of MXCSR register to m3249 ldmxcsr m3250 Load MXCSR register from m32.51 */52 /*54 eip esp ebp edi esi ebx fpucw16 mxcsr3256 */57 #ifdef __i386__59 mov edx,DWORD PTR [esp] // retaddr68 #ifndef ACO_CONFIG_SHARE_FPU_MXCSR_ENV71 #endif78 #ifndef ACO_CONFIG_SHARE_FPU_MXCSR_ENV81 #endif82 xor ecx,ecx83 mov esp,edx84 mov edx,eax87 #ifdef ACO_CONFIG_SHARE_FPU_MXCSR_ENV89 #else91 #endif93 jmp edx94 #elif __x86_64__95 /*97 r12 r13 r14 r15 rip rsp rbx rbp fpucw16 mxcsr3299 */100 // rdi - from_co | rsi - to_co101 mov rdx,QWORD PTR [rsp] // retaddr111 #ifndef ACO_CONFIG_SHARE_FPU_MXCSR_ENV114 #endif123 #ifndef ACO_CONFIG_SHARE_FPU_MXCSR_ENV126 #endif129 #ifdef ACO_CONFIG_SHARE_FPU_MXCSR_ENV131 #else133 #endif135 mov rsp,rcx136 jmp rax137 #else139 #endif141 .globl aco_save_fpucw_mxcsr142 #if defined(__APPLE__)143 #else145 #endif146 .intel_syntax noprefix148 #ifdef __i386__150 fnstcw WORD PTR [eax]152 ret153 #elif __x86_64__154 fnstcw WORD PTR [rdi]156 ret157 #else159 #endif161 #if defined(__APPLE__)162 .globl _abort163 .globl _aco_funcp_protector164 #else165 .globl abort166 .globl aco_funcp_protector167 #endif169 .globl aco_funcp_protector_asm170 #if defined(__APPLE__)171 #else173 #endif174 .intel_syntax noprefix176 #ifdef __i386__179 call _aco_funcp_protector180 call _abort186 call aco_funcp_protector187 call abort190 ret191 #elif __x86_64__194 call _aco_funcp_protector195 call _abort201 call aco_funcp_protector202 call abort205 ret206 #else208 #endif