FP context switching on i386

Thomas Dörfler Thomas.Doerfler at embedded-brains.de
Mon Oct 5 08:15:10 UTC 2009


Hi,

it seems that we can set the "EM" bit to make sure that coprocessor
instructions are trapped.

It might make sense to reduce the context switch times by ommitting FP
save/restore during "normal" context switches. For the "interrupt" case,
the FP register could be saved to the current stack before calling the
dispatcher. Does this make sense?

wkr,
Thomas.

Joel Sherrill wrote:
> Thomas Doerfler wrote:
>> Till,
>>
>> although I am not at all familiar with i386 ABI stuff, I would guess
>> that we have to save the context during a task switch, at least when it
>> was forced due to a interrupt (e.g. timer) event. In these cases there
>> is no function call involved for the function that uses the FP context.
>>
>>   
> That sounds right.  If they are preserved across subroutine
> calls, they get saved in the context switch.  If not, they must
> be saved as part of the code that is usually called _ISR_Dispatch.
> 
> I don't remember anything in a processor status register
> on the x86 to turn off the FPU.
> 
> --joel
>> wkr,
>> Thomas.
>>
>>
>> Till Straumann schrieb:
>>  
>>> I thought the i386 sysv ABI said that FP registers
>>> are not preserved across function calls -- doesn't
>>> this mean that there is no need for saving/restoring
>>> the FP context ? Am I missing something ?
>>>
>>> I was thinking about what it takes to support SSE
>>> and I believe it may essentially come for free
>>> since XMM registers seem not to be callee saved
>>> either. Hard to find that information though since
>>> e.g.,
>>>
>>> http://www.sco.com/developers/devspecs/abi386-4.pdf
>>>
>>> doesn't mention SSE yet.
>>>
>>> -- Till
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.org
>>> http://www.rtems.org/mailman/listinfo/rtems-users
>>>     
>>
>>
>>   
> 


-- 

--------------------------------------------
Embedded Brains GmbH
Thomas Doerfler        Obere Lagerstrasse 30
D-82178 Puchheim       Germany
email: Thomas.Doerfler at embedded-brains.de
Phone: +49-89-18908079-2
Fax:   +49-89-18908079-9



More information about the users mailing list