aboutsummaryrefslogtreecommitdiff
blob: 14bf7888918e5be33241a4007f2d704643ab9450 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: llc -mtriple=aarch64-none-linux-gnu %s -o - | FileCheck %s

define void @func_02(i32 %rm) {
  call void @llvm.set.rounding(i32 %rm)
  ret void
}

; CHECK-LABEL: func_02:
; CHECK:       sub   w9, w0, #1
; CHECK:       mrs   x8, FPCR
; CHECK:       and   w9, w9, #0x3
; CHECK:       and   x8, x8, #0xffffffffff3fffff
; CHECK:       lsl   w9, w9, #22
; CHECK:       orr   x8, x8, x9
; CHECK:       msr   FPCR, x8
; CHECK:       ret


define void @func_03() {
  call void @llvm.set.rounding(i32 0)
  ret void
}

; CHECK-LABEL: func_03
; CHECK:       mrs   x8, FPCR
; CHECK:       orr   x8, x8, #0xc00000
; CHECK:       msr   FPCR, x8
; CHECK:       ret


define void @func_04() {
  call void @llvm.set.rounding(i32 1)
  ret void
}

; CHECK-LABEL: func_04
; CHECK:       mrs   x8, FPCR
; CHECK:       and   x8, x8, #0xffffffffff3fffff
; CHECK:       msr   FPCR, x8
; CHECK:       ret


define void @func_05() {
  call void @llvm.set.rounding(i32 2)
  ret void
}


; CHECK-LABEL: func_05
; CHECK:       mrs   x8, FPCR
; CHECK:       and   x8, x8, #0xffffffffff3fffff
; CHECK:       orr   x8, x8, #0x400000
; CHECK:       msr   FPCR, x8
; CHECK:       ret


define void @func_06() {
  call void @llvm.set.rounding(i32 3)
  ret void
}

; CHECK-LABEL: func_06
; CHECK:       mrs   x8, FPCR
; CHECK:       and   x8, x8, #0xffffffffff3fffff
; CHECK:       orr   x8, x8, #0x800000
; CHECK:       msr   FPCR, x8
; CHECK:       ret


declare void @llvm.set.rounding(i32)