aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AVR/llrint.ll
blob: 2980879bb6e3ebb33c4ff47912278995658b3947 (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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=avr -mcpu=atmega328p | FileCheck %s

; FIXME: crash "Input type needs to be promoted!"
; define i64 @testmsxh_builtin(half %x) {
; entry:
;   %0 = tail call i64 @llvm.llrint.i64.f16(half %x)
;   ret i64 %0
; }

define i64 @testmsxs_builtin(float %x) {
; CHECK-LABEL: testmsxs_builtin:
; CHECK:       ; %bb.0: ; %entry
; CHECK-NEXT:    call llrintf
; CHECK-NEXT:    ret
entry:
  %0 = tail call i64 @llvm.llrint.i64.f32(float %x)
  ret i64 %0
}

define i64 @testmsxd_builtin(double %x) {
; CHECK-LABEL: testmsxd_builtin:
; CHECK:       ; %bb.0: ; %entry
; CHECK-NEXT:    call llrint
; CHECK-NEXT:    ret
entry:
  %0 = tail call i64 @llvm.llrint.i64.f64(double %x)
  ret i64 %0
}

; FIXME(#44744): incorrect libcall
define i64 @testmsxq_builtin(fp128 %x) {
; CHECK-LABEL: testmsxq_builtin:
; CHECK:       ; %bb.0: ; %entry
; CHECK-NEXT:    call llrintl
; CHECK-NEXT:    ret
entry:
  %0 = tail call i64 @llvm.llrint.i64.fp128(fp128 %x)
  ret i64 %0
}

declare i64 @llvm.llrint.i64.f32(float) nounwind readnone
declare i64 @llvm.llrint.i64.f64(double) nounwind readnone