Thread (7 messages) 7 messages, 4 authors, 2010-06-02

Re: [PATCH] KVM: PPC: elide struct thread_struct instances from stack

From: Alexander Graf <hidden>
Date: 2010-05-31 23:27:15
Also in: kvm

On 01.06.2010, at 00:40, Paul Mackerras wrote:
On Mon, May 31, 2010 at 09:59:13PM +0200, Andreas Schwab wrote:
=20
quoted
Instead of instantiating a whole thread_struct on the stack use only =
the
quoted
required parts of it.
=20
...
=20
quoted
+_GLOBAL(kvm_cvt_fd)
+	lfd	0,0(r5)			/* load up fpscr value */
+	MTFSF_L(0)
+	lfs	0,0(r3)
+	stfd	0,0(r4)
+	mffs	0
+	stfd	0,0(r5)			/* save new fpscr value */
+	blr
+
+_GLOBAL(kvm_cvt_df)
+	lfd	0,0(r5)			/* load up fpscr value */
+	MTFSF_L(0)
+	lfd	0,0(r3)
+	stfs	0,0(r4)
+	mffs	0
+	stfd	0,0(r5)			/* save new fpscr value */
+	blr
=20
I re-read the relevant part of the PowerPC architecture spec
yesterday, and it seems pretty clear that the FPSCR doesn't affect the
behaviour of lfs and stfs, and is not affected by them.  So in fact 4
out of the 7 instructions in each of those procedures are unnecessary
(and similarly for the cvt_fd/df used in the alignment fixup code).
So the rounding control field is not used on lfs? Interesting. I =
couldn't find a reference to it being used or modified either though.

Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help