[Spice-devel] [PATCH 07/12] xddm/display/res.c: move ALIGN out of Save/RestoreFPU for easier amd64 implementation
Alon Levy
alevy at redhat.com
Wed Apr 30 07:40:31 PDT 2014
---
xddm/display/res.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/xddm/display/res.c b/xddm/display/res.c
index bfb3571..289ece5 100644
--- a/xddm/display/res.c
+++ b/xddm/display/res.c
@@ -1811,13 +1811,11 @@ static void FreeBitmapImage(PDev *pdev, Resource *res) // todo: defer
#ifndef _WIN64
-static _inline void RestoreFPU(PDev *pdev, UINT8 FPUSave[])
+static _inline void RestoreFPU(PDev *pdev, size_t aligned_addr)
{
- void *align_addr = (void *)ALIGN((size_t)(FPUSave), SSE_ALIGN);
-
_asm
{
- mov esi, align_addr
+ mov esi, aligned_addr
movdqa xmm0, [esi]
movdqa xmm1, [esi + 16]
@@ -1826,13 +1824,11 @@ static _inline void RestoreFPU(PDev *pdev, UINT8 FPUSave[])
}
}
-static _inline void SaveFPU(PDev *pdev, UINT8 FPUSave[])
+static _inline void SaveFPU(PDev *pdev, size_t aligned_addr)
{
- void *align_addr = (void *)ALIGN((size_t)(FPUSave), SSE_ALIGN);
-
_asm
{
- mov edi, align_addr
+ mov edi, aligned_addr
movdqa [edi], xmm0
movdqa [edi + 16], xmm1
@@ -1865,7 +1861,8 @@ static _inline Resource *GetBitmapImage(PDev *pdev, SURFOBJ *surf, XLATEOBJ *col
UINT8 *src_end;
UINT8 *dest;
UINT8 *dest_end;
- UINT8 FPUSave[16 * 4 + 15];
+ UINT8 FPUSaveUnaligned[16 * 4 + 15];
+ size_t FPUSave = ALIGN((size_t)(FPUSaveUnaligned), SSE_ALIGN);
BOOL use_sse = FALSE;
DEBUG_PRINT((pdev, 12, "%s\n", __FUNCTION__));
--
1.9.0
More information about the Spice-devel
mailing list