~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/Mips/cttz-v.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc  < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=MIPS32
 
2
; RUN: llc  < %s -march=mips64el -mcpu=mips64r2 | FileCheck %s -check-prefix=MIPS64
 
3
 
 
4
declare <2 x i32> @llvm.cttz.v2i32(<2 x i32>, i1)
 
5
 
 
6
define <2 x i32> @cttzv2i32(<2 x i32> %x) {
 
7
entry:
 
8
; MIPS32-DAG: addiu   $[[R0:[0-9]+]], $4, -1
 
9
; MIPS32-DAG: not     $[[R1:[0-9]+]], $4
 
10
; MIPS32-DAG: and     $[[R2:[0-9]+]], $[[R1]], $[[R0]]
 
11
; MIPS32-DAG: clz     $[[R3:[0-9]+]], $[[R2]]
 
12
; MIPS32-DAG: addiu   $[[R4:[0-9]+]], $zero, 32
 
13
; MIPS32-DAG: subu    $2, $[[R4]], $[[R3]]
 
14
; MIPS32-DAG: addiu   $[[R5:[0-9]+]], $5, -1
 
15
; MIPS32-DAG: not     $[[R6:[0-9]+]], $5
 
16
; MIPS32-DAG: and     $[[R7:[0-9]+]], $[[R6]], $[[R5]]
 
17
; MIPS32-DAG: clz     $[[R8:[0-9]+]], $[[R7]]
 
18
; MIPS32-DAG: jr      $ra
 
19
; MIPS32-DAG: subu    $3, $[[R4]], $[[R8]]
 
20
 
 
21
; MIPS64-DAG: sll     $[[A0:[0-9]+]], $4, 0
 
22
; MIPS64-DAG: addiu   $[[R0:[0-9]+]], $[[A0]], -1
 
23
; MIPS64-DAG: not     $[[R1:[0-9]+]], $[[A0]]
 
24
; MIPS64-DAG: and     $[[R2:[0-9]+]], $[[R1]], $[[R0]]
 
25
; MIPS64-DAG: clz     $[[R3:[0-9]+]], $[[R2]]
 
26
; MIPS64-DAG: addiu   $[[R4:[0-9]+]], $zero, 32
 
27
; MIPS64-DAG: subu    $2, $[[R4]], $[[R3]]
 
28
; MIPS64-DAG: sll     $[[A1:[0-9]+]], $5, 0
 
29
; MIPS64-DAG: addiu   $[[R5:[0-9]+]], $[[A1]], -1
 
30
; MIPS64-DAG: not     $[[R6:[0-9]+]], $[[A1]]
 
31
; MIPS64-DAG: and     $[[R7:[0-9]+]], $[[R6]], $[[R5]]
 
32
; MIPS64-DAG: clz     $[[R8:[0-9]+]], $[[R7]]
 
33
; MIPS64-DAG: jr      $ra
 
34
; MIPS64-DAG: subu    $3, $[[R4]], $[[R8]]
 
35
 
 
36
  %ret = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %x, i1 true)
 
37
  ret <2 x i32> %ret
 
38
}
 
39