diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/common/dis/i386/dis_tables.c | 122 | ||||
-rw-r--r-- | usr/src/pkg/manifests/system-test-utiltest.mf | 4 | ||||
-rw-r--r-- | usr/src/test/util-tests/tests/dis/Makefile | 4 | ||||
-rw-r--r-- | usr/src/test/util-tests/tests/dis/i386/32.opmask.out | 73 | ||||
-rwxr-xr-x | usr/src/test/util-tests/tests/dis/i386/32.opmask.s | 112 | ||||
-rw-r--r-- | usr/src/test/util-tests/tests/dis/i386/64.opmask.out | 75 | ||||
-rwxr-xr-x | usr/src/test/util-tests/tests/dis/i386/64.opmask.s | 114 |
7 files changed, 488 insertions, 16 deletions
diff --git a/usr/src/common/dis/i386/dis_tables.c b/usr/src/common/dis/i386/dis_tables.c index 3c66777c3a..4204f8ab9e 100644 --- a/usr/src/common/dis/i386/dis_tables.c +++ b/usr/src/common/dis/i386/dis_tables.c @@ -21,7 +21,7 @@ */ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2016 Joyent, Inc. + * Copyright 2017 Joyent, Inc. */ /* @@ -85,6 +85,7 @@ typedef struct instable { uint_t it_stackop:1; /* push/pop stack operation */ uint_t it_vexwoxmm:1; /* VEX instructions that don't use XMM/YMM */ uint_t it_avxsuf:1; /* AVX suffix required */ + uint_t it_vexopmask:1; /* VEX inst. that use opmask */ } instable_t; /* @@ -226,6 +227,9 @@ enum { VEX_MR, /* VEX mod_rm -> mod_reg */ VEX_RRI, /* VEX mod_reg, mod_rm -> implicit(eflags/r32) */ VEX_RX, /* VEX mod_reg -> mod_rm */ + VEX_KRR, /* VEX mod_rm -> mod_reg */ + VEX_KMR, /* VEX mod_reg -> mod_rm */ + VEX_KRM, /* VEX mod_rm -> mod_reg */ VEX_RR, /* VEX mod_rm -> mod_reg */ VEX_RRi, /* VEX mod_rm, imm8 -> mod_reg */ VEX_RM, /* VEX mod_reg -> mod_rm */ @@ -284,6 +288,7 @@ enum { * "y" - means the operand size is always 64 bits in 64 bit mode * "p" - means push/pop stack operation * "vr" - means VEX instruction that operates on normal registers, not fpu + * "vo" - means VEX instruction that operates on opmask registers, not fpu */ #if defined(DIS_TEXT) && defined(DIS_MEM) @@ -297,6 +302,8 @@ enum { #define TNSZ(name, amode, sz) {TERM, amode, name, 0, sz, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, name, 0, sz, 0, 1, 0, 0} #define TNSZvr(name, amode, sz) {TERM, amode, name, 0, sz, 0, 0, 0, 0, 1} +#define TSavo(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0, 0, 1, 1} +#define TSvo(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, name, 1, 0, 0, 1, 0, 0} @@ -317,6 +324,7 @@ enum { #define TNSZ(name, amode, sz) {TERM, amode, name, 0, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, name, 0, 0, 1, 0, 0} #define TNSZvr(name, amode, sz) {TERM, amode, name, 0, 0, 0, 0, 0, 1} +#define TSvo(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, name, 1, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, name, 1, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, name, 1, 0, 1, 0, 0} @@ -337,6 +345,7 @@ enum { #define TNSZ(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, sz, 0, 1, 0, 0} #define TNSZvr(name, amode, sz) {TERM, amode, sz, 0, 0, 0, 0, 1} +#define TSvo(name, amode) {TERM, amode, 0, 0, 0, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, 0, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, 0, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, 0, 0, 1, 0, 0} @@ -357,6 +366,7 @@ enum { #define TNSZ(name, amode, sz) {TERM, amode, 0, 0, 0, 0} #define TNSZy(name, amode, sz) {TERM, amode, 0, 1, 0, 0} #define TNSZvr(name, amode, sz) {TERM, amode, 0, 0, 0, 0, 1} +#define TSvo(name, amode) {TERM, amode, 0, 0, 0, 0, 0, 0, 1} #define TS(name, amode) {TERM, amode, 0, 0, 0, 0} #define TSx(name, amode) {TERM, amode, 1, 0, 0, 0} #define TSy(name, amode) {TERM, amode, 0, 1, 0, 0} @@ -476,6 +486,10 @@ const char *const dis_YMMREG[16] = { "%ymm8", "%ymm9", "%ymm10", "%ymm11", "%ymm12", "%ymm13", "%ymm14", "%ymm15" }; +const char *const dis_KOPMASKREG[8] = { + "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7" +}; + const char *const dis_SEGREG[16] = { "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>", "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>" @@ -753,9 +767,9 @@ const instable_t dis_opAVX660F[256] = { /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, -/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ INVALID, TSvo("kand",VEX_RMX), TSvo("kandn",VEX_RMX), INVALID, +/* [44] */ TSvo("knot",VEX_MX), TSvo("kor",VEX_RMX), TSvo("kxnor",VEX_RMX), TSvo("kxor",VEX_RMX), +/* [48] */ INVALID, INVALID, TSvo("kadd",VEX_RMX), TSvo("kunpck",VEX_RMX), /* [4C] */ INVALID, INVALID, INVALID, INVALID, /* [50] */ TNS("vmovmskpd",VEX_MR), TNSZ("vsqrtpd",VEX_MX,16), INVALID, INVALID, @@ -778,9 +792,9 @@ const instable_t dis_opAVX660F[256] = { /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, -/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [90] */ TSvo("kmov",VEX_KRM), TSvo("kmov",VEX_KMR), TSvo("kmov",VEX_KRR), TSvo("kmov",VEX_MR), /* [94] */ INVALID, INVALID, INVALID, INVALID, -/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ TSvo("kortest",VEX_MX), TSvo("ktest",VEX_MX), INVALID, INVALID, /* [9C] */ INVALID, INVALID, INVALID, INVALID, /* [A0] */ INVALID, INVALID, INVALID, INVALID, @@ -945,7 +959,7 @@ const instable_t dis_opAVXF20F[256] = { /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [0C] */ INVALID, INVALID, INVALID, INVALID, -/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [90] */ INVALID, INVALID, TSvo("kmov",VEX_KRR), TSvo("kmov",VEX_MR), /* [94] */ INVALID, INVALID, INVALID, INVALID, /* [98] */ INVALID, INVALID, INVALID, INVALID, /* [9C] */ INVALID, INVALID, INVALID, INVALID, @@ -1675,7 +1689,7 @@ const instable_t dis_opAVX660F3A[256] = { /* [28] */ INVALID, INVALID, INVALID, INVALID, /* [2C] */ INVALID, INVALID, INVALID, INVALID, -/* [30] */ INVALID, INVALID, INVALID, INVALID, +/* [30] */ TSvo("kshiftr",VEX_MXI), TSvo("kshiftr",VEX_MXI), TSvo("kshiftl",VEX_MXI), TSvo("kshiftl",VEX_MXI), /* [34] */ INVALID, INVALID, INVALID, INVALID, /* [38] */ TNSZ("vinserti128",VEX_RMRX,16),TNSZ("vextracti128",VEX_RIM,16),INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, @@ -1859,9 +1873,9 @@ const instable_t dis_opAVX0F[16][16] = { /* [38] */ INVALID, INVALID, INVALID, INVALID, /* [3C] */ INVALID, INVALID, INVALID, INVALID, }, { -/* [40] */ INVALID, INVALID, INVALID, INVALID, -/* [44] */ INVALID, INVALID, INVALID, INVALID, -/* [48] */ INVALID, INVALID, INVALID, INVALID, +/* [40] */ INVALID, TSvo("kand",VEX_RMX), TSvo("kandn",VEX_RMX), INVALID, +/* [44] */ TSvo("knot",VEX_MX), TSvo("kor",VEX_RMX), TSvo("kxnor",VEX_RMX), TSvo("kxor",VEX_RMX), +/* [48] */ INVALID, INVALID, TSvo("kadd",VEX_RMX), TSvo("kunpck",VEX_RMX), /* [4C] */ INVALID, INVALID, INVALID, INVALID, }, { /* [50] */ TNS("vmovmskps",VEX_MR), TNSZ("vsqrtps",VEX_MX,16), TNSZ("vrsqrtps",VEX_MX,16),TNSZ("vrcpps",VEX_MX,16), @@ -1884,9 +1898,9 @@ const instable_t dis_opAVX0F[16][16] = { /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, }, { -/* [90] */ INVALID, INVALID, INVALID, INVALID, +/* [90] */ TSvo("kmov",VEX_KRM), TSvo("kmov",VEX_KMR), TSvo("kmov",VEX_KRR), TSvo("kmov",VEX_MR), /* [94] */ INVALID, INVALID, INVALID, INVALID, -/* [98] */ INVALID, INVALID, INVALID, INVALID, +/* [98] */ TSvo("kortest",VEX_MX), TSvo("ktest",VEX_MX), INVALID, INVALID, /* [9C] */ INVALID, INVALID, INVALID, INVALID, }, { /* [A0] */ INVALID, INVALID, INVALID, INVALID, @@ -2320,6 +2334,7 @@ static int isize64[] = {1, 2, 4, 8}; #define TEST_OPND 7 /* "value" used to indicate a test reg */ #define WORD_OPND 8 /* w-bit value indicating word size reg */ #define YMM_OPND 9 /* "value" used to indicate a ymm reg */ +#define KOPMASK_OPND 10 /* "value" used to indicate an opmask reg */ /* * The AVX2 gather instructions are a bit of a mess. While there's a pattern, @@ -2637,6 +2652,9 @@ dtrace_get_operand(dis86_t *x, uint_t mode, uint_t r_m, int wbit, int opindex) case YMM_OPND: (void) strlcat(opnd, dis_YMMREG[r_m], OPLEN); break; + case KOPMASK_OPND: + (void) strlcat(opnd, dis_KOPMASKREG[r_m], OPLEN); + break; case SEG_OPND: (void) strlcat(opnd, dis_SEGREG[r_m], OPLEN); break; @@ -3212,11 +3230,14 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (vex_prefix) { if (dp->it_vexwoxmm) { wbit = LONG_OPND; + } else if (dp->it_vexopmask) { + wbit = KOPMASK_OPND; } else { - if (vex_L) + if (vex_L) { wbit = YMM_OPND; - else + } else { wbit = XMM_OPND; + } } } @@ -3660,6 +3681,46 @@ dtrace_disx86(dis86_t *x, uint_t cpu_mode) if (dp->it_avxsuf && dp->it_suffix) { (void) strlcat(x->d86_mnem, vex_W != 0 ? "q" : "d", OPLEN); + } else if (dp->it_vexopmask && dp->it_suffix) { + /* opmask instructions */ + + if (opcode1 == 4 && opcode2 == 0xb) { + /* It's a kunpck. */ + if (vex_prefix == VEX_2bytes) { + (void) strlcat(x->d86_mnem, + vex_p == 0 ? "wd" : "bw", OPLEN); + } else { + /* vex_prefix == VEX_3bytes */ + (void) strlcat(x->d86_mnem, + "dq", OPLEN); + } + } else if (opcode1 == 3) { + /* It's a kshift[l|r]. */ + if (vex_W == 0) { + (void) strlcat(x->d86_mnem, + opcode2 == 2 || + opcode2 == 0 ? + "b" : "d", OPLEN); + } else { + /* W == 1 */ + (void) strlcat(x->d86_mnem, + opcode2 == 3 || opcode2 == 1 ? + "q" : "w", OPLEN); + } + } else { + /* if (vex_prefix == VEX_2bytes) { */ + if ((cpu_mode == SIZE64 && opnd_size == 2) || + vex_prefix == VEX_2bytes) { + (void) strlcat(x->d86_mnem, + vex_p == 0 ? "w" : + vex_p == 1 ? "b" : "d", + OPLEN); + } else { + /* vex_prefix == VEX_3bytes */ + (void) strlcat(x->d86_mnem, + vex_p == 1 ? "d" : "q", OPLEN); + } + } } else if (dp->it_suffix) { char *types[] = {"", "w", "l", "q"}; if (opcode_bytes == 2 && opcode4 == 4) { @@ -5108,6 +5169,37 @@ L_VEX_MX: break; + case VEX_KMR: + /* opmask: mod_rm := %k */ + x->d86_numopnds = 2; + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, r_m, LONG_OPND, 1); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 0); + break; + + case VEX_KRM: + /* opmask: mod_reg := mod_rm */ + x->d86_numopnds = 2; + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, REG_ONLY, reg, wbit, 1); + if (mode == REG_ONLY) { + dtrace_get_operand(x, mode, r_m, KOPMASK_OPND, 0); + } else { + dtrace_get_operand(x, mode, r_m, LONG_OPND, 0); + } + break; + + case VEX_KRR: + /* opmask: mod_reg := mod_rm */ + x->d86_numopnds = 2; + dtrace_get_modrm(x, &mode, ®, &r_m); + dtrace_vex_adjust(vex_byte1, mode, ®, &r_m); + dtrace_get_operand(x, mode, reg, wbit, 1); + dtrace_get_operand(x, REG_ONLY, r_m, LONG_OPND, 0); + break; + case VEX_RRI: /* implicit(eflags/r32) := op(ModR/M.reg, ModR/M.rm) */ x->d86_numopnds = 2; diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf index e3ca1b6692..eacc8a3f52 100644 --- a/usr/src/pkg/manifests/system-test-utiltest.mf +++ b/usr/src/pkg/manifests/system-test-utiltest.mf @@ -60,6 +60,8 @@ file path=opt/util-tests/tests/dis/i386/32.lzcnt.out mode=0555 file path=opt/util-tests/tests/dis/i386/32.lzcnt.s mode=0555 file path=opt/util-tests/tests/dis/i386/32.movbe.out mode=0555 file path=opt/util-tests/tests/dis/i386/32.movbe.s mode=0555 +file path=opt/util-tests/tests/dis/i386/32.opmask.out mode=0555 +file path=opt/util-tests/tests/dis/i386/32.opmask.s mode=0555 file path=opt/util-tests/tests/dis/i386/32.pclmulqdq.out mode=0555 file path=opt/util-tests/tests/dis/i386/32.pclmulqdq.s mode=0555 file path=opt/util-tests/tests/dis/i386/32.popcnt.out mode=0555 @@ -104,6 +106,8 @@ file path=opt/util-tests/tests/dis/i386/64.lzcnt.out mode=0555 file path=opt/util-tests/tests/dis/i386/64.lzcnt.s mode=0555 file path=opt/util-tests/tests/dis/i386/64.movbe.out mode=0555 file path=opt/util-tests/tests/dis/i386/64.movbe.s mode=0555 +file path=opt/util-tests/tests/dis/i386/64.opmask.out mode=0555 +file path=opt/util-tests/tests/dis/i386/64.opmask.s mode=0555 file path=opt/util-tests/tests/dis/i386/64.pclmulqdq.out mode=0555 file path=opt/util-tests/tests/dis/i386/64.pclmulqdq.s mode=0555 file path=opt/util-tests/tests/dis/i386/64.popcnt.out mode=0555 diff --git a/usr/src/test/util-tests/tests/dis/Makefile b/usr/src/test/util-tests/tests/dis/Makefile index 42dd1f73a5..ccc5dfcb3f 100644 --- a/usr/src/test/util-tests/tests/dis/Makefile +++ b/usr/src/test/util-tests/tests/dis/Makefile @@ -10,7 +10,7 @@ # # -# Copyright 2016 Joyent, Inc. +# Copyright 2017 Joyent, Inc. # include $(SRC)/Makefile.master @@ -38,6 +38,7 @@ I386_TESTS = \ 32.fma-ss \ 32.lzcnt \ 32.movbe \ + 32.opmask \ 32.pclmulqdq \ 32.popcnt \ 32.sha \ @@ -60,6 +61,7 @@ I386_TESTS = \ 64.fma-ss \ 64.lzcnt \ 64.movbe \ + 64.opmask \ 64.pclmulqdq \ 64.popcnt \ 64.random \ diff --git a/usr/src/test/util-tests/tests/dis/i386/32.opmask.out b/usr/src/test/util-tests/tests/dis/i386/32.opmask.out new file mode 100644 index 0000000000..a9958a6b2e --- /dev/null +++ b/usr/src/test/util-tests/tests/dis/i386/32.opmask.out @@ -0,0 +1,73 @@ + libdis_test: c5 f4 4a d0 kaddw %k0,%k1,%k2 + libdis_test+0x4: c5 dd 4a eb kaddb %k3,%k4,%k5 + libdis_test+0x8: c4 e1 c5 4a c6 kaddd %k6,%k7,%k0 + libdis_test+0xd: c4 e1 ec 4a d9 kaddq %k1,%k2,%k3 + libdis_test+0x12: c5 f4 41 d0 kandw %k0,%k1,%k2 + libdis_test+0x16: c5 dd 41 eb kandb %k3,%k4,%k5 + libdis_test+0x1a: c4 e1 c5 41 c6 kandd %k6,%k7,%k0 + libdis_test+0x1f: c4 e1 ec 41 d9 kandq %k1,%k2,%k3 + libdis_test+0x24: c5 f4 42 d0 kandnw %k0,%k1,%k2 + libdis_test+0x28: c5 dd 42 eb kandnb %k3,%k4,%k5 + libdis_test+0x2c: c4 e1 c5 42 c6 kandnd %k6,%k7,%k0 + libdis_test+0x31: c4 e1 ec 42 d9 kandnq %k1,%k2,%k3 + libdis_test+0x36: c5 f4 45 d0 korw %k0,%k1,%k2 + libdis_test+0x3a: c5 dd 45 eb korb %k3,%k4,%k5 + libdis_test+0x3e: c4 e1 c5 45 c6 kord %k6,%k7,%k0 + libdis_test+0x43: c4 e1 ec 45 d9 korq %k1,%k2,%k3 + libdis_test+0x48: c5 f4 46 d0 kxnorw %k0,%k1,%k2 + libdis_test+0x4c: c5 dd 46 eb kxnorb %k3,%k4,%k5 + libdis_test+0x50: c4 e1 c5 46 c6 kxnord %k6,%k7,%k0 + libdis_test+0x55: c4 e1 ec 46 d9 kxnorq %k1,%k2,%k3 + libdis_test+0x5a: c5 f4 47 d0 kxorw %k0,%k1,%k2 + libdis_test+0x5e: c5 dd 47 eb kxorb %k3,%k4,%k5 + libdis_test+0x62: c4 e1 c5 47 c6 kxord %k6,%k7,%k0 + libdis_test+0x67: c4 e1 ec 47 d9 kxorq %k1,%k2,%k3 + libdis_test+0x6c: c5 f5 4b d0 kunpckbw %k0,%k1,%k2 + libdis_test+0x70: c5 dc 4b eb kunpckwd %k3,%k4,%k5 + libdis_test+0x74: c4 e1 c4 4b c6 kunpckdq %k6,%k7,%k0 + libdis_test+0x79: c5 f8 44 c8 knotw %k0,%k1 + libdis_test+0x7d: c5 f9 44 da knotb %k2,%k3 + libdis_test+0x81: c4 e1 f9 44 ec knotd %k4,%k5 + libdis_test+0x86: c4 e1 f8 44 fe knotq %k6,%k7 + libdis_test+0x8b: c5 f8 98 c8 kortestw %k0,%k1 + libdis_test+0x8f: c5 f9 98 da kortestb %k2,%k3 + libdis_test+0x93: c4 e1 f9 98 ec kortestd %k4,%k5 + libdis_test+0x98: c4 e1 f8 98 fe kortestq %k6,%k7 + libdis_test+0x9d: c5 f8 99 c8 ktestw %k0,%k1 + libdis_test+0xa1: c5 f9 99 da ktestb %k2,%k3 + libdis_test+0xa5: c4 e1 f9 99 ec ktestd %k4,%k5 + libdis_test+0xaa: c4 e1 f8 99 fe ktestq %k6,%k7 + libdis_test+0xaf: c4 e3 f9 32 c8 01 kshiftlw $0x1,%k0,%k1 + libdis_test+0xb5: c4 e3 79 32 da 01 kshiftlb $0x1,%k2,%k3 + libdis_test+0xbb: c4 e3 79 33 ec 01 kshiftld $0x1,%k4,%k5 + libdis_test+0xc1: c4 e3 f9 33 fe 01 kshiftlq $0x1,%k6,%k7 + libdis_test+0xc7: c4 e3 f9 30 c8 01 kshiftrw $0x1,%k0,%k1 + libdis_test+0xcd: c4 e3 79 30 da 01 kshiftrb $0x1,%k2,%k3 + libdis_test+0xd3: c4 e3 79 31 ec 01 kshiftrd $0x1,%k4,%k5 + libdis_test+0xd9: c4 e3 f9 31 fe 01 kshiftrq $0x1,%k6,%k7 + libdis_test+0xdf: c5 f8 92 f8 kmovw %eax,%k7 + libdis_test+0xe3: c5 f9 92 eb kmovb %ebx,%k5 + libdis_test+0xe7: c5 fb 92 d9 kmovd %ecx,%k3 + libdis_test+0xeb: c5 f8 93 d0 kmovw %k0,%edx + libdis_test+0xef: c5 f9 93 ca kmovb %k2,%ecx + libdis_test+0xf3: c5 fb 93 dc kmovd %k4,%ebx + libdis_test+0xf7: c5 f8 91 02 kmovw %k0,(%edx) + libdis_test+0xfb: c5 f9 91 11 kmovb %k2,(%ecx) + libdis_test+0xff: c4 e1 f9 91 23 kmovd %k4,(%ebx) + libdis_test+0x104: c4 e1 f8 91 30 kmovq %k6,(%eax) + libdis_test+0x109: c5 f8 90 f2 kmovw %k2,%k6 + libdis_test+0x10d: c5 f9 90 fb kmovb %k3,%k7 + libdis_test+0x111: c4 e1 f9 90 c4 kmovd %k4,%k0 + libdis_test+0x116: c4 e1 f8 90 cd kmovq %k5,%k1 + libdis_test+0x11b: c5 f8 90 38 kmovw (%eax),%k7 + libdis_test+0x11f: c5 f9 90 33 kmovb (%ebx),%k6 + libdis_test+0x123: c4 e1 f9 90 29 kmovd (%ecx),%k5 + libdis_test+0x128: c4 e1 f8 90 22 kmovq (%edx),%k4 + libdis_test+0x12d: c5 f8 91 bc 24 00 kmovw %k7,0x400(%esp) + 04 00 00 + libdis_test+0x136: c5 f8 90 94 24 00 kmovw 0x400(%esp),%k2 + 04 00 00 + libdis_test+0x13f: c5 f8 90 ac d8 23 kmovw 0x123(%eax,%ebx,8),%k5 + 01 00 00 + libdis_test+0x148: c5 f8 91 ac d8 23 kmovw %k5,0x123(%eax,%ebx,8) + 01 00 00 diff --git a/usr/src/test/util-tests/tests/dis/i386/32.opmask.s b/usr/src/test/util-tests/tests/dis/i386/32.opmask.s new file mode 100755 index 0000000000..9b13b31300 --- /dev/null +++ b/usr/src/test/util-tests/tests/dis/i386/32.opmask.s @@ -0,0 +1,112 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2017 Joyent, Inc. + */ + +/* + * Test opmask instructions + */ + +.text +.align 16 +.globl libdis_test +.type libdis_test, @function +libdis_test: + kaddw %k0, %k1, %k2 + kaddb %k3, %k4, %k5 + kaddd %k6, %k7, %k0 + kaddq %k1, %k2, %k3 + + kandw %k0, %k1, %k2 + kandb %k3, %k4, %k5 + kandd %k6, %k7, %k0 + kandq %k1, %k2, %k3 + + kandnw %k0, %k1, %k2 + kandnb %k3, %k4, %k5 + kandnd %k6, %k7, %k0 + kandnq %k1, %k2, %k3 + + korw %k0, %k1, %k2 + korb %k3, %k4, %k5 + kord %k6, %k7, %k0 + korq %k1, %k2, %k3 + + kxnorw %k0, %k1, %k2 + kxnorb %k3, %k4, %k5 + kxnord %k6, %k7, %k0 + kxnorq %k1, %k2, %k3 + + kxorw %k0, %k1, %k2 + kxorb %k3, %k4, %k5 + kxord %k6, %k7, %k0 + kxorq %k1, %k2, %k3 + + kunpckbw %k0, %k1, %k2 + kunpckwd %k3, %k4, %k5 + kunpckdq %k6, %k7, %k0 + + knotw %k0, %k1 + knotb %k2, %k3 + knotd %k4, %k5 + knotq %k6, %k7 + + kortestw %k0, %k1 + kortestb %k2, %k3 + kortestd %k4, %k5 + kortestq %k6, %k7 + + ktestw %k0, %k1 + ktestb %k2, %k3 + ktestd %k4, %k5 + ktestq %k6, %k7 + + kshiftlw $1, %k0, %k1 + kshiftlb $1, %k2, %k3 + kshiftld $1, %k4, %k5 + kshiftlq $1, %k6, %k7 + + kshiftrw $1, %k0, %k1 + kshiftrb $1, %k2, %k3 + kshiftrd $1, %k4, %k5 + kshiftrq $1, %k6, %k7 + + kmovw %eax, %k7 + kmovb %ebx, %k5 + kmovd %ecx, %k3 + + kmovw %k0, %edx + kmovb %k2, %ecx + kmovd %k4, %ebx + + kmovw %k0, (%edx) + kmovb %k2, (%ecx) + kmovd %k4, (%ebx) + kmovq %k6, (%eax) + + kmovw %k2, %k6 + kmovb %k3, %k7 + kmovd %k4, %k0 + kmovq %k5, %k1 + + kmovw (%eax), %k7 + kmovb (%ebx), %k6 + kmovd (%ecx), %k5 + kmovq (%edx), %k4 + + kmovw %k7, 0x400(%esp) + kmovw 0x400(%esp), %k2 + kmovw 0x123(%eax, %ebx, 8), %k5 + kmovw %k5, 0x123(%eax, %ebx, 8) + +.size libdis_test, [.-libdis_test] diff --git a/usr/src/test/util-tests/tests/dis/i386/64.opmask.out b/usr/src/test/util-tests/tests/dis/i386/64.opmask.out new file mode 100644 index 0000000000..8524a55df9 --- /dev/null +++ b/usr/src/test/util-tests/tests/dis/i386/64.opmask.out @@ -0,0 +1,75 @@ + libdis_test: c5 f4 4a d0 kaddw %k0,%k1,%k2 + libdis_test+0x4: c5 dd 4a eb kaddb %k3,%k4,%k5 + libdis_test+0x8: c4 e1 c5 4a c6 kaddd %k6,%k7,%k0 + libdis_test+0xd: c4 e1 ec 4a d9 kaddq %k1,%k2,%k3 + libdis_test+0x12: c5 f4 41 d0 kandw %k0,%k1,%k2 + libdis_test+0x16: c5 dd 41 eb kandb %k3,%k4,%k5 + libdis_test+0x1a: c4 e1 c5 41 c6 kandd %k6,%k7,%k0 + libdis_test+0x1f: c4 e1 ec 41 d9 kandq %k1,%k2,%k3 + libdis_test+0x24: c5 f4 42 d0 kandnw %k0,%k1,%k2 + libdis_test+0x28: c5 dd 42 eb kandnb %k3,%k4,%k5 + libdis_test+0x2c: c4 e1 c5 42 c6 kandnd %k6,%k7,%k0 + libdis_test+0x31: c4 e1 ec 42 d9 kandnq %k1,%k2,%k3 + libdis_test+0x36: c5 f4 45 d0 korw %k0,%k1,%k2 + libdis_test+0x3a: c5 dd 45 eb korb %k3,%k4,%k5 + libdis_test+0x3e: c4 e1 c5 45 c6 kord %k6,%k7,%k0 + libdis_test+0x43: c4 e1 ec 45 d9 korq %k1,%k2,%k3 + libdis_test+0x48: c5 f4 46 d0 kxnorw %k0,%k1,%k2 + libdis_test+0x4c: c5 dd 46 eb kxnorb %k3,%k4,%k5 + libdis_test+0x50: c4 e1 c5 46 c6 kxnord %k6,%k7,%k0 + libdis_test+0x55: c4 e1 ec 46 d9 kxnorq %k1,%k2,%k3 + libdis_test+0x5a: c5 f4 47 d0 kxorw %k0,%k1,%k2 + libdis_test+0x5e: c5 dd 47 eb kxorb %k3,%k4,%k5 + libdis_test+0x62: c4 e1 c5 47 c6 kxord %k6,%k7,%k0 + libdis_test+0x67: c4 e1 ec 47 d9 kxorq %k1,%k2,%k3 + libdis_test+0x6c: c5 f5 4b d0 kunpckbw %k0,%k1,%k2 + libdis_test+0x70: c5 dc 4b eb kunpckwd %k3,%k4,%k5 + libdis_test+0x74: c4 e1 c4 4b c6 kunpckdq %k6,%k7,%k0 + libdis_test+0x79: c5 f8 44 c8 knotw %k0,%k1 + libdis_test+0x7d: c5 f9 44 da knotb %k2,%k3 + libdis_test+0x81: c4 e1 f9 44 ec knotd %k4,%k5 + libdis_test+0x86: c4 e1 f8 44 fe knotq %k6,%k7 + libdis_test+0x8b: c5 f8 98 c8 kortestw %k0,%k1 + libdis_test+0x8f: c5 f9 98 da kortestb %k2,%k3 + libdis_test+0x93: c4 e1 f9 98 ec kortestd %k4,%k5 + libdis_test+0x98: c4 e1 f8 98 fe kortestq %k6,%k7 + libdis_test+0x9d: c5 f8 99 c8 ktestw %k0,%k1 + libdis_test+0xa1: c5 f9 99 da ktestb %k2,%k3 + libdis_test+0xa5: c4 e1 f9 99 ec ktestd %k4,%k5 + libdis_test+0xaa: c4 e1 f8 99 fe ktestq %k6,%k7 + libdis_test+0xaf: c4 e3 f9 32 c8 01 kshiftlw $0x1,%k0,%k1 + libdis_test+0xb5: c4 e3 79 32 da 01 kshiftlb $0x1,%k2,%k3 + libdis_test+0xbb: c4 e3 79 33 ec 01 kshiftld $0x1,%k4,%k5 + libdis_test+0xc1: c4 e3 f9 33 fe 01 kshiftlq $0x1,%k6,%k7 + libdis_test+0xc7: c4 e3 f9 30 c8 01 kshiftrw $0x1,%k0,%k1 + libdis_test+0xcd: c4 e3 79 30 da 01 kshiftrb $0x1,%k2,%k3 + libdis_test+0xd3: c4 e3 79 31 ec 01 kshiftrd $0x1,%k4,%k5 + libdis_test+0xd9: c4 e3 f9 31 fe 01 kshiftrq $0x1,%k6,%k7 + libdis_test+0xdf: c5 f8 92 f8 kmovw %eax,%k7 + libdis_test+0xe3: c5 f9 92 eb kmovb %ebx,%k5 + libdis_test+0xe7: c5 fb 92 d9 kmovd %ecx,%k3 + libdis_test+0xeb: c4 e1 fb 92 ca kmovq %rdx,%k1 + libdis_test+0xf0: c5 f8 93 d0 kmovw %k0,%edx + libdis_test+0xf4: c5 f9 93 ca kmovb %k2,%ecx + libdis_test+0xf8: c5 fb 93 dc kmovd %k4,%ebx + libdis_test+0xfc: c4 e1 fb 93 c6 kmovq %k6,%rax + libdis_test+0x101: c5 f8 91 02 kmovw %k0,(%rdx) + libdis_test+0x105: c5 f9 91 11 kmovb %k2,(%rcx) + libdis_test+0x109: c4 e1 f9 91 23 kmovd %k4,(%rbx) + libdis_test+0x10e: c4 e1 f8 91 30 kmovq %k6,(%rax) + libdis_test+0x113: c5 f8 90 f2 kmovw %k2,%k6 + libdis_test+0x117: c5 f9 90 fb kmovb %k3,%k7 + libdis_test+0x11b: c4 e1 f9 90 c4 kmovd %k4,%k0 + libdis_test+0x120: c4 e1 f8 90 cd kmovq %k5,%k1 + libdis_test+0x125: c5 f8 90 38 kmovw (%rax),%k7 + libdis_test+0x129: c5 f9 90 33 kmovb (%rbx),%k6 + libdis_test+0x12d: c4 e1 f9 90 29 kmovd (%rcx),%k5 + libdis_test+0x132: c4 e1 f8 90 22 kmovq (%rdx),%k4 + libdis_test+0x137: c5 f8 91 bc 24 00 kmovw %k7,0x400(%rsp) + 04 00 00 + libdis_test+0x140: c5 f8 90 94 24 00 kmovw 0x400(%rsp),%k2 + 04 00 00 + libdis_test+0x149: c4 a1 78 90 ac f0 kmovw 0x123(%rax,%r14,8),%k5 + 23 01 00 00 + libdis_test+0x153: c4 a1 78 91 ac f0 kmovw %k5,0x123(%rax,%r14,8) + 23 01 00 00 diff --git a/usr/src/test/util-tests/tests/dis/i386/64.opmask.s b/usr/src/test/util-tests/tests/dis/i386/64.opmask.s new file mode 100755 index 0000000000..d3966ec58a --- /dev/null +++ b/usr/src/test/util-tests/tests/dis/i386/64.opmask.s @@ -0,0 +1,114 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2017 Joyent, Inc. + */ + +/* + * Test opmask instructions + */ + +.text +.align 16 +.globl libdis_test +.type libdis_test, @function +libdis_test: + kaddw %k0, %k1, %k2 + kaddb %k3, %k4, %k5 + kaddd %k6, %k7, %k0 + kaddq %k1, %k2, %k3 + + kandw %k0, %k1, %k2 + kandb %k3, %k4, %k5 + kandd %k6, %k7, %k0 + kandq %k1, %k2, %k3 + + kandnw %k0, %k1, %k2 + kandnb %k3, %k4, %k5 + kandnd %k6, %k7, %k0 + kandnq %k1, %k2, %k3 + + korw %k0, %k1, %k2 + korb %k3, %k4, %k5 + kord %k6, %k7, %k0 + korq %k1, %k2, %k3 + + kxnorw %k0, %k1, %k2 + kxnorb %k3, %k4, %k5 + kxnord %k6, %k7, %k0 + kxnorq %k1, %k2, %k3 + + kxorw %k0, %k1, %k2 + kxorb %k3, %k4, %k5 + kxord %k6, %k7, %k0 + kxorq %k1, %k2, %k3 + + kunpckbw %k0, %k1, %k2 + kunpckwd %k3, %k4, %k5 + kunpckdq %k6, %k7, %k0 + + knotw %k0, %k1 + knotb %k2, %k3 + knotd %k4, %k5 + knotq %k6, %k7 + + kortestw %k0, %k1 + kortestb %k2, %k3 + kortestd %k4, %k5 + kortestq %k6, %k7 + + ktestw %k0, %k1 + ktestb %k2, %k3 + ktestd %k4, %k5 + ktestq %k6, %k7 + + kshiftlw $1, %k0, %k1 + kshiftlb $1, %k2, %k3 + kshiftld $1, %k4, %k5 + kshiftlq $1, %k6, %k7 + + kshiftrw $1, %k0, %k1 + kshiftrb $1, %k2, %k3 + kshiftrd $1, %k4, %k5 + kshiftrq $1, %k6, %k7 + + kmovw %eax, %k7 + kmovb %ebx, %k5 + kmovd %ecx, %k3 + kmovq %rdx, %k1 + + kmovw %k0, %edx + kmovb %k2, %ecx + kmovd %k4, %ebx + kmovq %k6, %rax + + kmovw %k0, (%rdx) + kmovb %k2, (%rcx) + kmovd %k4, (%rbx) + kmovq %k6, (%rax) + + kmovw %k2, %k6 + kmovb %k3, %k7 + kmovd %k4, %k0 + kmovq %k5, %k1 + + kmovw (%rax), %k7 + kmovb (%rbx), %k6 + kmovd (%rcx), %k5 + kmovq (%rdx), %k4 + + kmovw %k7, 0x400(%rsp) + kmovw 0x400(%rsp), %k2 + kmovw 0x123(%rax, %r14, 8), %k5 + kmovw %k5, 0x123(%rax, %r14, 8) + +.size libdis_test, [.-libdis_test] |