]> git.proxmox.com Git - mirror_edk2.git/commitdiff
CryptoPkg IntrinsicLib: Add the missing nasm source file
authorLiming Gao <liming.gao@intel.com>
Wed, 10 Aug 2016 12:22:58 +0000 (20:22 +0800)
committerLiming Gao <liming.gao@intel.com>
Thu, 11 Aug 2016 02:08:32 +0000 (10:08 +0800)
Add two name files IntrinsicLib Ia32 MathLShiftS64.nasm and MathRShiftU64.nasm

Cc: Qin Long <qin.long@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm [new file with mode: 0644]
CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm [new file with mode: 0644]
CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf

diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm b/CryptoPkg/Library/IntrinsicLib/Ia32/MathLShiftS64.nasm
new file mode 100644 (file)
index 0000000..a30edbf
--- /dev/null
@@ -0,0 +1,48 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2016, 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
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   MathLShiftS64.nasm\r
+;\r
+; Abstract:\r
+;\r
+;   64-bit Math Worker Function.\r
+;   Shifts a 64-bit signed value left by a certain number of bits.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    SECTION .text\r
+\r
+global ASM_PFX(__ashldi3)\r
+;------------------------------------------------------------------------------\r
+;\r
+; void __cdecl __ashldi3 (void)\r
+;\r
+;------------------------------------------------------------------------------\r
+ASM_PFX(__ashldi3):\r
+    cmp cl,0x40\r
+    jnc ReturnZero\r
+    cmp cl,0x20\r
+    jnc More32\r
+    shld edx,eax,cl\r
+    shl eax,cl\r
+    ret\r
+More32:\r
+    mov edx,eax\r
+    xor eax,eax\r
+    and cl,0x1f\r
+    shl edx,cl\r
+    ret\r
+ReturnZero:\r
+    xor eax,eax\r
+    xor edx,edx\r
+    ret\r
diff --git a/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm b/CryptoPkg/Library/IntrinsicLib/Ia32/MathRShiftU64.nasm
new file mode 100644 (file)
index 0000000..9bf1711
--- /dev/null
@@ -0,0 +1,49 @@
+;------------------------------------------------------------------------------\r
+;\r
+; Copyright (c) 2016, 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
+; http://opensource.org/licenses/bsd-license.php.\r
+;\r
+; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+;\r
+; Module Name:\r
+;\r
+;   MathRShiftU64.nasm\r
+;\r
+; Abstract:\r
+;\r
+;   64-bit Math Worker Function.\r
+;   Shifts a 64-bit unsigned value right by a certain number of bits.\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+    SECTION .text\r
+\r
+;------------------------------------------------------------------------------\r
+;\r
+; void __cdecl __ashrdi3 (void)\r
+;\r
+;------------------------------------------------------------------------------\r
+global ASM_PFX(__ashrdi3)\r
+ASM_PFX(__ashrdi3):\r
+    cmp cl,0x40\r
+    jnc _Exit\r
+    cmp cl,0x20\r
+    jnc More32\r
+    shrd eax,edx,cl\r
+    shr edx,cl\r
+    ret\r
+More32:\r
+    mov eax,edx\r
+    xor edx,edx\r
+    and cl,0x1f\r
+    shr eax,cl\r
+    ret\r
+_Exit:\r
+    xor eax,eax\r
+    xor edx,edx\r
+    ret\r
+\r
index de61dc40ea43bce0d495063972d5db5c0203b878..cd09f53e263ac254a024632ec4095eda5f66f926 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Intrinsic Routines Wrapper Library Instance.\r
 #\r
-#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2016, 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
@@ -41,6 +41,8 @@
 \r
   Ia32/MathLShiftS64.S      | GCC\r
   Ia32/MathRShiftU64.S      | GCC\r
+  Ia32/MathLShiftS64.nasm   | GCC\r
+  Ia32/MathRShiftU64.nasm   | GCC\r
 \r
 [Sources.X64]\r
   CopyMem.c\r