; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+bmi | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_andn_i16:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: andnl %esi, %edi, %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: notl %edi # sched: [1:0.25]
+; SKYLAKE-NEXT: andw (%rdx), %di # sched: [1:0.50]
+; SKYLAKE-NEXT: addl %edi, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_andn_i16:
; BTVER2: # BB#0:
; BTVER2-NEXT: andnl %esi, %edi, %eax # sched: [1:0.50]
; HASWELL-NEXT: addl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_andn_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: andnl %esi, %edi, %ecx # sched: [1:0.50]
+; SKYLAKE-NEXT: andnl (%rdx), %edi, %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_andn_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: andnl (%rdx), %edi, %eax # sched: [4:1.00]
; HASWELL-NEXT: addq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_andn_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: andnq %rsi, %rdi, %rcx # sched: [1:0.50]
+; SKYLAKE-NEXT: andnq (%rdx), %rdi, %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_andn_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: andnq (%rdx), %rdi, %rax # sched: [4:1.00]
; HASWELL-NEXT: addl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_bextr_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: bextrl %edi, (%rdx), %ecx # sched: [2:0.50]
+; SKYLAKE-NEXT: bextrl %edi, %esi, %eax # sched: [2:0.50]
+; SKYLAKE-NEXT: addl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_bextr_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: bextrl %edi, (%rdx), %ecx
; HASWELL-NEXT: addq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_bextr_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: bextrq %rdi, (%rdx), %rcx # sched: [2:0.50]
+; SKYLAKE-NEXT: bextrq %rdi, %rsi, %rax # sched: [2:0.50]
+; SKYLAKE-NEXT: addq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_bextr_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: bextrq %rdi, (%rdx), %rcx
; HASWELL-NEXT: addl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsi_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsil (%rsi), %ecx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsil %edi, %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsi_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsil (%rsi), %ecx
; HASWELL-NEXT: addq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsi_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsiq (%rsi), %rcx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsiq %rdi, %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsi_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsiq (%rsi), %rcx
; HASWELL-NEXT: addl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsmsk_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsmskl (%rsi), %ecx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsmskl %edi, %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsmsk_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsmskl (%rsi), %ecx
; HASWELL-NEXT: addq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsmsk_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsmskq (%rsi), %rcx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsmskq %rdi, %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsmsk_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsmskq (%rsi), %rcx
; HASWELL-NEXT: addl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsr_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsrl (%rsi), %ecx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsrl %edi, %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsr_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsrl (%rsi), %ecx
; HASWELL-NEXT: addq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_blsr_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: blsrq (%rsi), %rcx # sched: [1:0.50]
+; SKYLAKE-NEXT: blsrq %rdi, %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_blsr_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: blsrq (%rsi), %rcx
; HASWELL-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_cttz_i16:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: tzcntw (%rsi), %cx # sched: [3:1.00]
+; SKYLAKE-NEXT: tzcntw %di, %ax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_cttz_i16:
; BTVER2: # BB#0:
; BTVER2-NEXT: tzcntw (%rsi), %cx
; HASWELL-NEXT: orl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_cttz_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: tzcntl (%rsi), %ecx # sched: [3:1.00]
+; SKYLAKE-NEXT: tzcntl %edi, %eax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_cttz_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: tzcntl (%rsi), %ecx
; HASWELL-NEXT: orq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_cttz_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: tzcntq (%rsi), %rcx # sched: [3:1.00]
+; SKYLAKE-NEXT: tzcntq %rdi, %rax # sched: [3:1.00]
+; SKYLAKE-NEXT: orq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_cttz_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: tzcntq (%rsi), %rcx
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: leal -24(%rdi), %eax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal -24(%rdi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
; HASWELL-NEXT: leal 1024(%rdi), %eax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal 1024(%rdi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
; HASWELL-NEXT: leal (%rdi,%rsi), %eax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; HASWELL-NEXT: addl $16, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $16, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $-4096, %eax # imm = 0xF000
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; HASWELL-NEXT: leal (%rdi,%rdi,2), %eax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rdi,2), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
; HASWELL-NEXT: addl $-32, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rdi,2), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $-32, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rdi,8), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $10000, %eax # imm = 0x2710
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
; HASWELL-NEXT: leal (%rdi,%rsi,2), %eax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi,2), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; HASWELL-NEXT: addl $96, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi,4), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $96, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
+; SKYLAKE-NEXT: # kill: %EDI<def> %EDI<kill> %RDI<def>
+; SKYLAKE-NEXT: leal (%rdi,%rsi,8), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: addl $-1200, %eax # imm = 0xFB50
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: # kill: %ESI<def> %ESI<kill> %RSI<def>
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: leaq -24(%rdi), %rax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq -24(%rdi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq -24(%rdi), %rax # sched: [1:0.50]
; HASWELL-NEXT: leaq 1024(%rdi), %rax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq 1024(%rdi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq 1024(%rdi), %rax # sched: [1:0.50]
; HASWELL-NEXT: leaq (%rdi,%rsi), %rax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq (%rdi,%rsi), %rax # sched: [1:0.50]
; HASWELL-NEXT: addq $16, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $16, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq 16(%rdi,%rsi), %rax # sched: [1:0.50]
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $-4096, %rax # imm = 0xF000
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq -4096(%rdi,%rsi), %rax # sched: [1:0.50]
; HASWELL-NEXT: leaq (%rdi,%rdi,2), %rax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rdi,2), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq (%rdi,%rdi,2), %rax # sched: [1:0.50]
; HASWELL-NEXT: addq $-32, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rdi,2), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $-32, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq -32(%rdi,%rdi,2), %rax # sched: [1:0.50]
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_mul_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rdi,8), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $10000, %rax # imm = 0x2710
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_mul_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq 10000(%rdi,%rdi,8), %rax # sched: [1:0.50]
; HASWELL-NEXT: leaq (%rdi,%rsi,2), %rax # sched: [1:0.50]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi,2), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq (%rdi,%rsi,2), %rax # sched: [1:0.50]
; HASWELL-NEXT: addq $96, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale_offset:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi,4), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $96, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale_offset:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq 96(%rdi,%rsi,4), %rax # sched: [1:0.50]
; HASWELL-NEXT: # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_lea_add_scale_offset_big:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: leaq (%rdi,%rsi,8), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: addq $-1200, %rax # imm = 0xFB50
+; SKYLAKE-NEXT: # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_lea_add_scale_offset_big:
; BTVER2: # BB#0:
; BTVER2-NEXT: leaq -1200(%rdi,%rsi,8), %rax # sched: [1:0.50]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+lzcnt | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctlz_i16:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: lzcntw (%rsi), %cx # sched: [3:1.00]
+; SKYLAKE-NEXT: lzcntw %di, %ax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctlz_i16:
; BTVER2: # BB#0:
; BTVER2-NEXT: lzcntw (%rsi), %cx
; HASWELL-NEXT: orl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctlz_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: lzcntl (%rsi), %ecx # sched: [3:1.00]
+; SKYLAKE-NEXT: lzcntl %edi, %eax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctlz_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: lzcntl (%rsi), %ecx
; HASWELL-NEXT: orq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctlz_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: lzcntq (%rsi), %rcx # sched: [3:1.00]
+; SKYLAKE-NEXT: lzcntq %rdi, %rax # sched: [3:1.00]
+; SKYLAKE-NEXT: orq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctlz_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: lzcntq (%rsi), %rcx
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=atom | FileCheck %s --check-prefix=CHECK --check-prefix=ATOM
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=slm | FileCheck %s --check-prefix=CHECK --check-prefix=SLM
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: movbew %si, (%rdx) # sched: [1:1.00]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_movbe_i16:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: movbew (%rdi), %ax # sched: [1:0.50]
+; SKYLAKE-NEXT: movbew %si, (%rdx) # sched: [1:1.00]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_movbe_i16:
; BTVER2: # BB#0:
; BTVER2-NEXT: movbew (%rdi), %ax # sched: [4:1.00]
; HASWELL-NEXT: movbel %esi, (%rdx) # sched: [1:1.00]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_movbe_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: movbel (%rdi), %eax # sched: [1:0.50]
+; SKYLAKE-NEXT: movbel %esi, (%rdx) # sched: [1:1.00]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_movbe_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: movbel (%rdi), %eax # sched: [4:1.00]
; HASWELL-NEXT: movbeq %rsi, (%rdx) # sched: [1:1.00]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_movbe_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: movbeq (%rdi), %rax # sched: [1:0.50]
+; SKYLAKE-NEXT: movbeq %rsi, (%rdx) # sched: [1:1.00]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_movbe_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: movbeq (%rdi), %rax # sched: [4:1.00]
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
-; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=knl | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1
; HASWELL-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctpop_i16:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: popcntw (%rsi), %cx # sched: [3:1.00]
+; SKYLAKE-NEXT: popcntw %di, %ax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: # kill: %AX<def> %AX<kill> %EAX<kill>
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctpop_i16:
; BTVER2: # BB#0:
; BTVER2-NEXT: popcntw (%rsi), %cx # sched: [8:1.00]
; HASWELL-NEXT: orl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctpop_i32:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: popcntl (%rsi), %ecx # sched: [3:1.00]
+; SKYLAKE-NEXT: popcntl %edi, %eax # sched: [3:1.00]
+; SKYLAKE-NEXT: orl %ecx, %eax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctpop_i32:
; BTVER2: # BB#0:
; BTVER2-NEXT: popcntl (%rsi), %ecx # sched: [8:1.00]
; HASWELL-NEXT: orq %rcx, %rax # sched: [1:0.25]
; HASWELL-NEXT: retq # sched: [2:1.00]
;
+; SKYLAKE-LABEL: test_ctpop_i64:
+; SKYLAKE: # BB#0:
+; SKYLAKE-NEXT: popcntq (%rsi), %rcx # sched: [3:1.00]
+; SKYLAKE-NEXT: popcntq %rdi, %rax # sched: [3:1.00]
+; SKYLAKE-NEXT: orq %rcx, %rax # sched: [1:0.25]
+; SKYLAKE-NEXT: retq # sched: [2:1.00]
+;
; BTVER2-LABEL: test_ctpop_i64:
; BTVER2: # BB#0:
; BTVER2-NEXT: popcntq (%rsi), %rcx # sched: [8:1.00]