xref: /aosp_15_r20/external/llvm/test/MC/X86/x86-32-ms-inline-asm.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -x86-asm-syntax=intel -triple i386-unknown-unknown --show-encoding %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workermov eax, [ebx].0
4*9880d681SAndroid Build Coastguard Workermov [ebx].4, ecx
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker// CHECK: movl (%ebx), %eax
7*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x8b,0x03]
8*9880d681SAndroid Build Coastguard Worker// CHECK: movl %ecx, 4(%ebx)
9*9880d681SAndroid Build Coastguard Worker// CHECK: encoding: [0x89,0x4b,0x04]
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker_t21:                                   ## @t21
12*9880d681SAndroid Build Coastguard Worker// CHECK: t21
13*9880d681SAndroid Build Coastguard Worker	mov eax, [4*eax + 4]
14*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(,%eax,4), %eax
15*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
16*9880d681SAndroid Build Coastguard Worker    mov eax, [4*eax][4]
17*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(,%eax,4), %eax
18*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x85,0x04,0x00,0x00,0x00]
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker	mov eax, [esi + eax]
21*9880d681SAndroid Build Coastguard Worker// CHECK: movl (%esi,%eax), %eax
22*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x06]
23*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][eax]
24*9880d681SAndroid Build Coastguard Worker// CHECK: movl (%esi,%eax), %eax
25*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x06]
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker	mov eax, [esi + 4*eax]
28*9880d681SAndroid Build Coastguard Worker// CHECK: movl (%esi,%eax,4), %eax
29*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x86]
30*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][4*eax]
31*9880d681SAndroid Build Coastguard Worker// CHECK: movl (%esi,%eax,4), %eax
32*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x04,0x86]
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker    mov eax, [esi + eax + 4]
35*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax), %eax
36*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
37*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][eax + 4]
38*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax), %eax
39*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
40*9880d681SAndroid Build Coastguard Worker	mov eax, [esi + eax][4]
41*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax), %eax
42*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
43*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][eax][4]
44*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax), %eax
45*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x06,0x04]
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker	mov eax, [esi + 2*eax + 4]
48*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax,2), %eax
49*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
50*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][2*eax + 4]
51*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax,2), %eax
52*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
53*9880d681SAndroid Build Coastguard Worker	mov eax, [esi + 2*eax][4]
54*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax,2), %eax
55*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
56*9880d681SAndroid Build Coastguard Worker	mov eax, [esi][2*eax][4]
57*9880d681SAndroid Build Coastguard Worker// CHECK: movl 4(%esi,%eax,2), %eax
58*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x04]
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker	mov eax, 4[esi + 2*eax + 4]
61*9880d681SAndroid Build Coastguard Worker// CHECK: movl 8(%esi,%eax,2), %eax
62*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x08]
63*9880d681SAndroid Build Coastguard Worker	mov eax, 4[esi][2*eax + 4]
64*9880d681SAndroid Build Coastguard Worker// CHECK: movl 8(%esi,%eax,2), %eax
65*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x08]
66*9880d681SAndroid Build Coastguard Worker	mov eax, 4[esi + 2*eax][4]
67*9880d681SAndroid Build Coastguard Worker// CHECK: movl 8(%esi,%eax,2), %eax
68*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x08]
69*9880d681SAndroid Build Coastguard Worker	mov eax, 4[esi][2*eax][4]
70*9880d681SAndroid Build Coastguard Worker// CHECK: movl 8(%esi,%eax,2), %eax
71*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x08]
72*9880d681SAndroid Build Coastguard Worker	mov eax, 4[esi][2*eax][4][8]
73*9880d681SAndroid Build Coastguard Worker// CHECK: movl 16(%esi,%eax,2), %eax
74*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x8b,0x44,0x46,0x10]
75*9880d681SAndroid Build Coastguard Worker
76*9880d681SAndroid Build Coastguard Worker    prefetchnta 64[eax]
77*9880d681SAndroid Build Coastguard Worker// CHECK: prefetchnta 64(%eax)
78*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x0f,0x18,0x40,0x40]
79*9880d681SAndroid Build Coastguard Worker
80*9880d681SAndroid Build Coastguard Worker    pusha
81*9880d681SAndroid Build Coastguard Worker// CHECK: pushal
82*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x60]
83*9880d681SAndroid Build Coastguard Worker    popa
84*9880d681SAndroid Build Coastguard Worker// CHECK: popal
85*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x61]
86*9880d681SAndroid Build Coastguard Worker    pushad
87*9880d681SAndroid Build Coastguard Worker// CHECK: pushal
88*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x60]
89*9880d681SAndroid Build Coastguard Worker    popad
90*9880d681SAndroid Build Coastguard Worker// CHECK: popal
91*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x61]
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Worker    fwait
94*9880d681SAndroid Build Coastguard Worker// CHECK: wait
95*9880d681SAndroid Build Coastguard Worker// CHECK: # encoding: [0x9b]
96*9880d681SAndroid Build Coastguard Worker
97*9880d681SAndroid Build Coastguard Worker	ret
98