File: bswap.ll

package info (click to toggle)
llvm-3.1 3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 80,224 kB
  • sloc: cpp: 491,014; asm: 110,971; ansic: 14,579; sh: 13,120; python: 6,152; ml: 4,719; makefile: 1,830; pascal: 1,553; perl: 874; xml: 283; lisp: 187; csh: 117; exp: 4
file content (25 lines) | stat: -rw-r--r-- 679 bytes parent folder | download
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
; RUN: llc  < %s -march=mipsel -mcpu=mips32r2 | FileCheck %s -check-prefix=MIPS32
; RUN: llc  < %s -march=mips64el -mcpu=mips64r2 | FileCheck %s -check-prefix=MIPS64

define i32 @bswap32(i32 %x) nounwind readnone {
entry:
; MIPS32: bswap32:
; MIPS32: wsbh $[[R0:[0-9]+]]
; MIPS32: rotr ${{[0-9]+}}, $[[R0]], 16
  %or.3 = call i32 @llvm.bswap.i32(i32 %x)
  ret i32 %or.3
}

define i64 @bswap64(i64 %x) nounwind readnone {
entry:
; MIPS64: bswap64:
; MIPS64: dsbh $[[R0:[0-9]+]]
; MIPS64: dshd ${{[0-9]+}}, $[[R0]]
  %or.7 = call i64 @llvm.bswap.i64(i64 %x)
  ret i64 %or.7
}

declare i32 @llvm.bswap.i32(i32) nounwind readnone

declare i64 @llvm.bswap.i64(i64) nounwind readnone