From 945f5f400b3d61c72afd0d1fdbfa5d3aad598f57 Mon Sep 17 00:00:00 2001 From: qhuang8 Date: Wed, 12 Aug 2009 02:23:31 +0000 Subject: [PATCH] Use "movd" instruction to manipulate MMX register to support more GNU assemblers. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9055 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S | 2 +- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S | 2 +- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S | 2 +- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S | 2 +- MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S | 2 +- MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S b/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S index 94ca84603e..f964ec455f 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/CopyMem.S @@ -51,7 +51,7 @@ L0: andq $7, %r8 shrq $3, %rcx # rcx <- # of Qwords to copy jz L_CopyBytes - movq %mm0, %r10 # (Save mm0 in r10) ; Why just save 32 bits? + movd %mm0, %r10 # (Save mm0 in r10) L1: movq (%rsi), %mm0 movntq %mm0, (%rdi) diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S index a29be89a1f..ab7507a2bb 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem.S @@ -39,7 +39,7 @@ ASM_PFX(InternalMemSetMem): push %rdi movq %r8, %rax movb %al, %ah - movq %rax, %mm0 + movd %rax, %mm0 movq %rcx, %r8 movq %r8, %rdi # rdi <- Buffer movq %rdx, %rcx diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S index 6ae6793a7e..9ecdacfa43 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem16.S @@ -38,7 +38,7 @@ ASM_GLOBAL ASM_PFX(InternalMemSetMem16) ASM_PFX(InternalMemSetMem16): pushq %rdi movq %r8, %rax - movq %rax, %mm0 + movd %rax, %mm0 movq %rcx, %r8 movq %r8, %rdi movq %rdx, %rcx diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S index c983e6d9c1..130eda428d 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem32.S @@ -36,7 +36,7 @@ #------------------------------------------------------------------------------ ASM_GLOBAL ASM_PFX(InternalMemSetMem32) ASM_PFX(InternalMemSetMem32): - movq %r8, %mm0 # mm0 <- Value + movd %r8, %mm0 # mm0 <- Value movq %rcx, %rax # rax <- Buffer xchgq %rdx, %rcx # rcx <- Count rdx <- Buffer shrq $1, % rcx # rcx <- # of qwords to set diff --git a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S index 10135f8496..373cfa0c59 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S +++ b/MdePkg/Library/BaseMemoryLibMmx/X64/SetMem64.S @@ -35,7 +35,7 @@ #------------------------------------------------------------------------------ ASM_GLOBAL ASM_PFX(InternalMemSetMem64) ASM_PFX(InternalMemSetMem64): - movq %r8, %mm0 #Value + movd %r8, %mm0 #Value movw %rcx, %rax #rax <- Buffer xchg %rdx, %rcx #rcx <- Count L0: diff --git a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S index a9565ce97a..c9f6f493d7 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S +++ b/MdePkg/Library/BaseMemoryLibSse2/X64/SetMem64.S @@ -38,7 +38,7 @@ ASM_PFX(InternalMemSetMem64): movq %rcx, %rax # rax <- Buffer xchgq %rdx, %rcx # rcx <- Count & rdx <- Buffer testb $8, %dl - movq %r8, %xmm0 + movd %r8, %xmm0 jz L0 movq %r8, (%rdx) addq $8, %rdx