VirtualBox

source: vbox/trunk/src/VBox/Disassembler/testcase/tstDisasm-1A.asm@ 41868

Last change on this file since 41868 was 41868, checked in by vboxsync, 12 years ago

3DNow! testcases.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 KB
Line 
1; $Id: tstDisasm-1A.asm 41868 2012-06-21 21:08:40Z vboxsync $
2;; @file
3; VBox disassembler: Assembler test routines
4;
5
6;
7; Copyright (C) 2006-2010 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17
18;*******************************************************************************
19;* Header Files *
20;*******************************************************************************
21%include "iprt/asmdefs.mac"
22;%include "VBox/vmm/vm.mac"
23;%include "VBox/err.mac"
24;%include "VBox/vmm/stam.mac"
25;%include "iprt/x86.mac"
26
27BITS 32
28
29
30BEGINCODE
31
32align 16
33BEGINPROC TestProc32
34 xor eax, eax
35 mov al, 4
36 lea edx, [4]
37 mov edx, 4
38 mov eax, 4
39 shl eax, 4
40 shl edx, 4
41 shr edx, 4
42 mov eax, edx
43 mov eax, ecx
44 mov edx, eax
45 mov ecx, eax
46 DB 0xF0, 0x0F, 0x22, 0xC0
47 DB 0xF0, 0x0F, 0x20, 0xC0
48 smsw word [edx+16]
49 ; invept eax, qword [ecx]
50 DB 0x66, 0x0F, 0x38, 0x80, 0x1
51 ; invept eax, qword [ecx]
52 DB 0x66, 0x0F, 0x38, 0x81, 0x1
53 mov eax, dword [ecx]
54 mov word [edi], 0123ah
55 movzx eax,byte [edx]
56 movzx eax,word [edx]
57 mov dword [es:ebx + 1234h], 0789h
58 mov word [fs:ebx + ecx], 0654h
59 mov byte [esi + eax*4], 054h
60 mov bl, byte [ds:ebp + 1234h]
61 mov al, [cs:1234h + ecx*8]
62 mov al, [cs:1234h]
63 mov ax, [cs:1234h]
64 mov eax, [cs:1234h]
65 lock cmpxchg [ecx], eax
66 lock cmpxchg [ecx], ax
67 lock cmpxchg [ecx], dl
68 movzx ESI,word [EAX]
69 in al, dx
70 in ax, dx
71 in eax, dx
72 mov ebx, [ecx + eax*4 + 17]
73 mov ebx, [ebp + eax*4 + 4]
74 mov ebx, [ebp + eax*4]
75 int 80h
76 in al, 60h
77 in ax, dx
78 out 64h, eax
79
80 movss xmm0, xmm1
81 movss xmm3, [eax]
82 movss [eax], xmm4
83 movsd xmm6, xmm1
84
85 pause
86 nop
87
88 ; 3Dnow!
89 pavgusb mm1, mm0
90 pf2id mm5, mm4
91 pf2iw mm6, mm3
92 pfacc mm7, mm2
93 pfadd mm5, mm4
94 pfcmpeq mm6, mm3
95 pfcmpge mm2, mm7
96 pfcmpgt mm4, mm5
97 pfmax mm3, mm6
98 pfmin mm1, mm0
99 pfmul mm5, mm4
100 pmulhrwa mm3, mm6
101 pfnacc mm4, mm5
102 pfpnacc mm3, mm6
103 pfrcp mm0, mm1
104 pfrcpit1 mm2, mm7
105 pfrcpit2 mm4, mm5
106 pfrsqrt mm7, mm2
107 pfrsqit1 mm1, mm0
108 pfsub mm6, mm3
109 pfsubr mm0, mm1
110 pi2fd mm7, mm2
111 pi2fw mm0, mm1
112 pswapd mm2, mm7
113
114 pavgusb mm1, qword [es:eax+000000010h]
115 pf2id mm5, qword [ds:esi+000101010h]
116 pf2iw mm6, qword [fs:esi+000101010h]
117 pfacc mm7, qword [gs:esi+000101010h]
118 pfadd mm5, qword [ esi+000101010h]
119 pfcmpeq mm6, qword [ edi*8+000101010h]
120 pfcmpge mm2, qword [es:esi+000100010h]
121 pfcmpgt mm4, qword [es:esi+000101010h]
122 pfmax mm3, qword [es:esi+000101010h]
123 pfmin mm1, qword [es:esi+000101010h]
124 pfmul mm5, qword [es:esi+000101000h]
125 pmulhrwa mm3, qword [es:eax+0ffffffffh]
126 pfnacc mm4, qword [es:ebx+000101010h]
127 pfpnacc mm3, qword [es:edx+000102900h]
128 pfrcp mm0, qword [es:ecx+000101020h]
129 pfrcpit1 mm2, qword [es:ebp+000101510h]
130 pfrcpit2 mm4, qword [es:esp+000101310h]
131 pfrsqrt mm7, qword [es:esi+0f0106010h]
132 pfrsqit1 mm1, qword [es:edi+0001f1010h]
133 pfsub mm6, qword [es:esi*2]
134 pfsubr mm0, qword [es:esi*3]
135 pi2fd mm7, qword [es:esi*4]
136 pi2fw mm0, qword [es:esi*5]
137 pswapd mm2, qword [es:esi*8]
138
139 pmulhrwa mm0, qword [ds:ebp+edi*8+00f000001h]
140
141
142 ; MMX
143 psubusb mm1, mm3
144 cvtpi2pd xmm0, mm3
145 paddd mm1, mm3
146 paddd xmm1, xmm3
147ENDPROC TestProc32
148
149
150%ifndef RT_OS_OS2
151BITS 64
152align 16
153BEGINPROC TestProc64
154 mov cr8, rax
155 mov cr8, rbx
156 mov [0xfffe0080], rax
157 mov [0xfffe0080], rbx
158 mov rax, cr8
159 mov rbx, cr8
160 mov rax, [0xfffe0080]
161 mov rbx, [0xfffe0080]
162 divsd xmm1, xmm0
163 ; invept rdi, qword [rsi]
164 DB 0x66, 0x0F, 0x38, 0x80, 0x3E
165 ; invept rcx, qword [rdx]
166 DB 0x66, 0x0F, 0x38, 0x80, 0xA
167 ;invvpid rdi, qword [rsi]
168 DB 0x66, 0x0F, 0x38, 0x81, 0x3E
169 ; invvpid rcx, qword [rdx]
170 DB 0x66, 0x0F, 0x38, 0x81, 0xA
171 mov rdi, [rsi]
172 mov rcx, [rdx]
173 db 48h
174 db 0c7h
175 db 42h
176 db 18h
177 db 20h
178 db 3eh
179 db 23h
180 db 80h
181 call qword [r8+10h]
182 ; test
183 db 48h
184 db 8bh
185 db 44h
186 db 0ah
187 db 0f8h
188 ;incorrectly assembled by yasm; REX.W should not be added!
189 ;test rax, dword 0cc90cc90h
190 db 8bh
191 db 04h
192 db 8dh
193 db 00h
194 db 00h
195 db 0feh
196 db 0ffh
197 mov qword [rcx+rdx], 0
198 mov dword [rcx+rdx], 0
199 and [r15], rax
200 movzx rcx, sil
201 and sil, 3
202 movzx ecx, ah
203 and ah, 3
204
205 sub rcx, 1234h
206 mov rax, qword [0cc90cc90h]
207 mov rax, qword [00c90cc90h]
208 mov rax, dword 0cc90cc90h
209 mov rax, qword 0ffffcc90cc90h
210
211 movzx rax,byte [edx]
212 movzx rax,word [edx]
213 movzx rax,byte [rdx]
214 lock cmpxchg [rcx], rax
215 lock cmpxchg [rcx], ax
216 lock cmpxchg [r15], dl
217 movzx RSI, word [R8]
218 in al, dx
219 in ax, dx
220 in eax, dx
221 mov rbx, [rcx + rax*4 + 17]
222 mov rbx, [rbp + rax*4 + 4]
223 mov rbx, [rbp + rax*4]
224 mov rbx, [ebp + eax*4]
225 int 80h
226 in al, 60h
227 in ax, dx
228 out 64h, eax
229
230 movss xmm0, xmm14
231 movsd xmm6, xmm1
232
233 ret
234ENDPROC TestProc64
235%endif ; !OS2
236
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette