FPU problems (again)
FPU problems (again)
Hello,
I have another question about FPU.
Does Anybody know why the same procedure that I use for FPU initialization works for BSP core but not for AP?
I have the same control registers configuration on BSP and AP.
Another question is about Visual C++ 2008 compiler:
I developed a math library for floating point operations. If I compile this library without /QIFIST option (that will be deprecated) when I use it in a task or program I receive this linker error:
error LNK2019: riferimento al simbolo esterno __ftol2_sse non risolto nella funzione ___kernel_sin
(in english is: cannot resolve external symbol reference __ftol2_sse)
I cannot use default libraries because I'm developing a SIL4 system.
I know what is ftol2_sse but I don't know how to resolve this problem without using \QIFIST options.
Could you help me guys?
I have another question about FPU.
Does Anybody know why the same procedure that I use for FPU initialization works for BSP core but not for AP?
I have the same control registers configuration on BSP and AP.
Another question is about Visual C++ 2008 compiler:
I developed a math library for floating point operations. If I compile this library without /QIFIST option (that will be deprecated) when I use it in a task or program I receive this linker error:
error LNK2019: riferimento al simbolo esterno __ftol2_sse non risolto nella funzione ___kernel_sin
(in english is: cannot resolve external symbol reference __ftol2_sse)
I cannot use default libraries because I'm developing a SIL4 system.
I know what is ftol2_sse but I don't know how to resolve this problem without using \QIFIST options.
Could you help me guys?
Re: FPU problems (again)
Because your code is broken? Seriously, that's the best answer I can give without you providing any details whatsoever...Does Anybody know why the same procedure that I use for FPU initialization works for BSP core but not for AP?
Re: FPU problems (again)
I don't know which detail I can provide.
Because my FPU initialization code is working on BSP, but not on AP.
When I try to execute a floating point instruction (f.e.: "float f = 0.1;") I receive an exception from AP's FPU...
I don't know what can i do to find the problem...
Because my FPU initialization code is working on BSP, but not on AP.
When I try to execute a floating point instruction (f.e.: "float f = 0.1;") I receive an exception from AP's FPU...
I don't know what can i do to find the problem...
Re: FPU problems (again)
Your initialization code might be usefulI don't know which detail I can provide.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: FPU problems (again)
The intel manuals have an exhaustive list of causes for exceptions per exception number, as well as potential exceptions per instruction. Have you looked through those?
Re: FPU problems (again)
@Cjreek:
nasm assembly:
@Combuster
I read Intel reference for FPU exception, by now I can't find any help to resolve so I try to ask here!
nasm assembly:
Code: Select all
FUNCTION SysFpuInit
push eax
mov eax, cr0
and eax, 0xfffffffb
or eax, 0x22
mov cr0, eax
clts
pop eax
ret
ENDFUNC SysFpuInit
I read Intel reference for FPU exception, by now I can't find any help to resolve so I try to ask here!
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: FPU problems (again)
You missed the point. You get an exception, that means you have an exception number, instruction causing the fault, and a CPU state. Have you gone through all the options listed under that instruction (intel 2A/B) to see what caused the fault in question? Have you gone through all the common causes for that exception (intel 3A) and eliminated them one by one?I read Intel reference for FPU exception, by now I can't find any help to resolve so I try to ask here!
If no, you have some work to do .
If yes, you did something wrong. Post the state mentioned above, and the list of causes in the manual and explain to us, for each of them, why they can not be the cause. That way we can actually see the mistake and help you out.
Re: FPU problems (again)
Yes! I examine the exception linked with "my" status word.Combuster wrote:You missed the point. You get an exception, that means you have an exception number, instruction causing the fault, and a CPU state. Have you gone through all the options listed under that instruction (intel 2A/B) to see what caused the fault in question? Have you gone through all the common causes for that exception (intel 3A) and eliminated them one by one?I read Intel reference for FPU exception, by now I can't find any help to resolve so I try to ask here!
If no, you have some work to do .
If yes, you did something wrong. Post the state mentioned above, and the list of causes in the manual and explain to us, for each of them, why they can not be the cause. That way we can actually see the mistake and help you out.
When I execute this instruction "f = 5.0, where f is defined as float", I obtain 33473 in status word.
Now I'm a little confused but this value means Stack overflow exception:
Code: Select all
When the x87 FPU detects stack overflow or underflow, it sets the IE flag (bit 0) and
the SF flag (bit 6) in the x87 FPU status word to 1. It then sets condition-code flag C1
(bit 9) in the x87 FPU status word to 1 if stack overflow occurred or to 0 if stack
underflow occurred.
Any help?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: FPU problems (again)
So it is a FPU stack overflow. What does that mean? Can you make one occur under any condition? What do you need to make that happen? How can you prevent that from happening?
Debugging effort is not about spending x minutes on the task and then asking, it requires that you spent at least x minutes on every clue you get. If you discover something possibly related to the problem, it means you have even more debugging to do. Unless, of course, you found the source of the problem.
Bad questions involve "I walked 10 miles, I'm bored. Can someone drive me the last two miles?", Good questions involve "I walked 10 miles but the environment looks the same, can someone come pick me up?"
Debugging effort is not about spending x minutes on the task and then asking, it requires that you spent at least x minutes on every clue you get. If you discover something possibly related to the problem, it means you have even more debugging to do. Unless, of course, you found the source of the problem.
Bad questions involve "I walked 10 miles, I'm bored. Can someone drive me the last two miles?", Good questions involve "I walked 10 miles but the environment looks the same, can someone come pick me up?"
Re: FPU problems (again)
Dear Combuster,Combuster wrote:So it is a FPU stack overflow. What does that mean? Can you make one occur under any condition? What do you need to make that happen? How can you prevent that from happening?
Debugging effort is not about spending x minutes on the task and then asking, it requires that you spent at least x minutes on every clue you get. If you discover something possibly related to the problem, it means you have even more debugging to do. Unless, of course, you found the source of the problem.
Bad questions involve "I walked 10 miles, I'm bored. Can someone drive me the last two miles?", Good questions involve "I walked 10 miles but the environment looks the same, can someone come pick me up?"
I post a question about this because is incomprehensible for me why a code that works on one core don't works for other core. If you can't or don't want to explain me why I have a stack overflow when I assign a value to a floating point variable no problem, but don't give me a life lesson ok? I'm searching for answers not unuseful lessons.
Thank you anyway
Re: FPU problems (again)
Did you do an on the ap core
Code: Select all
fninit
If a trainstation is where trains stop, what is a workstation ?
Re: FPU problems (again)
Sure!gerryg400 wrote:Did you do anon the ap coreCode: Select all
fninit
The strangest thing is that the status word after initialization is not 0, like it should be after a fninit instruction (and like it is on BSP core). There must be something wrong in AP's FPU initialization but I'm not able to find what
So I asked some help here...not because I don't want to resolve it myself!
Re: FPU problems (again)
You can be as annoyed as you like, but you didn't mention that you'd performed an fninit before, and you didn't mention that the status word was different before.matute81 wrote:Sure!gerryg400 wrote:Did you do anon the ap coreCode: Select all
fninit
The strangest thing is that the status word after initialization is not 0, like it should be after a fninit instruction (and like it is on BSP core). There must be something wrong in AP's FPU initialization but I'm not able to find what
So I asked some help here...not because I don't want to resolve it myself!
Garbage in, Garbage out.
Re: FPU problems (again)
Where is the fninit ?matute81 wrote:@Cjreek:
nasm assembly:Code: Select all
FUNCTION SysFpuInit push eax mov eax, cr0 and eax, 0xfffffffb or eax, 0x22 mov cr0, eax clts pop eax ret ENDFUNC SysFpuInit
If a trainstation is where trains stop, what is a workstation ?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: FPU problems (again)
You too, young padawan, must learn that giving a fish feeds a man for a day, and teaching to fish feeds a man for a lifetime. If you know how to debug, you know how to solve most of your development problems. Just remember if you don't want my kind of help, don't give me the excuse to give my kind of help, because I will.matute81 wrote:Dear Combuster,
I post a question about this because is incomprehensible for me why a code that works on one core don't works for other core. If you can't or don't want to explain me why I have a stack overflow when I assign a value to a floating point variable no problem, but don't give me a life lesson ok? I'm searching for answers not unuseful lessons.
Thank you anyway
Now since gerry's (and mine) initial guess was wrong, show us the facts you keep hiding from us, which are incidentally the facts you should be using to make your own conclusion.