Index: llvm/trunk/lib/Target/X86/X86InstrAVX512.td =================================================================== --- llvm/trunk/lib/Target/X86/X86InstrAVX512.td +++ llvm/trunk/lib/Target/X86/X86InstrAVX512.td @@ -7199,6 +7199,11 @@ (X86pextrw (_.VT _.RC:$src1), imm:$src2))]>, EVEX, PD; + def rr_REV : AVX512Ii8<0x15, MRMDestReg, (outs GR32orGR64:$dst), + (ins _.RC:$src1, u8imm:$src2), + OpcodeStr#".s\t{$src2, $src1, $dst|$dst, $src1, $src2}", []>, + EVEX, TAPD; + defm NAME : avx512_extract_elt_bw_m<0x15, OpcodeStr, X86pextrw, _>, TAPD; } } Index: llvm/trunk/test/MC/X86/x86-64-avx512bw.s =================================================================== --- llvm/trunk/test/MC/X86/x86-64-avx512bw.s +++ llvm/trunk/test/MC/X86/x86-64-avx512bw.s @@ -4691,3 +4691,51 @@ // CHECK: encoding: [0x62,0x62,0x7d,0xc9,0x7b,0xc0] vpbroadcastw %eax, %zmm24 {%k1} {z} +// CHECK: vpextrw.s $171, %xmm28, %eax +// CHECK: encoding: [0x62,0x63,0x7d,0x08,0x15,0xe0,0xab] + vpextrw.s $0xab, %xmm28, %eax + +// CHECK: vpextrw.s $123, %xmm28, %eax +// CHECK: encoding: [0x62,0x63,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm28, %eax + +// CHECK: vpextrw.s $123, %xmm28, %r8d +// CHECK: encoding: [0x62,0x43,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm28, %r8d + +// CHECK: vpextrw.s $171, %xmm28, %eax +// CHECK: encoding: [0x62,0x63,0x7d,0x08,0x15,0xe0,0xab] + vpextrw.s $0xab, %xmm28, %eax + +// CHECK: vpextrw.s $123, %xmm28, %eax +// CHECK: encoding: [0x62,0x63,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm28, %eax + +// CHECK: vpextrw.s $123, %xmm28, %r8d +// CHECK: encoding: [0x62,0x43,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm28, %r8d + +// CHECK: vpextrw.s $171, %xmm20, %eax +// CHECK: encoding: [0x62,0xe3,0x7d,0x08,0x15,0xe0,0xab] + vpextrw.s $0xab, %xmm20, %eax + +// CHECK: vpextrw.s $123, %xmm20, %eax +// CHECK: encoding: [0x62,0xe3,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm20, %eax + +// CHECK: vpextrw.s $123, %xmm20, %r8d +// CHECK: encoding: [0x62,0xc3,0x7d,0x08,0x15,0xe0,0x7b] + vpextrw.s $0x7b, %xmm20, %r8d + +// CHECK: vpextrw.s $171, %xmm19, %eax +// CHECK: encoding: [0x62,0xe3,0x7d,0x08,0x15,0xd8,0xab] + vpextrw.s $0xab, %xmm19, %eax + +// CHECK: vpextrw.s $123, %xmm19, %eax +// CHECK: encoding: [0x62,0xe3,0x7d,0x08,0x15,0xd8,0x7b] + vpextrw.s $0x7b, %xmm19, %eax + +// CHECK: vpextrw.s $123, %xmm19, %r8d +// CHECK: encoding: [0x62,0xc3,0x7d,0x08,0x15,0xd8,0x7b] + vpextrw.s $0x7b, %xmm19, %r8d +