Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -march=x86 | FileCheck %s
      2 
      3 define i32 @foo(i32 %x, i32 %y, i32 %z) nounwind readnone {
      4 entry:
      5 ; CHECK: foo:
      6 ; CHECK: roll %cl
      7 	%0 = shl i32 %x, %z
      8 	%1 = sub i32 32, %z
      9 	%2 = lshr i32 %x, %1
     10 	%3 = or i32 %2, %0
     11 	ret i32 %3
     12 }
     13 
     14 define i32 @bar(i32 %x, i32 %y, i32 %z) nounwind readnone {
     15 entry:
     16 ; CHECK: bar:
     17 ; CHECK: shldl %cl
     18 	%0 = shl i32 %y, %z
     19 	%1 = sub i32 32, %z
     20 	%2 = lshr i32 %x, %1
     21 	%3 = or i32 %2, %0
     22 	ret i32 %3
     23 }
     24 
     25 define i32 @un(i32 %x, i32 %y, i32 %z) nounwind readnone {
     26 entry:
     27 ; CHECK: un:
     28 ; CHECK: rorl %cl
     29 	%0 = lshr i32 %x, %z
     30 	%1 = sub i32 32, %z
     31 	%2 = shl i32 %x, %1
     32 	%3 = or i32 %2, %0
     33 	ret i32 %3
     34 }
     35 
     36 define i32 @bu(i32 %x, i32 %y, i32 %z) nounwind readnone {
     37 entry:
     38 ; CHECK: bu:
     39 ; CHECK: shrdl %cl
     40 	%0 = lshr i32 %y, %z
     41 	%1 = sub i32 32, %z
     42 	%2 = shl i32 %x, %1
     43 	%3 = or i32 %2, %0
     44 	ret i32 %3
     45 }
     46 
     47 define i32 @xfoo(i32 %x, i32 %y, i32 %z) nounwind readnone {
     48 entry:
     49 ; CHECK: xfoo:
     50 ; CHECK: roll $7
     51 	%0 = lshr i32 %x, 25
     52 	%1 = shl i32 %x, 7
     53 	%2 = or i32 %0, %1
     54 	ret i32 %2
     55 }
     56 
     57 define i32 @xbar(i32 %x, i32 %y, i32 %z) nounwind readnone {
     58 entry:
     59 ; CHECK: xbar:
     60 ; CHECK: shldl $7
     61 	%0 = shl i32 %y, 7
     62 	%1 = lshr i32 %x, 25
     63 	%2 = or i32 %0, %1
     64 	ret i32 %2
     65 }
     66 
     67 define i32 @xun(i32 %x, i32 %y, i32 %z) nounwind readnone {
     68 entry:
     69 ; CHECK: xun:
     70 ; CHECK: roll $25
     71 	%0 = lshr i32 %x, 7
     72 	%1 = shl i32 %x, 25
     73 	%2 = or i32 %0, %1
     74 	ret i32 %2
     75 }
     76 
     77 define i32 @xbu(i32 %x, i32 %y, i32 %z) nounwind readnone {
     78 entry:
     79 ; CHECK: xbu:
     80 ; CHECK: shldl
     81 	%0 = lshr i32 %y, 7
     82 	%1 = shl i32 %x, 25
     83 	%2 = or i32 %0, %1
     84 	ret i32 %2
     85 }
     86