Index: test/tools/llvm-mca/X86/Atom/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/Atom/resources-x86_64.s +++ test/tools/llvm-mca/X86/Atom/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.50 cmpq %rsi, %rdi # CHECK-NEXT: 1 1 1.00 * cmpq %rsi, (%rax) # CHECK-NEXT: 1 1 1.00 * cmpq (%rax), %rdi +# CHECK-NEXT: 1 9 4.50 cmpxchgb %al, %bl +# CHECK-NEXT: 1 6 3.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 1 15 7.50 cmpxchgw %ax, %bx +# CHECK-NEXT: 1 14 7.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 1 15 7.50 cmpxchgl %eax, %ebx +# CHECK-NEXT: 1 14 7.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 1 15 7.50 cmpxchgq %rax, %rbx +# CHECK-NEXT: 1 14 7.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 1 18 9.00 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 1 22 11.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.50 decb %dil # CHECK-NEXT: 1 1 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.50 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.50 subq %rsi, %rdi # CHECK-NEXT: 1 1 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 1 1 1.00 * subq (%rax), %rdi +# CHECK-NEXT: 1 2 1.00 xchgb %al, %bl +# CHECK-NEXT: 1 2 1.00 xchgb %bl, %cl +# CHECK-NEXT: 1 3 1.50 * * xchgb %al, (%rbx) +# CHECK-NEXT: 1 3 1.50 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 1 2 1.00 xchgw %bx, %ax +# CHECK-NEXT: 1 2 1.00 xchgw %bx, %cx +# CHECK-NEXT: 1 3 1.50 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 1 3 1.50 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 1 2 1.00 xchgl %ebx, %eax +# CHECK-NEXT: 1 2 1.00 xchgl %ebx, %ecx +# CHECK-NEXT: 1 3 1.50 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 1 3 1.50 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 1 2 1.00 xchgq %rbx, %rax +# CHECK-NEXT: 1 2 1.00 xchgq %rbx, %rcx +# CHECK-NEXT: 1 3 1.50 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 1 3 1.50 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.50 xorb $7, %al # CHECK-NEXT: 1 1 0.50 xorb $7, %dil # CHECK-NEXT: 1 1 1.00 * * xorb $7, (%rax) @@ -1322,7 +1383,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] -# CHECK-NEXT: 1418.00 1088.00 +# CHECK-NEXT: 1509.00 1179.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] Instructions: @@ -1517,6 +1578,16 @@ # CHECK-NEXT: 0.50 0.50 cmpq %rsi, %rdi # CHECK-NEXT: 1.00 - cmpq %rsi, (%rax) # CHECK-NEXT: 1.00 - cmpq (%rax), %rdi +# CHECK-NEXT: 4.50 4.50 cmpxchgb %al, %bl +# CHECK-NEXT: 3.00 3.00 cmpxchgb %al, (%rbx) +# CHECK-NEXT: 7.50 7.50 cmpxchgw %ax, %bx +# CHECK-NEXT: 7.00 7.00 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 7.50 7.50 cmpxchgl %eax, %ebx +# CHECK-NEXT: 7.00 7.00 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 7.50 7.50 cmpxchgq %rax, %rbx +# CHECK-NEXT: 7.00 7.00 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 9.00 9.00 cmpxchg8b (%rsi) +# CHECK-NEXT: 11.00 11.00 cmpxchg16b (%rsi) # CHECK-NEXT: 0.50 0.50 decb %dil # CHECK-NEXT: 1.00 - decb (%rax) # CHECK-NEXT: 0.50 0.50 decw %di @@ -1912,6 +1983,22 @@ # CHECK-NEXT: 0.50 0.50 subq %rsi, %rdi # CHECK-NEXT: 1.00 - subq %rsi, (%rax) # CHECK-NEXT: 1.00 - subq (%rax), %rdi +# CHECK-NEXT: 1.00 1.00 xchgb %al, %bl +# CHECK-NEXT: 1.00 1.00 xchgb %bl, %cl +# CHECK-NEXT: 1.50 1.50 xchgb %al, (%rbx) +# CHECK-NEXT: 1.50 1.50 xchgb %bl, (%rbx) +# CHECK-NEXT: 1.00 1.00 xchgw %bx, %ax +# CHECK-NEXT: 1.00 1.00 xchgw %bx, %cx +# CHECK-NEXT: 1.50 1.50 xchgw %ax, (%rbx) +# CHECK-NEXT: 1.50 1.50 xchgw %bx, (%rbx) +# CHECK-NEXT: 1.00 1.00 xchgl %ebx, %eax +# CHECK-NEXT: 1.00 1.00 xchgl %ebx, %ecx +# CHECK-NEXT: 1.50 1.50 xchgl %eax, (%ebx) +# CHECK-NEXT: 1.50 1.50 xchgl %ebx, (%ecx) +# CHECK-NEXT: 1.00 1.00 xchgq %rbx, %rax +# CHECK-NEXT: 1.00 1.00 xchgq %rbx, %rcx +# CHECK-NEXT: 1.50 1.50 xchgq %rax, (%rbx) +# CHECK-NEXT: 1.50 1.50 xchgq %rbx, (%rcx) # CHECK-NEXT: 0.50 0.50 xorb $7, %al # CHECK-NEXT: 0.50 0.50 xorb $7, %dil # CHECK-NEXT: 1.00 - xorb $7, (%rax) Index: test/tools/llvm-mca/X86/Broadwell/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/Broadwell/resources-x86_64.s +++ test/tools/llvm-mca/X86/Broadwell/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.25 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 5 5 1.25 cmpxchgb %al, %bl +# CHECK-NEXT: 6 8 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgw %ax, %bx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgl %eax, %ebx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 5 5 1.25 cmpxchgq %rax, %rbx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 14 16 2.75 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 19 21 4.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.25 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.25 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.25 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 0.75 xchgb %al, %bl +# CHECK-NEXT: 3 2 0.75 xchgb %bl, %cl +# CHECK-NEXT: 6 8 1.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 6 8 1.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %ax +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %cx +# CHECK-NEXT: 6 8 1.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 6 8 1.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %ecx +# CHECK-NEXT: 6 8 1.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 6 8 1.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rcx +# CHECK-NEXT: 6 8 1.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 6 8 1.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.25 xorb $7, %al # CHECK-NEXT: 1 1 0.25 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1330,7 +1391,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: 50.00 - 377.00 267.50 218.00 218.00 167.00 161.00 343.50 69.00 +# CHECK-NEXT: 50.00 - 409.75 287.25 229.67 229.67 181.00 184.75 374.25 73.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1525,6 +1586,16 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 3.25 2.25 0.83 0.83 1.00 2.25 3.25 0.33 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 5.50 1.50 0.83 0.83 1.00 5.50 3.50 0.33 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decb %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 decb (%rax) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decw %di @@ -1920,6 +1991,22 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - subq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 subq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - subq (%rax), %rdi +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %al, %bl +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %bl, %cl +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgb %al, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %ax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %cx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %eax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %ecx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rcx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %al # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/BtVer2/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/BtVer2/resources-x86_64.s +++ test/tools/llvm-mca/X86/BtVer2/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.50 cmpq %rsi, %rdi # CHECK-NEXT: 1 4 1.00 * cmpq %rsi, (%rax) # CHECK-NEXT: 1 4 1.00 * cmpq (%rax), %rdi +# CHECK-NEXT: 1 1 0.50 cmpxchgb %al, %bl +# CHECK-NEXT: 2 4 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 1 1 0.50 cmpxchgw %ax, %bx +# CHECK-NEXT: 2 4 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 1 1 0.50 cmpxchgl %eax, %ebx +# CHECK-NEXT: 2 4 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 1 1 0.50 cmpxchgq %rax, %rbx +# CHECK-NEXT: 2 4 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 2 4 1.00 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 2 4 1.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.50 decb %dil # CHECK-NEXT: 2 5 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.50 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.50 subq %rsi, %rdi # CHECK-NEXT: 2 5 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 1 4 1.00 * subq (%rax), %rdi +# CHECK-NEXT: 1 1 0.50 xchgb %al, %bl +# CHECK-NEXT: 1 1 0.50 xchgb %bl, %cl +# CHECK-NEXT: 2 4 1.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 2 4 1.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 1 1 0.50 xchgw %bx, %ax +# CHECK-NEXT: 1 1 0.50 xchgw %bx, %cx +# CHECK-NEXT: 2 4 1.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 2 4 1.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 1 1 0.50 xchgl %ebx, %eax +# CHECK-NEXT: 1 1 0.50 xchgl %ebx, %ecx +# CHECK-NEXT: 2 4 1.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 2 4 1.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 1 1 0.50 xchgq %rbx, %rax +# CHECK-NEXT: 1 1 0.50 xchgq %rbx, %rcx +# CHECK-NEXT: 2 4 1.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 2 4 1.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.50 xorb $7, %al # CHECK-NEXT: 1 1 0.50 xorb $7, %dil # CHECK-NEXT: 2 5 1.00 * * xorb $7, (%rax) @@ -1334,7 +1395,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] -# CHECK-NEXT: 493.00 543.00 380.00 - - - - 295.00 64.00 195.00 - - - - +# CHECK-NEXT: 506.00 556.00 380.00 - - - - 309.00 64.00 209.00 - - - - # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] Instructions: @@ -1529,6 +1590,16 @@ # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - cmpq %rsi, %rdi # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - cmpq %rsi, (%rax) # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - cmpq (%rax), %rdi +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - cmpxchgb %al, %bl +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchgb %al, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - cmpxchgw %ax, %bx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - cmpxchgl %eax, %ebx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - cmpxchgq %rax, %rbx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchg8b (%rsi) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - cmpxchg16b (%rsi) # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - decb %dil # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - decb (%rax) # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - decw %di @@ -1924,6 +1995,22 @@ # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - subq %rsi, %rdi # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - subq %rsi, (%rax) # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - - - - - - subq (%rax), %rdi +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgb %al, %bl +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgb %bl, %cl +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgb %al, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgb %bl, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgw %bx, %ax +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgw %bx, %cx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgw %ax, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgw %bx, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgl %ebx, %eax +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgl %ebx, %ecx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgl %eax, (%ebx) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgl %ebx, (%ecx) +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgq %rbx, %rax +# CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xchgq %rbx, %rcx +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgq %rax, (%rbx) +# CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xchgq %rbx, (%rcx) # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xorb $7, %al # CHECK-NEXT: 0.50 0.50 - - - - - - - - - - - - xorb $7, %dil # CHECK-NEXT: 0.50 0.50 - - - - - 1.00 - 1.00 - - - - xorb $7, (%rax) Index: test/tools/llvm-mca/X86/Generic/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/Generic/resources-x86_64.s +++ test/tools/llvm-mca/X86/Generic/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.33 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 4 5 1.33 cmpxchgb %al, %bl +# CHECK-NEXT: 4 8 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 4 5 1.33 cmpxchgw %ax, %bx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 4 5 1.33 cmpxchgl %eax, %ebx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 4 5 1.33 cmpxchgq %rax, %rbx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 3 6 1.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.33 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.33 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.33 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 1.00 xchgb %al, %bl +# CHECK-NEXT: 3 2 1.00 xchgb %bl, %cl +# CHECK-NEXT: 3 6 1.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 1.00 xchgw %bx, %ax +# CHECK-NEXT: 3 2 1.00 xchgw %bx, %cx +# CHECK-NEXT: 3 6 1.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 1.00 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 1.00 xchgl %ebx, %ecx +# CHECK-NEXT: 3 6 1.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 3 6 1.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 1.00 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 1.00 xchgq %rbx, %rcx +# CHECK-NEXT: 3 6 1.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.33 xorb $7, %al # CHECK-NEXT: 1 1 0.33 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1328,7 +1389,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1] -# CHECK-NEXT: 160.00 - 365.50 171.00 210.00 356.50 254.00 254.00 +# CHECK-NEXT: 160.00 - 386.83 190.33 220.00 377.83 266.00 266.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: @@ -1523,6 +1584,16 @@ # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - decb %dil # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 decb (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - decw %di @@ -1918,6 +1989,22 @@ # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - subq %rsi, %rdi # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 subq %rsi, (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 subq (%rax), %rdi +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgb %al, %bl +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgb %bl, %cl +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgb %al, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgw %bx, %ax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgw %bx, %cx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgl %ebx, %eax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgl %ebx, %ecx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgq %rbx, %rax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgq %rbx, %rcx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - xorb $7, %al # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - xorb $7, %dil # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/Haswell/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/Haswell/resources-x86_64.s +++ test/tools/llvm-mca/X86/Haswell/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.25 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 5 5 1.25 cmpxchgb %al, %bl +# CHECK-NEXT: 6 9 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgw %ax, %bx +# CHECK-NEXT: 6 9 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgl %eax, %ebx +# CHECK-NEXT: 6 9 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 5 5 1.25 cmpxchgq %rax, %rbx +# CHECK-NEXT: 6 9 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 14 17 2.75 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 19 22 4.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.25 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.25 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.25 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 0.75 xchgb %al, %bl +# CHECK-NEXT: 3 2 0.75 xchgb %bl, %cl +# CHECK-NEXT: 6 9 1.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 6 9 1.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %ax +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %cx +# CHECK-NEXT: 6 9 1.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 6 9 1.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %ecx +# CHECK-NEXT: 6 9 1.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 6 9 1.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rcx +# CHECK-NEXT: 6 9 1.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 6 9 1.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.25 xorb $7, %al # CHECK-NEXT: 1 1 0.25 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1330,7 +1391,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: 80.00 - 428.00 288.50 209.00 209.00 158.00 184.00 423.50 66.00 +# CHECK-NEXT: 80.00 - 460.75 308.25 220.67 220.67 172.00 207.75 454.25 70.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1525,6 +1586,16 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 3.25 2.25 0.83 0.83 1.00 2.25 3.25 0.33 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 5.50 1.50 0.83 0.83 1.00 5.50 3.50 0.33 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decb %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 decb (%rax) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decw %di @@ -1920,6 +1991,22 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - subq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 subq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - subq (%rax), %rdi +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %al, %bl +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %bl, %cl +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgb %al, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %ax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %cx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %eax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %ecx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rcx +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 0.83 0.83 1.00 0.75 0.75 0.33 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %al # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/SLM/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/SLM/resources-x86_64.s +++ test/tools/llvm-mca/X86/SLM/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.50 cmpq %rsi, %rdi # CHECK-NEXT: 1 4 1.00 * cmpq %rsi, (%rax) # CHECK-NEXT: 1 4 1.00 * cmpq (%rax), %rdi +# CHECK-NEXT: 1 1 0.50 cmpxchgb %al, %bl +# CHECK-NEXT: 2 4 2.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 1 1 0.50 cmpxchgw %ax, %bx +# CHECK-NEXT: 2 4 2.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 1 1 0.50 cmpxchgl %eax, %ebx +# CHECK-NEXT: 2 4 2.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 1 1 0.50 cmpxchgq %rax, %rbx +# CHECK-NEXT: 2 4 2.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 2 4 2.00 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 2 4 2.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.50 decb %dil # CHECK-NEXT: 2 5 2.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.50 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.50 subq %rsi, %rdi # CHECK-NEXT: 2 5 2.00 * * subq %rsi, (%rax) # CHECK-NEXT: 1 4 1.00 * subq (%rax), %rdi +# CHECK-NEXT: 1 1 0.50 xchgb %al, %bl +# CHECK-NEXT: 1 1 0.50 xchgb %bl, %cl +# CHECK-NEXT: 2 4 2.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 2 4 2.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 1 1 0.50 xchgw %bx, %ax +# CHECK-NEXT: 1 1 0.50 xchgw %bx, %cx +# CHECK-NEXT: 2 4 2.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 2 4 2.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 1 1 0.50 xchgl %ebx, %eax +# CHECK-NEXT: 1 1 0.50 xchgl %ebx, %ecx +# CHECK-NEXT: 2 4 2.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 2 4 2.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 1 1 0.50 xchgq %rbx, %rax +# CHECK-NEXT: 1 1 0.50 xchgq %rbx, %rcx +# CHECK-NEXT: 2 4 2.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 2 4 2.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.50 xorb $7, %al # CHECK-NEXT: 1 1 0.50 xorb $7, %dil # CHECK-NEXT: 2 5 2.00 * * xorb $7, (%rax) @@ -1328,7 +1389,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] -# CHECK-NEXT: 400.00 - - - - 544.00 386.00 502.00 +# CHECK-NEXT: 400.00 - - - - 557.00 399.00 530.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions: @@ -1523,6 +1584,16 @@ # CHECK-NEXT: - - - - - 0.50 0.50 - cmpq %rsi, %rdi # CHECK-NEXT: - - - - - 0.50 0.50 1.00 cmpq %rsi, (%rax) # CHECK-NEXT: - - - - - 0.50 0.50 1.00 cmpq (%rax), %rdi +# CHECK-NEXT: - - - - - 0.50 0.50 - cmpxchgb %al, %bl +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 - cmpxchgw %ax, %bx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - - - - 0.50 0.50 - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchg8b (%rsi) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 cmpxchg16b (%rsi) # CHECK-NEXT: - - - - - 0.50 0.50 - decb %dil # CHECK-NEXT: - - - - - 1.00 1.00 2.00 decb (%rax) # CHECK-NEXT: - - - - - 0.50 0.50 - decw %di @@ -1918,6 +1989,22 @@ # CHECK-NEXT: - - - - - 0.50 0.50 - subq %rsi, %rdi # CHECK-NEXT: - - - - - 1.00 1.00 2.00 subq %rsi, (%rax) # CHECK-NEXT: - - - - - 0.50 0.50 1.00 subq (%rax), %rdi +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgb %al, %bl +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgb %bl, %cl +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgb %al, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgb %bl, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgw %bx, %ax +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgw %bx, %cx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgw %ax, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgw %bx, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgl %ebx, %eax +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgl %ebx, %ecx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgl %eax, (%ebx) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgq %rbx, %rax +# CHECK-NEXT: - - - - - 0.50 0.50 - xchgq %rbx, %rcx +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgq %rax, (%rbx) +# CHECK-NEXT: - - - - - 0.50 0.50 2.00 xchgq %rbx, (%rcx) # CHECK-NEXT: - - - - - 0.50 0.50 - xorb $7, %al # CHECK-NEXT: - - - - - 0.50 0.50 - xorb $7, %dil # CHECK-NEXT: - - - - - 1.00 1.00 2.00 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/SandyBridge/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/SandyBridge/resources-x86_64.s +++ test/tools/llvm-mca/X86/SandyBridge/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.33 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 4 5 1.33 cmpxchgb %al, %bl +# CHECK-NEXT: 4 8 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 4 5 1.33 cmpxchgw %ax, %bx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 4 5 1.33 cmpxchgl %eax, %ebx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 4 5 1.33 cmpxchgq %rax, %rbx +# CHECK-NEXT: 4 8 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 3 6 1.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.33 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.33 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.33 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 1.00 xchgb %al, %bl +# CHECK-NEXT: 3 2 1.00 xchgb %bl, %cl +# CHECK-NEXT: 3 6 1.00 * * xchgb %al, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 1.00 xchgw %bx, %ax +# CHECK-NEXT: 3 2 1.00 xchgw %bx, %cx +# CHECK-NEXT: 3 6 1.00 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 1.00 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 1.00 xchgl %ebx, %ecx +# CHECK-NEXT: 3 6 1.00 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 3 6 1.00 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 1.00 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 1.00 xchgq %rbx, %rcx +# CHECK-NEXT: 3 6 1.00 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 3 6 1.00 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.33 xorb $7, %al # CHECK-NEXT: 1 1 0.33 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1328,7 +1389,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1] -# CHECK-NEXT: 160.00 - 365.50 171.00 210.00 356.50 254.00 254.00 +# CHECK-NEXT: 160.00 - 386.83 190.33 220.00 377.83 266.00 266.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6.0] [6.1] Instructions: @@ -1523,6 +1584,16 @@ # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.50 1.00 - 1.50 - - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.00 1.00 - 1.00 0.50 0.50 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - decb %dil # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 decb (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - decw %di @@ -1918,6 +1989,22 @@ # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - subq %rsi, %rdi # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 subq %rsi, (%rax) # CHECK-NEXT: - - 0.33 0.33 - 0.33 0.50 0.50 subq (%rax), %rdi +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgb %al, %bl +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgb %bl, %cl +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgb %al, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgw %bx, %ax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgw %bx, %cx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgl %ebx, %eax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgl %ebx, %ecx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgq %rbx, %rax +# CHECK-NEXT: - - 1.00 1.00 - 1.00 - - xchgq %rbx, %rcx +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - xorb $7, %al # CHECK-NEXT: - - 0.33 0.33 - 0.33 - - xorb $7, %dil # CHECK-NEXT: - - 0.33 0.33 1.00 0.33 1.00 1.00 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/SkylakeClient/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/SkylakeClient/resources-x86_64.s +++ test/tools/llvm-mca/X86/SkylakeClient/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.25 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 5 5 1.25 cmpxchgb %al, %bl +# CHECK-NEXT: 6 8 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgw %ax, %bx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgl %eax, %ebx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 5 5 1.25 cmpxchgq %rax, %rbx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 14 16 2.75 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 19 23 4.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.25 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.25 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.25 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 0.75 xchgb %al, %bl +# CHECK-NEXT: 3 2 0.75 xchgb %bl, %cl +# CHECK-NEXT: 8 10 1.25 * * xchgb %al, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %ax +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %cx +# CHECK-NEXT: 8 10 1.25 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %ecx +# CHECK-NEXT: 8 10 1.25 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 8 10 1.25 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rcx +# CHECK-NEXT: 8 10 1.25 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.25 xorb $7, %al # CHECK-NEXT: 1 1 0.25 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1330,7 +1391,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: 60.00 - 444.50 248.50 218.00 218.00 167.00 197.00 430.00 69.00 +# CHECK-NEXT: 60.00 - 481.25 268.25 229.67 229.67 181.00 220.75 472.75 73.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1525,6 +1586,16 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 3.25 2.25 0.83 0.83 1.00 2.25 3.25 0.33 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 5.50 1.50 0.83 0.83 1.00 5.50 3.50 0.33 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decb %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 decb (%rax) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decw %di @@ -1920,6 +1991,22 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - subq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 subq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - subq (%rax), %rdi +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %al, %bl +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %bl, %cl +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgb %al, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %ax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %cx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %eax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %ecx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rcx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %al # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/SkylakeServer/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/SkylakeServer/resources-x86_64.s +++ test/tools/llvm-mca/X86/SkylakeServer/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.25 cmpq %rsi, %rdi # CHECK-NEXT: 2 6 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 5 5 1.25 cmpxchgb %al, %bl +# CHECK-NEXT: 6 8 1.00 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgw %ax, %bx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 5 5 1.25 cmpxchgl %eax, %ebx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 5 5 1.25 cmpxchgq %rax, %rbx +# CHECK-NEXT: 6 8 1.00 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 14 16 2.75 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 19 23 4.00 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.25 decb %dil # CHECK-NEXT: 3 7 1.00 * * decb (%rax) # CHECK-NEXT: 1 1 0.25 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.25 subq %rsi, %rdi # CHECK-NEXT: 3 7 1.00 * * subq %rsi, (%rax) # CHECK-NEXT: 2 6 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 3 2 0.75 xchgb %al, %bl +# CHECK-NEXT: 3 2 0.75 xchgb %bl, %cl +# CHECK-NEXT: 8 10 1.25 * * xchgb %al, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %ax +# CHECK-NEXT: 3 2 0.75 xchgw %bx, %cx +# CHECK-NEXT: 8 10 1.25 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %eax +# CHECK-NEXT: 3 2 0.75 xchgl %ebx, %ecx +# CHECK-NEXT: 8 10 1.25 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 8 10 1.25 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rax +# CHECK-NEXT: 3 2 0.75 xchgq %rbx, %rcx +# CHECK-NEXT: 8 10 1.25 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 8 10 1.25 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.25 xorb $7, %al # CHECK-NEXT: 1 1 0.25 xorb $7, %dil # CHECK-NEXT: 3 7 1.00 * * xorb $7, (%rax) @@ -1330,7 +1391,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] -# CHECK-NEXT: 60.00 - 444.75 248.75 218.00 218.00 167.00 197.25 430.25 69.00 +# CHECK-NEXT: 60.00 - 481.50 268.50 229.67 229.67 181.00 221.00 473.00 73.67 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions: @@ -1525,6 +1586,16 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - cmpq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - cmpq (%rax), %rdi +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgb %al, %bl +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgw %ax, %bx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgl %eax, %ebx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.75 0.75 - - - 0.75 1.75 - cmpxchgq %rax, %rbx +# CHECK-NEXT: - - 1.25 0.25 0.83 0.83 1.00 0.25 1.25 0.33 cmpxchgq %rax, (%rbx) +# CHECK-NEXT: - - 3.25 2.25 0.83 0.83 1.00 2.25 3.25 0.33 cmpxchg8b (%rsi) +# CHECK-NEXT: - - 5.50 1.50 0.83 0.83 1.00 5.50 3.50 0.33 cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decb %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 decb (%rax) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - decw %di @@ -1920,6 +1991,22 @@ # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - subq %rsi, %rdi # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 subq %rsi, (%rax) # CHECK-NEXT: - - 0.25 0.25 0.50 0.50 - 0.25 0.25 - subq (%rax), %rdi +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %al, %bl +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgb %bl, %cl +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgb %al, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgb %bl, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %ax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgw %bx, %cx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgw %ax, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgw %bx, (%rbx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %eax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgl %ebx, %ecx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgl %eax, (%ebx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rax +# CHECK-NEXT: - - 0.75 0.75 - - - 0.75 0.75 - xchgq %rbx, %rcx +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgq %rax, (%rbx) +# CHECK-NEXT: - - 1.25 0.75 0.83 0.83 1.00 0.75 2.25 0.33 xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %al # CHECK-NEXT: - - 0.25 0.25 - - - 0.25 0.25 - xorb $7, %dil # CHECK-NEXT: - - 0.25 0.25 0.83 0.83 1.00 0.25 0.25 0.33 xorb $7, (%rax) Index: test/tools/llvm-mca/X86/Znver1/resources-x86_64.s =================================================================== --- test/tools/llvm-mca/X86/Znver1/resources-x86_64.s +++ test/tools/llvm-mca/X86/Znver1/resources-x86_64.s @@ -217,6 +217,21 @@ cmpq %rsi, (%rax) cmpq (%rax), %rdi +cmpxchgb %al, %bl +cmpxchgb %al, (%rbx) + +cmpxchgw %ax, %bx +cmpxchgw %ax, (%rbx) + +cmpxchgl %eax, %ebx +cmpxchgl %eax, (%ebx) + +cmpxchgq %rax, %rbx +cmpxchgq %rax, (%rbx) + +cmpxchg8b (%rsi) +cmpxchg16b (%rsi) + decb %dil decb (%rax) decw %di @@ -656,6 +671,26 @@ subq %rsi, (%rax) subq (%rax), %rdi +xchgb %al, %bl +xchgb %bl, %cl +xchgb %al, (%rbx) +xchgb %bl, (%rbx) + +xchgw %ax, %bx +xchgw %bx, %cx +xchgw %ax, (%rbx) +xchgw %bx, (%rbx) + +xchgl %eax, %ebx +xchgl %ebx, %ecx +xchgl %eax, (%ebx) +xchgl %ebx, (%ecx) + +xchgq %rax, %rbx +xchgq %rbx, %rcx +xchgq %rax, (%rbx) +xchgq %rbx, (%rcx) + xorb $7, %al xorb $7, %dil xorb $7, (%rax) @@ -890,6 +925,16 @@ # CHECK-NEXT: 1 1 0.25 cmpq %rsi, %rdi # CHECK-NEXT: 2 5 0.50 * cmpq %rsi, (%rax) # CHECK-NEXT: 2 5 0.50 * cmpq (%rax), %rdi +# CHECK-NEXT: 1 1 0.25 cmpxchgb %al, %bl +# CHECK-NEXT: 5 8 0.50 * * cmpxchgb %al, (%rbx) +# CHECK-NEXT: 1 1 0.25 cmpxchgw %ax, %bx +# CHECK-NEXT: 5 8 0.50 * * cmpxchgw %ax, (%rbx) +# CHECK-NEXT: 1 1 0.25 cmpxchgl %eax, %ebx +# CHECK-NEXT: 5 8 0.50 * * cmpxchgl %eax, (%ebx) +# CHECK-NEXT: 1 1 0.25 cmpxchgq %rax, %rbx +# CHECK-NEXT: 5 8 0.50 * * cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 18 1 0.50 * * cmpxchg8b (%rsi) +# CHECK-NEXT: 1 100 0.25 * * cmpxchg16b (%rsi) # CHECK-NEXT: 1 1 0.25 decb %dil # CHECK-NEXT: 2 5 0.50 * * decb (%rax) # CHECK-NEXT: 1 1 0.25 decw %di @@ -1285,6 +1330,22 @@ # CHECK-NEXT: 1 1 0.25 subq %rsi, %rdi # CHECK-NEXT: 2 5 0.50 * * subq %rsi, (%rax) # CHECK-NEXT: 2 5 0.50 * subq (%rax), %rdi +# CHECK-NEXT: 2 1 0.50 xchgb %al, %bl +# CHECK-NEXT: 2 1 0.50 xchgb %bl, %cl +# CHECK-NEXT: 2 5 0.50 * * xchgb %al, (%rbx) +# CHECK-NEXT: 2 5 0.50 * * xchgb %bl, (%rbx) +# CHECK-NEXT: 2 1 0.50 xchgw %bx, %ax +# CHECK-NEXT: 2 1 0.50 xchgw %bx, %cx +# CHECK-NEXT: 2 5 0.50 * * xchgw %ax, (%rbx) +# CHECK-NEXT: 2 5 0.50 * * xchgw %bx, (%rbx) +# CHECK-NEXT: 2 1 0.50 xchgl %ebx, %eax +# CHECK-NEXT: 2 1 0.50 xchgl %ebx, %ecx +# CHECK-NEXT: 2 5 0.50 * * xchgl %eax, (%ebx) +# CHECK-NEXT: 2 5 0.50 * * xchgl %ebx, (%ecx) +# CHECK-NEXT: 2 1 0.50 xchgq %rbx, %rax +# CHECK-NEXT: 2 1 0.50 xchgq %rbx, %rcx +# CHECK-NEXT: 2 5 0.50 * * xchgq %rax, (%rbx) +# CHECK-NEXT: 2 5 0.50 * * xchgq %rbx, (%rcx) # CHECK-NEXT: 1 1 0.25 xorb $7, %al # CHECK-NEXT: 1 1 0.25 xorb $7, %dil # CHECK-NEXT: 2 5 0.50 * * xorb $7, (%rax) @@ -1332,7 +1393,7 @@ # CHECK: Resource pressure per iteration: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] -# CHECK-NEXT: 147.50 147.50 131.00 165.00 147.00 131.00 392.00 - - - - 34.00 +# CHECK-NEXT: 154.00 154.00 139.25 173.25 155.25 139.25 392.00 - - - - 34.00 # CHECK: Resource pressure by instruction: # CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] Instructions: @@ -1527,6 +1588,16 @@ # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - cmpq %rsi, %rdi # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpq %rsi, (%rax) # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpq (%rax), %rdi +# CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - cmpxchgb %al, %bl +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpxchgb %al, (%rbx) +# CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - cmpxchgw %ax, %bx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpxchgw %ax, (%rbx) +# CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - cmpxchgl %eax, %ebx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpxchgl %eax, (%ebx) +# CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - cmpxchgq %rax, %rbx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpxchgq %rax, (%rbx) +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - cmpxchg8b (%rsi) +# CHECK-NEXT: - - - - - - - - - - - - cmpxchg16b (%rsi) # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - decb %dil # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - decb (%rax) # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - decw %di @@ -1922,6 +1993,22 @@ # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - subq %rsi, %rdi # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - subq %rsi, (%rax) # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - subq (%rax), %rdi +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgb %al, %bl +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgb %bl, %cl +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgb %al, (%rbx) +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgb %bl, (%rbx) +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgw %bx, %ax +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgw %bx, %cx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgw %ax, (%rbx) +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgw %bx, (%rbx) +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgl %ebx, %eax +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgl %ebx, %ecx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgl %eax, (%ebx) +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgl %ebx, (%ecx) +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgq %rbx, %rax +# CHECK-NEXT: - - 0.50 0.50 0.50 0.50 - - - - - - xchgq %rbx, %rcx +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgq %rax, (%rbx) +# CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xchgq %rbx, (%rcx) # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - xorb $7, %al # CHECK-NEXT: - - 0.25 0.25 0.25 0.25 - - - - - - xorb $7, %dil # CHECK-NEXT: 0.50 0.50 0.25 0.25 0.25 0.25 - - - - - - xorb $7, (%rax)