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	kmovq		%rdx, %k1
88
89	kmovw		%k0, %edx
90	kmovb		%k2, %ecx
91	kmovd		%k4, %ebx
92	kmovq		%k6, %rax
93
94	kmovw		%k0, (%rdx)
95	kmovb		%k2, (%rcx)
96	kmovd		%k4, (%rbx)
97	kmovq		%k6, (%rax)
98
99	kmovw		%k2, %k6
100	kmovb		%k3, %k7
101	kmovd		%k4, %k0
102	kmovq		%k5, %k1
103
104	kmovw		(%rax), %k7
105	kmovb		(%rbx), %k6
106	kmovd		(%rcx), %k5
107	kmovq		(%rdx), %k4
108
109	kmovw		%k7, 0x400(%rsp)
110	kmovw		0x400(%rsp), %k2
111	kmovw		0x123(%rax, %r14, 8), %k5
112	kmovw		%k5, 0x123(%rax, %r14, 8)
113
114.size libdis_test, [.-libdis_test]
115