FPU operation problem.
"Rajesh" <[email protected]> Wed, 26 Jul 2006 06:03:17 -0000
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Dear All,
I am trying to execute a function "func_control" in main()
that performs some floating point operations. I have set the FP bit
in MSR while initialization. Following is the mixed code (both
assembly and C code) for that function. As soon as it is crossing the
istruction marked below, it is jumping to "machine check exception".
This function is very large(of around 26KB) and doing a lot of
floating point operations, so its not possible to mention those
operations here.
One more thing in this is that I am using ISR and enabling the FP bit
while entering into ISR.
func_control()
{
00002510: 942180E0 stwu rsp,-32544(rsp)
00002514: 7C0802A6 mflr r0
00002518: 90017F24 stw r0,32548(rsp)
0000251C: 39617F20 addi r11,rsp,32544
00002520: 48006745 bl __save_fpr (0x8c64)
00002524: BDC17E48 stmw r14,32328(rsp)
00002528: 7C3F0B78 mr r31,rsp
0000252C: 80010000 lwz r0,0(rsp)
00002530: 3D60FFFE lis r11,-2
00002534: 396B19F0 addi r11,r11,6640
00002538: 7C01596E stwux r0,rsp,r11 <-------- at this instruction
it is jumping to "machine check exception"
0000253C: C84D8048 lfd fp2,-32696(r13)
double rtb_Abs_h;
double rtb_Sum1;
double rtb_Product3;
double rtb_Saturation3;
.....
.....
.....
}
//machine check exception assembly code
00002290: 00000000 dc.l 0x00000000; Invalid opcode '....'
}
00002294: 4E800020 blr
Can someone please help on this, as I am stuck with this problem from
a long time and not able to fix it?
-regards
Rajesh
-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MPC500/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/