Floating Point Register - stfs

Started by Panda On Smack, May 18, 2009, 05:10:25 PM

Previous topic - Next topic

Panda On Smack

Hey people

How would I go about loading a value into a float point register so i can create a C2 code?

I have this:

stfs f0,512(r3)

I would like to load the value of 0 in to f0 and not use the value 512 places on from r3

ta

Panda On Smack

yeah sorry, i realise that

I want to change the value held in f0 to 0 before calling: stfs f0,512(r3)


Panda On Smack

Thanks

Since posting I just changed:

stfs f0,512(r3)

to

stfs f31,512(r3)

as f31 is unused and always 0 so bit of a cheat but works for time being

Y.S.

#3
You can also load 0 into f0 by the following;

fsubs f0,f0,f0

When loading a value other than 0, a macro could be useful;

.macro lfsi freg,symbol
lis r12,\sumbol@h
ori r12,r12,\symbol@l
stw r12,-4(r1)
lfs \freg,-4(r1)
.endm



Panda On Smack