summaryrefslogtreecommitdiff
path: root/gas/testsuite/gas/i386/mpx.s
blob: 593ff496ef9078e20c2973d06c37443c45e715c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# MPX instructions
	.allow_index_reg
	.text
start:
	### bndmk
	bndmk (%eax), %bnd1
	bndmk (0x399), %bnd1
	bndmk 0x3(%edx), %bnd1
	bndmk (%eax,%ecx), %bnd1
	bndmk (,%ecx,1), %bnd1
	bndmk 0x3(%ecx,%eax,1), %bnd1

	### bndmov
	bndmov (%eax), %bnd1
	bndmov (0x399), %bnd1
	bndmov 0x3(%edx), %bnd2
	bndmov (%eax,%edx), %bnd2
	bndmov (,%eax,1), %bnd2
	bndmov 0x3(%ecx,%eax,1), %bnd1
	bndmov %bnd2, %bnd0

	bndmov %bnd1, (%eax)
	bndmov %bnd1, (0x399)
	bndmov %bnd2, 0x3(%edx)
	bndmov %bnd2, (%eax,%edx)
	bndmov %bnd2, (,%eax,1)
	bndmov %bnd1, 0x3(%ecx,%eax,1)
	bndmov %bnd0, %bnd2

	### bndcl
	bndcl (%ecx), %bnd1
	bndcl %ecx, %bnd1
	bndcl (0x399), %bnd1
	bndcl 0x3(%edx), %bnd1
	bndcl (%eax,%ecx), %bnd1
	bndcl (,%ecx,1), %bnd1
	bndcl 0x3(%ecx,%eax,1), %bnd1

	### bndcu
	bndcu (%ecx), %bnd1
	bndcu %ecx, %bnd1
	bndcu (0x399), %bnd1
	bndcu 0x3(%edx), %bnd1
	bndcu (%eax,%ecx), %bnd1
	bndcu (,%ecx,1), %bnd1
	bndcu 0x3(%ecx,%eax,1), %bnd1

	### bndcn
	bndcn (%ecx), %bnd1
	bndcn %ecx, %bnd1
	bndcn (0x399), %bnd1
	bndcn 0x3(%edx), %bnd1
	bndcn (%eax,%ecx), %bnd1
	bndcn (,%ecx,1), %bnd1
	bndcn 0x3(%ecx,%eax,1), %bnd1

	### bndstx
	bndstx %bnd0, 0x3(%eax,%ebx,1)
	bndstx %bnd2, 3(%ebx,%edx)
	bndstx %bnd2, 3(,%edx,1)
	bndstx %bnd3, 0x399(%edx)
	bndstx %bnd2, 0x1234(%ebx)
	bndstx %bnd2, 3(%ebx,1)
	bndstx %bnd1, (%edx)

	### bndldx
	bndldx 0x3(%eax,%ebx,1), %bnd0
	bndldx 3(%ebx,%edx), %bnd2
	bndldx 3(,%edx,1), %bnd2
	bndldx 0x399(%edx), %bnd3
	bndldx 0x1234(%ebx), %bnd2
	bndldx 3(%ebx,1), %bnd2
	bndldx (%edx), %bnd1

	### bnd
	bnd call	foo
	bnd call	*(%eax)
	bnd je	foo
	bnd jmp	foo
	bnd jmp	*(%ecx)
	bnd ret

.intel_syntax noprefix
	bndmk bnd1, [eax]
	bndmk bnd1, [0x399]
	bndmk bnd1, [ecx+0x3]
	bndmk bnd1, [eax+ecx]
	bndmk bnd1, [ecx*1]
	bndmk bnd1, [edx+1*eax+0x3]

	### bndmov
	bndmov bnd1, [eax]
	bndmov bnd1, [0x399]
	bndmov bnd1, [ecx+0x3]
	bndmov bnd1, [eax+ecx]
	bndmov bnd1, [ecx*1]
	bndmov bnd1, [edx+1*eax+0x3]
	bndmov bnd0, bnd1

	bndmov [eax], bnd1
	bndmov [0x399], bnd1
	bndmov [ecx+0x3], bnd1
	bndmov [eax+ecx], bnd1
	bndmov [ecx*1], bnd1
	bndmov [edx+1*eax+0x3], bnd1
	bndmov bnd1, bnd0

	### bndcl
	bndcl bnd1, [eax]
	bndcl bnd1, ecx
	bndcl bnd1, [0x399]
	bndcl bnd1, [ecx+0x3]
	bndcl bnd1, [eax+ecx]
	bndcl bnd1, [ecx*1]
	bndcl bnd1, [edx+1*eax+0x3]

	### bndcu
	bndcu bnd1, [eax]
	bndcu bnd1, ecx
	bndcu bnd1, [0x399]
	bndcu bnd1, [ecx+0x3]
	bndcu bnd1, [eax+ecx]
	bndcu bnd1, [ecx*1]
	bndcu bnd1, [edx+1*eax+0x3]

	### bndcn
	bndcn bnd1, [eax]
	bndcn bnd1, ecx
	bndcn bnd1, [0x399]
	bndcn bnd1, [ecx+0x3]
	bndcn bnd1, [eax+ecx]
	bndcn bnd1, [ecx*1]
	bndcn bnd1, [edx+1*eax+0x3]

	### bndstx
	bndstx [eax+ebx*1+0x3], bnd0
	bndstx [ebx+edx+3], bnd2
	bndstx [ecx*1], bnd2
	bndstx [edx+0x399], bnd3
	bndstx [1*ebx+3], bnd2
	bndstx [edx], bnd1

	### bndldx
	bndldx bnd0, [eax+ebx*1+0x3]
	bndldx bnd2, [ebx+edx+3]
	bndldx bnd2, [ecx*1]
	bndldx bnd3, [edx+0x399]
	bndldx bnd2, [1*ebx+3]
	bndldx bnd1, [edx]

	### bnd
	bnd call	foo
	bnd call	eax
	bnd je	foo
	bnd jmp	foo
	bnd jmp	ecx
	bnd ret

foo:	bnd ret

	.att_syntax prefix
bad:
	# bndldx (%eax),(bad)
	.insn 0x0f1a, (%eax), %esi

	# bndmov (bad),%bnd0
	.insn 0x660f1a, %k4, %bnd0