• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=bmi | FileCheck %s
3
4@a = external dso_local local_unnamed_addr global i32, align 4
5@f = external dso_local local_unnamed_addr global i32, align 4
6
7define void @g(i32* %x, i32* %y, i32* %z) {
8; CHECK-LABEL: g:
9; CHECK:       # %bb.0: # %entry
10; CHECK-NEXT:    movl {{.*}}(%rip), %eax
11; CHECK-NEXT:    #APP
12; CHECK-NEXT:    #NO_APP
13; CHECK-NEXT:    xorl %ecx, %ecx
14; CHECK-NEXT:    testl %eax, %eax
15; CHECK-NEXT:    sete %cl
16; CHECK-NEXT:    addl %ecx, %ecx
17; CHECK-NEXT:    orl (%rdi), %ecx
18; CHECK-NEXT:    movl $0, (%rsi)
19; CHECK-NEXT:    #APP
20; CHECK-NEXT:    #NO_APP
21; CHECK-NEXT:    shll $8, %eax
22; CHECK-NEXT:    bextrl %eax, {{.*}}(%rip), %eax
23; CHECK-NEXT:    orl %ecx, %eax
24; CHECK-NEXT:    movl %eax, (%rdx)
25; CHECK-NEXT:    retq
26entry:
27  %0 = load i32, i32* @a, align 4
28  %1 = tail call i32 asm "", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
29  %2 = icmp eq i32 %1, 0
30  %shl1 = select i1 %2, i32 2, i32 0
31  %3 = load i32, i32* %x, align 4
32  %or = or i32 %3, %shl1
33  store i32 0, i32* %y, align 4
34  %4 = tail call i32 asm "", "=r,~{dirflag},~{fpsr},~{flags}"()
35  %notmask = shl nsw i32 -1, %4
36  %sub = xor i32 %notmask, -1
37  %5 = load i32, i32* @f, align 4
38  %and4 = and i32 %5, %sub
39  %or6 = or i32 %and4, %or
40  store i32 %or6, i32* %z, align 4
41  ret void
42}
43