The hardware floating point unit in MPC8280 didn't work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The hardware floating point unit in MPC8280 didn't work

784 Views
ui009123
Contributor I

Hello, I use the CodeWarriorV8.8 application without operating system to compile MPC8280, and the application file is running  incorrectly when the board directly boots because hardware floating point unit is not working. I use lfs floating point instruction to store  1.0 which is 0x3F800000 in IEEE 745 into 32 floating point registers. The instruction is following:

mtfsfi 7,0

mtfsfi 0,0

addis r5,0, 0x3f800000

ori r5,r5,0

lfs fp0,0(r5)

...

lfs fp31,0(r5)

And floating point registers are not 1.0 but -6.3424x10^-36.

But I use the USB Tag to debug, and the floating point unit is working correctly where 1.0 is 0x3ff00000.

In the bare case, what CodewarroirV8.8 also need to configure or what procedures also need to add, in order to make the normal work of the hardware floating point unit of MPC8280?

0 Kudos
3 Replies

635 Views
ui009123
Contributor I

The problem was CodeWarrior V8.8 which should update. And the question was solved.

0 Kudos

635 Views
Pavel
NXP Employee
NXP Employee

CodeWarrior wizard creates project using hardware floating point in default.

There is no mistake if floating point is used under CodeWarrior.

It looks like that your code is incorrect.

For example, check the following:

addis r5,0, 0x3f800000

 

This line should be the following:

addis r5,0, 0x3f80

 

Compare your assembler code using floating point procedure using C language.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

635 Views
ui009123
Contributor I

Hello, thanks for your answers.

I'm sorry that I wrote the wrong code in question. But I exactly use the code which is the following:

addis r5,0,0x3f80

I am afraid  the I do not understand the "Compare your assembler code using floating point procedure using C language". I only use the assembler code using floating point procedure.

Can you explain it more specificly or have any ideas for this question?

Thank you

ZhangRong

0 Kudos