From 1dd518da7d25c04cd5330192269f32d59228d272 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 18 Mar 2019 22:06:19 +0000 Subject: [PATCH] [X86] Add coverage for 16-bit and 64-bit versions of bsf/bsr/bt/btc/btr/bts in the assembly tests that are supposed to provide full coverage. Add coverage for cwtl/cltq/cwtd/cqto as well. llvm-svn: 356420 --- llvm/test/MC/X86/I386-32.s | 84 ++++++++++++++++++++---- llvm/test/MC/X86/I386-64.s | 155 +++++++++++++++++++++++++++++++++++++++++---- llvm/test/MC/X86/I86-32.s | 8 +++ llvm/test/MC/X86/I86-64.s | 16 +++++ 4 files changed, 240 insertions(+), 23 deletions(-) diff --git a/llvm/test/MC/X86/I386-32.s b/llvm/test/MC/X86/I386-32.s index aacb68e..d4c73d7 100644 --- a/llvm/test/MC/X86/I386-32.s +++ b/llvm/test/MC/X86/I386-32.s @@ -1,5 +1,13 @@ // RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck %s +// CHECK: bsfw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xbc,0xc0] +bsfw %ax, %ax + +// CHECK: bsrw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xbd,0xc0] +bsrw %ax, %ax + // CHECK: bsfl %eax, %eax // CHECK: encoding: [0x0f,0xbc,0xc0] bsfl %eax, %eax @@ -8,6 +16,70 @@ bsfl %eax, %eax // CHECK: encoding: [0x0f,0xbd,0xc0] bsrl %eax, %eax +// CHECK: btcw $0, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf8,0x00] +btcw $0, %ax + +// CHECK: btcw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf8,0xff] +btcw $-1, %ax + +// CHECK: btcw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf8,0xff] +btcw $255, %ax + +// CHECK: btcw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xbb,0xc0] +btcw %ax, %ax + +// CHECK: btw $0, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe0,0x00] +btw $0, %ax + +// CHECK: btw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe0,0xff] +btw $-1, %ax + +// CHECK: btw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe0,0xff] +btw $255, %ax + +// CHECK: btw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xa3,0xc0] +btw %ax, %ax + +// CHECK: btrw $0, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf0,0x00] +btrw $0, %ax + +// CHECK: btrw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf0,0xff] +btrw $-1, %ax + +// CHECK: btrw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xf0,0xff] +btrw $255, %ax + +// CHECK: btrw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xb3,0xc0] +btrw %ax, %ax + +// CHECK: btsw $0, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe8,0x00] +btsw $0, %ax + +// CHECK: btsw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe8,0xff] +btsw $-1, %ax + +// CHECK: btsw $255, %ax +// CHECK: encoding: [0x66,0x0f,0xba,0xe8,0xff] +btsw $255, %ax + +// CHECK: btsw %ax, %ax +// CHECK: encoding: [0x66,0x0f,0xab,0xc0] +btsw %ax, %ax + // CHECK: btcl $0, %eax // CHECK: encoding: [0x0f,0xba,0xf8,0x00] btcl $0, %eax @@ -72,10 +144,6 @@ btsl $255, %eax // CHECK: encoding: [0x0f,0xab,0xc0] btsl %eax, %eax -// CHECK: cltd -// CHECK: encoding: [0x99] -cltd - // CHECK: cmpsb %es:(%edi), %es:(%esi) // CHECK: encoding: [0x26,0xa6] cmpsb %es:(%edi), %es:(%esi) @@ -88,14 +156,6 @@ cmpsl %es:(%edi), %es:(%esi) // CHECK: encoding: [0x66,0x26,0xa7] cmpsw %es:(%edi), %es:(%esi) -// CHECK: cwtd -// CHECK: encoding: [0x66,0x99] -cwtd - -// CHECK: cwtl -// CHECK: encoding: [0x98] -cwtl - // CHECK: insb %dx, %es:(%edi) // CHECK: encoding: [0x6c] insb %dx, %es:(%edi) diff --git a/llvm/test/MC/X86/I386-64.s b/llvm/test/MC/X86/I386-64.s index c5bb2b0..b626534 100644 --- a/llvm/test/MC/X86/I386-64.s +++ b/llvm/test/MC/X86/I386-64.s @@ -1,5 +1,13 @@ // RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s +// CHECK: bsfw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xbc,0xed] +bsfw %r13w, %r13w + +// CHECK: bsrw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xbd,0xed] +bsrw %r13w, %r13w + // CHECK: bsfl %r13d, %r13d // CHECK: encoding: [0x45,0x0f,0xbc,0xed] bsfl %r13d, %r13d @@ -8,6 +16,79 @@ bsfl %r13d, %r13d // CHECK: encoding: [0x45,0x0f,0xbd,0xed] bsrl %r13d, %r13d +// CHECK: bsfq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xbc,0xed] +bsfq %r13, %r13 + +// CHECK: bsrq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xbd,0xed] +bsrq %r13, %r13 + + +// CHECK: btcw $0, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xfd,0x00] +btcw $0, %r13w + +// CHECK: btcw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xfd,0xff] +btcw $-1, %r13w + +// CHECK: btcw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xfd,0xff] +btcw $255, %r13w + +// CHECK: btcw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xbb,0xed] +btcw %r13w, %r13w + +// CHECK: btw $0, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xe5,0x00] +btw $0, %r13w + +// CHECK: btw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xe5,0xff] +btw $-1, %r13w + +// CHECK: btw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xe5,0xff] +btw $255, %r13w + +// CHECK: btw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xa3,0xed] +btw %r13w, %r13w + +// CHECK: btrw $0, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xf5,0x00] +btrw $0, %r13w + +// CHECK: btrw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xf5,0xff] +btrw $-1, %r13w + +// CHECK: btrw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xf5,0xff] +btrw $255, %r13w + +// CHECK: btrw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xb3,0xed] +btrw %r13w, %r13w + +// CHECK: btsw $0, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xed,0x00] +btsw $0, %r13w + +// CHECK: btsw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xed,0xff] +btsw $-1, %r13w + +// CHECK: btsw $255, %r13w +// CHECK: encoding: [0x66,0x41,0x0f,0xba,0xed,0xff] +btsw $255, %r13w + +// CHECK: btsw %r13w, %r13w +// CHECK: encoding: [0x66,0x45,0x0f,0xab,0xed] +btsw %r13w, %r13w + // CHECK: btcl $0, %r13d // CHECK: encoding: [0x41,0x0f,0xba,0xfd,0x00] btcl $0, %r13d @@ -72,9 +153,69 @@ btsl $255, %r13d // CHECK: encoding: [0x45,0x0f,0xab,0xed] btsl %r13d, %r13d -// CHECK: cltd -// CHECK: encoding: [0x99] -cltd +// CHECK: btcq $0, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xfd,0x00] +btcq $0, %r13 + +// CHECK: btcq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xfd,0xff] +btcq $-1, %r13 + +// CHECK: btcq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xfd,0xff] +btcq $255, %r13 + +// CHECK: btcq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xbb,0xed] +btcq %r13, %r13 + +// CHECK: btq $0, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xe5,0x00] +btq $0, %r13 + +// CHECK: btq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xe5,0xff] +btq $-1, %r13 + +// CHECK: btq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xe5,0xff] +btq $255, %r13 + +// CHECK: btq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xa3,0xed] +btq %r13, %r13 + +// CHECK: btrq $0, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xf5,0x00] +btrq $0, %r13 + +// CHECK: btrq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xf5,0xff] +btrq $-1, %r13 + +// CHECK: btrq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xf5,0xff] +btrq $255, %r13 + +// CHECK: btrq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xb3,0xed] +btrq %r13, %r13 + +// CHECK: btsq $0, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xed,0x00] +btsq $0, %r13 + +// CHECK: btsq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xed,0xff] +btsq $-1, %r13 + +// CHECK: btsq $255, %r13 +// CHECK: encoding: [0x49,0x0f,0xba,0xed,0xff] +btsq $255, %r13 + +// CHECK: btsq %r13, %r13 +// CHECK: encoding: [0x4d,0x0f,0xab,0xed] +btsq %r13, %r13 // CHECK: cmpsb %es:(%rdi), %gs:(%rsi) // CHECK: encoding: [0x65,0xa6] @@ -92,14 +233,6 @@ cmpsq %es:(%rdi), %gs:(%rsi) // CHECK: encoding: [0x66,0x65,0xa7] cmpsw %es:(%rdi), %gs:(%rsi) -// CHECK: cwtd -// CHECK: encoding: [0x66,0x99] -cwtd - -// CHECK: cwtl -// CHECK: encoding: [0x98] -cwtl - // CHECK: insb %dx, %es:(%rdi) // CHECK: encoding: [0x6c] insb %dx, %es:(%rdi) diff --git a/llvm/test/MC/X86/I86-32.s b/llvm/test/MC/X86/I86-32.s index 32adc1e..5914864 100644 --- a/llvm/test/MC/X86/I86-32.s +++ b/llvm/test/MC/X86/I86-32.s @@ -420,6 +420,10 @@ calll 64 // CHECK: encoding: [0x66,0x98] cbtw +// CHECK: cwtl +// CHECK: encoding: [0x98] +cwtl + // CHECK: clc // CHECK: encoding: [0xf8] clc @@ -432,6 +436,10 @@ cld // CHECK: encoding: [0xfa] cli +// CHECK: cwtd +// CHECK: encoding: [0x66,0x99] +cwtd + // CHECK: cltd // CHECK: encoding: [0x99] cltd diff --git a/llvm/test/MC/X86/I86-64.s b/llvm/test/MC/X86/I86-64.s index 72412fc..6ea78e2 100644 --- a/llvm/test/MC/X86/I86-64.s +++ b/llvm/test/MC/X86/I86-64.s @@ -684,6 +684,14 @@ callw 64 // CHECK: encoding: [0x66,0x98] cbtw +// CHECK: cwtl +// CHECK: encoding: [0x98] +cwtl + +// CHECK: cltq +// CHECK: encoding: [0x48,0x98] +cltq + // CHECK: clc // CHECK: encoding: [0xf8] clc @@ -696,10 +704,18 @@ cld // CHECK: encoding: [0xfa] cli +// CHECK: cwtd +// CHECK: encoding: [0x66,0x99] +cwtd + // CHECK: cltd // CHECK: encoding: [0x99] cltd +// CHECK: cqto +// CHECK: encoding: [0x48,0x99] +cqto + // CHECK: cmc // CHECK: encoding: [0xf5] cmc -- 2.7.4