Resync the GNU assembly to the MASM code.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@192 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
bbahnsen 2006-05-17 23:30:57 +00:00
parent 88758fe28d
commit 7962c48c97
4 changed files with 138 additions and 153 deletions

View File

@ -1,39 +1,35 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# DivU64x32.asm
#
# Abstract:
#
# Calculate the quotient of a 64-bit integer by a 32-bit integer
#
#------------------------------------------------------------------------------
.global _DivU64x32
_DivU64x32:
movl 8(%esp),%eax
movl 12(%esp),%ecx
xorl %edx,%edx
divl %ecx
pushl %eax
movl 8(%esp),%eax
divl %ecx
popl %edx
ret
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# DivU64x32.asm
#
# Abstract:
#
# Calculate the quotient of a 64-bit integer by a 32-bit integer
#
#------------------------------------------------------------------------------
.386:
.code:
.global _InternalMathDivU64x32
_InternalMathDivU64x32:
movl 8(%esp),%eax
movl 12(%esp),%ecx
xorl %edx,%edx
divl %ecx
pushl %eax
movl 8(%esp),%eax
divl %ecx
popl %edx
ret

View File

@ -1,39 +1,36 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# LShiftU64.asm
#
# Abstract:
#
# 64-bit left shift function for IA-32
#
#------------------------------------------------------------------------------
.global _LShiftU64
_LShiftU64:
movb 12(%esp),%cl
xorl %eax,%eax
movl 4(%esp),%edx
testb $32,%cl
cmovz %edx, %eax
cmovz 8(%esp), %edx
shldl %cl,%eax,%edx
shll %cl,%eax
ret
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# LShiftU64.asm
#
# Abstract:
#
# 64-bit left shift function for IA-32
#
#------------------------------------------------------------------------------
.686:
#.MODEL flat,C
.code:
.global _InternalMathLShiftU64
_InternalMathLShiftU64:
movb 12(%esp), %cl
xorl %eax, %eax
movl 4(%esp), %edx
testb $32, %cl
cmovz %edx, %eax
cmovz 0x8(%esp), %edx
shld %cl,%eax,%edx
shl %cl, %eax
ret

View File

@ -1,36 +1,32 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# MultU64x32.asm
#
# Abstract:
#
# Calculate the product of a 64-bit integer and a 32-bit integer
#
#------------------------------------------------------------------------------
.global _MultU64x32
_MultU64x32:
movl 12(%esp),%ecx
movl %ecx,%eax
imull 8(%esp),%ecx
mull 4(%esp)
addl %ecx,%edx
ret
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# MultU64x32.asm
#
# Abstract:
#
# Calculate the product of a 64-bit integer and a 32-bit integer
#
#------------------------------------------------------------------------------
.386:
.code:
.global _InternalMathMultU64x32
_InternalMathMultU64x32:
movl 12(%esp),%ecx
movl %ecx,%eax
imull 8(%esp),%ecx
mull 0x4(%esp)
addl %ecx,%edx
ret

View File

@ -1,39 +1,35 @@
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# RShiftU64.asm
#
# Abstract:
#
# 64-bit logical right shift function for IA-32
#
#------------------------------------------------------------------------------
.global _RShiftU64
_RShiftU64:
movb 12(%esp),%cl
xorl %edx,%edx
movl 8(%esp),%eax
testb $32,%cl
cmovz %eax, %edx
cmovz 4(%esp), %eax
shrdl %cl,%edx,%eax
shrl %cl,%edx
ret
#------------------------------------------------------------------------------
#
# Copyright (c) 2006, Intel Corporation
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
# Module Name:
#
# RShiftU64.asm
#
# Abstract:
#
# 64-bit logical right shift function for IA-32
#
#------------------------------------------------------------------------------
.686:
.code:
.global InternalMathRShiftU64
_InternalMathRShiftU64:
movb 12(%esp),%cl
xorl %edx,%edx
movl 8(%esp),%eax
testb $32,%cl
cmovz %eax, %edx
cmovz 0x4(%esp), %eax
shrdl %cl,%edx,%eax
shr %cl,%edx
ret