Re: FPU operation problem.

"Mark Allison" <[email protected]> Wed, 26 Jul 2006 06:59:03 -0000
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
oops
Should have said "I presume the address in r13 is word aligned"
(thus putting the load address on a half-word boundary)

--- In [email protected], "Mark Allison" <mark.w.allison@...> 
wrote:
>
> Hi,
> 
> I think its probably actually crashing at while attempting to run 
> the code "lfd      fp2,-32696(r13)" ?
> 
> It looks to me like you are trying to load a floating point value 
> from a mis-aligned address - I presume the address in r13 is half 
> word aligned?. You need to move your floating point data so it is 
> word aligned. 
> 
> I had a lot of this sort of problems myself trying to port some 
old 
> XDADA code across to Greenhills ADA.  Alot of our data was 
contained 
> in data structures which made some elements mis-aligned - not a 
> problem for a 68020 but a definite no no for a 565.
> 
> Regards
> 
> Mark
> 
> --- In [email protected], "Rajesh" <rajesh86us@> wrote:
> >
> > 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
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/TktRrD/gOaOAA/yQLSAA/dN_tlB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------------
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/