File: bitrev.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (55 lines) | stat: -rw-r--r-- 1,460 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=xcore | FileCheck %s

declare i8 @llvm.bitreverse.i8(i8)
declare i16 @llvm.bitreverse.i16(i16)
declare i32 @llvm.bitreverse.i32(i32)
declare i64 @llvm.bitreverse.i64(i64)

define i8 @bitrev8(i8 %x) nounwind {
; CHECK-LABEL: bitrev8:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    bitrev r0, r0
; CHECK-NEXT:    shr r0, r0, 24
; CHECK-NEXT:    retsp 0
; CHECK-NEXT:    .cc_bottom bitrev8.function
entry:
  %0 = call i8 @llvm.bitreverse.i8(i8 %x)
  ret i8 %0
}

define i16 @bitrev16(i16 %x) nounwind {
; CHECK-LABEL: bitrev16:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    bitrev r0, r0
; CHECK-NEXT:    shr r0, r0, 16
; CHECK-NEXT:    retsp 0
; CHECK-NEXT:    .cc_bottom bitrev16.function
entry:
  %0 = call i16 @llvm.bitreverse.i16(i16 %x)
  ret i16 %0
}

define i32 @bitrev32(i32 %x) nounwind {
; CHECK-LABEL: bitrev32:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    bitrev r0, r0
; CHECK-NEXT:    retsp 0
; CHECK-NEXT:    .cc_bottom bitrev32.function
entry:
  %0 = call i32 @llvm.bitreverse.i32(i32 %x)
  ret i32 %0
}

define i64 @bitrev64(i64 %x) nounwind {
; CHECK-LABEL: bitrev64:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    bitrev r2, r1
; CHECK-NEXT:    bitrev r1, r0
; CHECK-NEXT:    mov r0, r2
; CHECK-NEXT:    retsp 0
; CHECK-NEXT:    .cc_bottom bitrev64.function
entry:
  %0 = call i64 @llvm.bitreverse.i64(i64 %x)
  ret i64 %0
}