MathReminderU64x64.S revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
756N/A#------------------------------------------------------------------------------
756N/A#
756N/A# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
756N/A# This program and the accompanying materials
756N/A# are licensed and made available under the terms and conditions of the BSD License
756N/A# which accompanies this distribution. The full text of the license may be found at
756N/A# http://opensource.org/licenses/bsd-license.php.
756N/A#
6983N/A# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
6983N/A# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
756N/A#
756N/A# Module Name:
756N/A#
756N/A# MathReminderU64x64.S
6983N/A#
6983N/A# Abstract:
6983N/A#
6983N/A# 64-bit Math Worker Function.
756N/A# Divides a 64-bit unsigned value by another 64-bit unsigned value and returns
756N/A# the 64-bit unsigned remainder
756N/A#
756N/A#------------------------------------------------------------------------------
756N/A
3231N/A .686:
5412N/A .code:
756N/A
756N/AASM_GLOBAL ASM_PFX(__umoddi3), ASM_PFX(DivU64x64Remainder)
5412N/A
2086N/A#------------------------------------------------------------------------------
756N/A#
756N/A# void __cdecl __umoddi3 (void)
756N/A#
756N/A#------------------------------------------------------------------------------
5413N/AASM_PFX(__umoddi3):
756N/A # Original local stack when calling __umoddi3
756N/A # -----------------
756N/A # | |
756N/A # |---------------|
756N/A # | |
756N/A # |-- Divisor --|
756N/A # | |
756N/A # |---------------|
756N/A # | |
756N/A # |-- Dividend --|
756N/A # | |
1400N/A # |---------------|
1400N/A # | ReturnAddr** |
868N/A # ESP---->|---------------|
2086N/A #
756N/A
756N/A #
756N/A # Set up the local stack for Reminder pointer
756N/A #
756N/A sub $8, %esp
756N/A push %esp
756N/A
756N/A #
756N/A # Set up the local stack for Divisor parameter
756N/A #
756N/A movl 28(%esp), %eax
756N/A push %eax
1400N/A movl 28(%esp), %eax
1400N/A push %eax
1400N/A
1400N/A #
1400N/A # Set up the local stack for Dividend parameter
756N/A #
756N/A movl 28(%esp), %eax
756N/A push %eax
756N/A movl 28(%esp), %eax
756N/A push %eax
756N/A
756N/A #
756N/A # Call native DivU64x64Remainder of BaseLib
756N/A #
756N/A jmp ASM_PFX(DivU64x64Remainder)
756N/A
756N/A #
756N/A # Put the Reminder in EDX:EAX as return value
5412N/A #
756N/A movl 20(%esp), %eax
756N/A movl 24(%esp), %edx
756N/A
5413N/A #
756N/A # Adjust stack
756N/A #
756N/A add $28, %esp
756N/A
756N/A ret $16
756N/A