| 1 |
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 |
|
| 3 |
; Tests for lrint and llrint, with both i32 and i64 checked. |
| 4 |
|
| 5 |
; RUN: sed 's/ITy/i32/g' %s | llc -mtriple=msp430-unknown-unknown | FileCheck %s --check-prefixes=CHECK |
| 6 |
; RUN: sed 's/ITy/i64/g' %s | llc -mtriple=msp430-unknown-unknown | FileCheck %s --check-prefixes=CHECK |
| 7 |
|
| 8 |
; FIXME: crash "Input type needs to be promoted!" |
| 9 |
; define ITy @test_lrint_ixx_f16(half %x) nounwind { |
| 10 |
; %res = tail call ITy @llvm.lrint.ITy.f16(half %x) |
| 11 |
; ret ITy %res |
| 12 |
; } |
| 13 |
|
| 14 |
; define ITy @test_llrint_ixx_f16(half %x) nounwind { |
| 15 |
; %res = tail call ITy @llvm.llrint.ITy.f16(half %x) |
| 16 |
; ret ITy %res |
| 17 |
; } |
| 18 |
|
| 19 |
define ITy @test_lrint_ixx_f32(float %x) nounwind { |
| 20 |
; CHECK-LABEL: test_lrint_ixx_f32: |
| 21 |
; CHECK: call #lrintf |
| 22 |
%res = tail call ITy @llvm.lrint.ITy.f32(float %x) |
| 23 |
ret ITy %res |
| 24 |
} |
| 25 |
|
| 26 |
define ITy @test_llrint_ixx_f32(float %x) nounwind { |
| 27 |
; CHECK-LABEL: test_llrint_ixx_f32: |
| 28 |
; CHECK: call #llrintf |
| 29 |
%res = tail call ITy @llvm.llrint.ITy.f32(float %x) |
| 30 |
ret ITy %res |
| 31 |
} |
| 32 |
|
| 33 |
define ITy @test_lrint_ixx_f64(double %x) nounwind { |
| 34 |
; CHECK-LABEL: test_lrint_ixx_f64: |
| 35 |
; CHECK: call #lrint |
| 36 |
%res = tail call ITy @llvm.lrint.ITy.f64(double %x) |
| 37 |
ret ITy %res |
| 38 |
} |
| 39 |
|
| 40 |
define ITy @test_llrint_ixx_f64(double %x) nounwind { |
| 41 |
; CHECK-LABEL: test_llrint_ixx_f64: |
| 42 |
; CHECK: call #llrint |
| 43 |
%res = tail call ITy @llvm.llrint.ITy.f64(double %x) |
| 44 |
ret ITy %res |
| 45 |
} |
| 46 |
|
| 47 |
; FIXME(#44744): incorrect libcall |
| 48 |
define ITy @test_lrint_ixx_f128(fp128 %x) nounwind { |
| 49 |
; CHECK-LABEL: test_lrint_ixx_f128: |
| 50 |
; CHECK: call #lrintl |
| 51 |
%res = tail call ITy @llvm.lrint.ITy.f128(fp128 %x) |
| 52 |
ret ITy %res |
| 53 |
} |
| 54 |
|
| 55 |
define ITy @test_llrint_ixx_f128(fp128 %x) nounwind { |
| 56 |
; CHECK-LABEL: test_llrint_ixx_f128: |
| 57 |
; CHECK: call #llrintl |
| 58 |
%res = tail call ITy @llvm.llrint.ITy.f128(fp128 %x) |
| 59 |
ret ITy %res |
| 60 |
} |