]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/BaseLib: Support IA32 processors without CMOVx
authorMichael Kinney <michael.d.kinney@intel.com>
Mon, 27 Apr 2015 19:38:39 +0000 (19:38 +0000)
committermdkinney <mdkinney@Edk2>
Mon, 27 Apr 2015 19:38:39 +0000 (19:38 +0000)
Remove use of CMOVx instruction from IA32 assembly files in BaseLib.
This matches compiler flags for all supported C compilers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17213 6f19259b-4bc3-4df7-8a09-765794883524

16 files changed:
MdePkg/Library/BaseLib/BaseLib.inf
MdePkg/Library/BaseLib/Ia32/ARShiftU64.S
MdePkg/Library/BaseLib/Ia32/ARShiftU64.asm
MdePkg/Library/BaseLib/Ia32/ARShiftU64.c
MdePkg/Library/BaseLib/Ia32/LRotU64.S
MdePkg/Library/BaseLib/Ia32/LRotU64.asm
MdePkg/Library/BaseLib/Ia32/LRotU64.c
MdePkg/Library/BaseLib/Ia32/LShiftU64.S
MdePkg/Library/BaseLib/Ia32/LShiftU64.asm
MdePkg/Library/BaseLib/Ia32/LShiftU64.c
MdePkg/Library/BaseLib/Ia32/RRotU64.S
MdePkg/Library/BaseLib/Ia32/RRotU64.asm
MdePkg/Library/BaseLib/Ia32/RRotU64.c
MdePkg/Library/BaseLib/Ia32/RShiftU64.S
MdePkg/Library/BaseLib/Ia32/RShiftU64.asm
MdePkg/Library/BaseLib/Ia32/RShiftU64.c

index fc0cb9638baaf23496b4589b0c08207299a54358..4a37e60fe38bed07a8fbdab7e5a53bbdca671713 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Base Library implementation.\r
 #\r
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
 #  Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
 #  Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>\r
 #\r
@@ -21,7 +21,7 @@
   MODULE_UNI_FILE                = BaseLib.uni\r
   FILE_GUID                      = 27d67720-ea68-48ae-93da-a3a074c90e30\r
   MODULE_TYPE                    = BASE\r
-  VERSION_STRING                 = 1.0\r
+  VERSION_STRING                 = 1.1\r
   LIBRARY_CLASS                  = BaseLib \r
 \r
 #\r
index 8f73ed4f6967f65e24e179a7f773626b0f449ab9..9138c423fc0a3c83be6a4f26793939886f171eab 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -34,8 +34,10 @@ ASM_PFX(InternalMathARShiftU64):
     movl    8(%esp), %eax\r
     cltd\r
     testb   $32, %cl\r
-    cmovz   %eax, %edx\r
-    cmovz   4(%esp), %eax\r
+    jnz     L0\r
+    movl    %eax, %edx\r
+    movl    4(%esp), %eax\r
+L0:    \r
     shrdl   %cl, %edx, %eax\r
     sar     %cl, %edx\r
     ret\r
index 9d53969bb670adc5e338b8eb802b3d5cd37606f7..10f04c3875166780aa56122404d220b4bed7d6b2 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -36,8 +36,10 @@ InternalMathARShiftU64  PROC
     mov     eax, [esp + 8]\r
     cdq\r
     test    cl, 32\r
-    cmovz   edx, eax\r
-    cmovz   eax, [esp + 4]\r
+    jnz     @F\r
+    mov     edx, eax\r
+    mov     eax, [esp + 4]\r
+@@:    \r
     shrd    eax, edx, cl\r
     sar     edx, cl\r
     ret\r
index 754b25f511cdbed81d14b6ff2c061017527ec448..b1edc675e0374397983402eb6fdaa4be6b853dd1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   64-bit arithmetic right shift function for IA-32.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,8 +40,10 @@ InternalMathARShiftU64 (
     mov     eax, dword ptr [Operand + 4]\r
     cdq\r
     test    cl, 32\r
-    cmovz   edx, eax\r
-    cmovz   eax, dword ptr [Operand + 0]\r
+    jnz     L0\r
+    mov     edx, eax\r
+    mov     eax, dword ptr [Operand + 0]\r
+L0:\r
     shrd    eax, edx, cl\r
     sar     edx, cl\r
   }\r
index e9aeeb6387d821fc878f4bae88ef251a74f69e7e..ff450fa1f5cc8f029c27f14464830ee92457c424 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -39,8 +39,10 @@ ASM_PFX(InternalMathLRotU64):
     rorl    %cl, %ebx\r
     shldl   %cl, %ebx, %eax\r
     testb   $32, %cl                    # Count >= 32?\r
-    cmovnz  %eax, %ecx\r
-    cmovnz  %edx, %eax\r
-    cmovnz  %ecx, %edx\r
+    jz      L0\r
+    movl    %eax, %ecx\r
+    movl    %edx, %eax\r
+    movl    %ecx, %edx\r
+L0:    \r
     pop     %ebx\r
     ret\r
index bfdf82d459c57c2a53228f3e78869b19517b6d1b..9e6a94e792021109b7ffd6e1159e75633271d49b 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,9 +40,11 @@ InternalMathLRotU64 PROC    USES    ebx
     ror     ebx, cl\r
     shld    eax, ebx, cl\r
     test    cl, 32                      ; Count >= 32?\r
-    cmovnz  ecx, eax\r
-    cmovnz  eax, edx\r
-    cmovnz  edx, ecx\r
+    jz      @F\r
+    mov     ecx, eax\r
+    mov     eax, edx\r
+    mov     edx, ecx\r
+@@:    \r
     ret\r
 InternalMathLRotU64 ENDP\r
 \r
index 1c805aad99e47b476cc474dc4f55c4beca389f8c..2e01ed8bb051fcb2fb4462f7849f9b21caa82070 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   64-bit left rotation for Ia32\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -45,9 +45,11 @@ InternalMathLRotU64 (
     ror     ebx, cl\r
     shld    eax, ebx, cl\r
     test    cl, 32                      ; Count >= 32?\r
-    cmovnz  ecx, eax\r
-    cmovnz  eax, edx\r
-    cmovnz  edx, ecx\r
+    jz      L0\r
+    mov     ecx, eax\r
+    mov     eax, edx\r
+    mov     edx, ecx\r
+L0:\r
   }\r
 }\r
 \r
index 31df0d6768b460e11eed5a8db59d3b548b914f1a..dcdbeae1d74925517a1e82ee0d29bd0796a4d3a9 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -34,8 +34,10 @@ ASM_PFX(InternalMathLShiftU64):
     xorl    %eax, %eax\r
     movl    4(%esp), %edx\r
     testb   $32, %cl                    # Count >= 32?\r
-    cmovz   %edx, %eax\r
-    cmovz   0x8(%esp), %edx\r
+    jnz     L0\r
+    movl    %edx, %eax\r
+    movl    0x8(%esp), %edx\r
+L0:    \r
     shld    %cl, %eax, %edx\r
     shl     %cl, %eax\r
     ret\r
index a5447e8f580ddc3c7c689dec822f7fda10279450..15b724270c4a6559e8e0d01ca0cc9540a19226c8 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -36,8 +36,10 @@ InternalMathLShiftU64   PROC
     xor     eax, eax\r
     mov     edx, [esp + 4]\r
     test    cl, 32                      ; Count >= 32?\r
-    cmovz   eax, edx\r
-    cmovz   edx, [esp + 8]\r
+    jnz     @F\r
+    mov     eax, edx\r
+    mov     edx, [esp + 8]\r
+@@:    \r
     shld    edx, eax, cl\r
     shl     eax, cl\r
     ret\r
index 472fed1d29d8c13ed4d355c6e854d67e63f12473..9fb2532acf784cce56f1ec8f177a3c134a428e79 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   64-bit left shift function for IA-32.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,8 +40,10 @@ InternalMathLShiftU64 (
     xor     eax, eax\r
     mov     edx, dword ptr [Operand + 0]\r
     test    cl, 32                      // Count >= 32?\r
-    cmovz   eax, edx\r
-    cmovz   edx, dword ptr [Operand + 4]\r
+    jnz     L0\r
+    mov     eax, edx\r
+    mov     edx, dword ptr [Operand + 4]\r
+L0:\r
     shld    edx, eax, cl\r
     shl     eax, cl\r
   }\r
index 54fc089023c15b851e016d76548c2f940c7c0ecc..f42f45018990b08fcfa6fde29cdc67c7a4e68363 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -39,8 +39,10 @@ ASM_PFX(InternalMathRRotU64):
     roll    %cl, %ebx\r
     shrdl   %cl, %ebx, %edx\r
     testb   $32, %cl                    # Count >= 32?\r
-    cmovnz  %eax, %ecx                  # switch eax & edx if Count >= 32\r
-    cmovnz  %edx, %eax\r
-    cmovnz  %ecx, %edx\r
+    jz      L0\r
+    movl    %eax, %ecx                  # switch eax & edx if Count >= 32\r
+    movl    %edx, %eax\r
+    movl    %ecx, %edx\r
+L0:    \r
     pop     %ebx\r
     ret\r
index a719d2976584c0afbd689d645db2581feb99b3e1..6afb0cc0fcdae4b836095c19ec803406910f1e16 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,9 +40,11 @@ InternalMathRRotU64 PROC    USES    ebx
     rol     ebx, cl\r
     shrd    edx, ebx, cl\r
     test    cl, 32                      ; Count >= 32?\r
-    cmovnz  ecx, eax                    ; switch eax & edx if Count >= 32\r
-    cmovnz  eax, edx\r
-    cmovnz  edx, ecx\r
+    jz      @F\r
+    mov     ecx, eax                    ; switch eax & edx if Count >= 32\r
+    mov     eax, edx\r
+    mov     edx, ecx\r
+@@:    \r
     ret\r
 InternalMathRRotU64 ENDP\r
 \r
index f6ee6d65eb75fca557d00b7069010ba34d7cda7a..17fde84b9d7a905e72eb87e4dc80e4aa0b8d69b1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   64-bit right rotation for Ia32\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -45,9 +45,11 @@ InternalMathRRotU64 (
     rol     ebx, cl\r
     shrd    edx, ebx, cl\r
     test    cl, 32                      // Count >= 32?\r
-    cmovnz  ecx, eax\r
-    cmovnz  eax, edx\r
-    cmovnz  edx, ecx\r
+    jz      L0\r
+    mov     ecx, eax\r
+    mov     eax, edx\r
+    mov     edx, ecx\r
+L0:\r
   }\r
 }\r
 \r
index 17cdedb212efddd3f9eb2428dacb10e69df3b04a..0bf9292281ab8c8a076b7580808a44d1d2cf7c21 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #\r
-# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -37,8 +37,10 @@ ASM_PFX(InternalMathRShiftU64):
     xorl    %edx, %edx\r
     movl    8(%esp), %eax\r
     testb   $32, %cl                    # Count >= 32?\r
-    cmovz   %eax, %edx\r
-    cmovz   0x4(%esp), %eax\r
+    jnz     L0\r
+    movl    %eax, %edx\r
+    movl    0x4(%esp), %eax\r
+L0:    \r
     shrdl   %cl, %edx, %eax\r
     shr     %cl, %edx\r
     ret\r
index 2fe60572ee99c6abcfb691bca2adc03c3396cbeb..94f70466ddb4fdde16c59da3b32f2ee15f525c2c 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
 ; This program and the accompanying materials\r
 ; are licensed and made available under the terms and conditions of the BSD License\r
 ; which accompanies this distribution.  The full text of the license may be found at\r
@@ -36,8 +36,10 @@ InternalMathRShiftU64   PROC
     xor     edx, edx\r
     mov     eax, [esp + 8]\r
     test    cl, 32                      ; Count >= 32?\r
-    cmovz   edx, eax\r
-    cmovz   eax, [esp + 4]\r
+    jnz     @F\r
+    mov     edx, eax\r
+    mov     eax, [esp + 4]\r
+@@:    \r
     shrd    eax, edx, cl\r
     shr     edx, cl\r
     ret\r
index 89b0e95d545832cb5ffc6634dfe9c9413822c766..8b494856356a5633a742389fd130980d3169f0ae 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   64-bit logical right shift function for IA-32\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -40,8 +40,10 @@ InternalMathRShiftU64 (
     xor     edx, edx\r
     mov     eax, dword ptr [Operand + 4]\r
     test    cl, 32\r
-    cmovz   edx, eax\r
-    cmovz   eax, dword ptr [Operand + 0]\r
+    jnz     L0\r
+    mov     edx, eax\r
+    mov     eax, dword ptr [Operand + 0]\r
+L0:\r
     shrd    eax, edx, cl\r
     shr     edx, cl\r
   }\r