xref: /illumos-gate/usr/src/test/util-tests/tests/dis/i386/32.opmask.s (revision dfc115332c94a2f62058ac7f2bce7631fbd20b3d)
1/*
2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
5 * 1.0 of the CDDL.
6 *
7 * A full copy of the text of the CDDL should have accompanied this
8 * source.  A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
10 */
11
12/*
13 * Copyright 2017 Joyent, Inc.
14 */
15
16/*
17 * Test opmask instructions
18 */
19
20.text
21.align 16
22.globl libdis_test
23.type libdis_test, @function
24libdis_test:
25	kaddw		%k0, %k1, %k2
26	kaddb		%k3, %k4, %k5
27	kaddd		%k6, %k7, %k0
28	kaddq		%k1, %k2, %k3
29
30	kandw		%k0, %k1, %k2
31	kandb		%k3, %k4, %k5
32	kandd		%k6, %k7, %k0
33	kandq		%k1, %k2, %k3
34
35	kandnw		%k0, %k1, %k2
36	kandnb		%k3, %k4, %k5
37	kandnd		%k6, %k7, %k0
38	kandnq		%k1, %k2, %k3
39
40	korw		%k0, %k1, %k2
41	korb		%k3, %k4, %k5
42	kord		%k6, %k7, %k0
43	korq		%k1, %k2, %k3
44
45	kxnorw		%k0, %k1, %k2
46	kxnorb		%k3, %k4, %k5
47	kxnord		%k6, %k7, %k0
48	kxnorq		%k1, %k2, %k3
49
50	kxorw		%k0, %k1, %k2
51	kxorb		%k3, %k4, %k5
52	kxord		%k6, %k7, %k0
53	kxorq		%k1, %k2, %k3
54
55	kunpckbw	%k0, %k1, %k2
56	kunpckwd	%k3, %k4, %k5
57	kunpckdq	%k6, %k7, %k0
58
59	knotw		%k0, %k1
60	knotb		%k2, %k3
61	knotd		%k4, %k5
62	knotq		%k6, %k7
63
64	kortestw	%k0, %k1
65	kortestb	%k2, %k3
66	kortestd	%k4, %k5
67	kortestq	%k6, %k7
68
69	ktestw		%k0, %k1
70	ktestb		%k2, %k3
71	ktestd		%k4, %k5
72	ktestq		%k6, %k7
73
74	kshiftlw	$1, %k0, %k1
75	kshiftlb	$1, %k2, %k3
76	kshiftld	$1, %k4, %k5
77	kshiftlq	$1, %k6, %k7
78
79	kshiftrw	$1, %k0, %k1
80	kshiftrb	$1, %k2, %k3
81	kshiftrd	$1, %k4, %k5
82	kshiftrq	$1, %k6, %k7
83
84	kmovw		%eax, %k7
85	kmovb		%ebx, %k5
86	kmovd		%ecx, %k3
87
88	kmovw		%k0, %edx
89	kmovb		%k2, %ecx
90	kmovd		%k4, %ebx
91
92	kmovw		%k0, (%edx)
93	kmovb		%k2, (%ecx)
94	kmovd		%k4, (%ebx)
95	kmovq		%k6, (%eax)
96
97	kmovw		%k2, %k6
98	kmovb		%k3, %k7
99	kmovd		%k4, %k0
100	kmovq		%k5, %k1
101
102	kmovw		(%eax), %k7
103	kmovb		(%ebx), %k6
104	kmovd		(%ecx), %k5
105	kmovq		(%edx), %k4
106
107	kmovw		%k7, 0x400(%esp)
108	kmovw		0x400(%esp), %k2
109	kmovw		0x123(%eax, %ebx, 8), %k5
110	kmovw		%k5, 0x123(%eax, %ebx, 8)
111
112.size libdis_test, [.-libdis_test]
113