]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/Ebc/Dxe/Ipf/IpfMul.s
These files are no longer needed as the PE32 and Cache Lib from the MDE make them...
[mirror_edk2.git] / EdkModulePkg / Universal / Ebc / Dxe / Ipf / IpfMul.s
1 ///*++
2 //
3 // Copyright (c) 2006, Intel Corporation
4 // All rights reserved. This program and the accompanying materials
5 // are licensed and made available under the terms and conditions of the BSD License
6 // which accompanies this distribution. The full text of the license may be found at
7 // http://opensource.org/licenses/bsd-license.php
8 //
9 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 //
12 //Module Name:
13 //
14 // IpfMul.s
15 //
16 //Abstract:
17 //
18 // Low level routines for IPF multiply support
19 //
20 //--*/
21
22 .file "IpfMul.s"
23 .section .text
24
25 .proc MulS64x64#
26 .align 32
27 .globl MulS64x64#
28 .align 32
29
30 ///*++
31 //
32 //Routine Description:
33 //
34 // Multiply two 64-bit signed numbers.
35 //
36 //
37 //Arguments:
38 //
39 // INT64
40 // MulS64x64 (
41 // IN INT64 Value1,
42 // IN INT64 Value2,
43 // OUT INT64 *ResultHigh);
44 //
45 //Returns:
46 //
47 // 64-bit signed result
48 //
49 //--*/
50
51 MulS64x64:
52 // signed 64x64->128-bit multiply
53 // A in r32, B in r33, Q_hi stored in [r34], Q_lo returned in r8
54 { .mfi
55 alloc r31=ar.pfs,3,0,0,0 // r32-r34
56 nop.f 0
57 nop.i 0;;
58 }
59 {.mmi
60 setf.sig f6=r32
61 setf.sig f7=r33
62 nop.i 0;;
63 }
64
65 {.mfi
66 nop.m 0
67 xma.h f8=f6,f7,f0
68 nop.i 0
69 }
70 {.mfi
71 nop.m 0
72 xma.l f6=f6,f7,f0
73 nop.i 0;;
74 }
75
76
77 {.mmb
78 stf8 [r34]=f8
79 getf.sig r8=f6
80 br.ret.sptk b0;;
81 }
82
83 .endp MulS64x64
84
85 .proc MulU64x64#
86 .align 32
87 .globl MulU64x64#
88 .align 32
89
90
91 ///*++
92 //
93 //Routine Description:
94 //
95 // Multiply two 64-bit unsigned numbers.
96 //
97 //
98 //Arguments:
99 //
100 // UINT64
101 // MulU64x64 (
102 // IN UINT64 Value1,
103 // IN UINT64 Value2,
104 // OUT UINT64 *ResultHigh);
105 //
106 //Returns:
107 //
108 // 64-bit unsigned result
109 //
110 //--*/
111 MulU64x64:
112 // A in r32, B in r33, Q_hi stored in [r34], Q_lo returned in r8
113 { .mfi
114 alloc r31=ar.pfs,3,0,0,0 // r32-r34
115 nop.f 0
116 nop.i 0;;
117 }
118 {.mmi
119 setf.sig f6=r32
120 setf.sig f7=r33
121 nop.i 0;;
122 }
123
124 {.mfi
125 nop.m 0
126 xma.hu f8=f6,f7,f0
127 nop.i 0
128 }
129 {.mfi
130 nop.m 0
131 xma.l f6=f6,f7,f0
132 nop.i 0;;
133 }
134
135
136 {.mmb
137 stf8 [r34]=f8
138 getf.sig r8=f6
139 br.ret.sptk b0;;
140 }
141
142 .endp MulU64x64
143
144