From 5e45051e0ee8917a88e84d799c5c90840d0c465b Mon Sep 17 00:00:00 2001 From: Venkatraman Govindaraju Date: Sun, 3 Nov 2013 08:00:19 +0000 Subject: [Sparc] Expand FP_TO_UINT, UINT_TO_FP for fp128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193947 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/SPARC/fp128.ll | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test') diff --git a/test/CodeGen/SPARC/fp128.ll b/test/CodeGen/SPARC/fp128.ll index 7820b76638..8049dbe98c 100644 --- a/test/CodeGen/SPARC/fp128.ll +++ b/test/CodeGen/SPARC/fp128.ll @@ -148,3 +148,35 @@ entry: store fp128 %2, fp128* %c, align 1 ret void } + +; HARD-LABEL: uint_to_f128 +; HARD: fdtoq + +; SOFT-LABEL: uint_to_f128 +; SOFT: _Q_utoq + +define void @uint_to_f128(fp128* noalias sret %scalar.result, i32 %i) { +entry: + %0 = uitofp i32 %i to fp128 + store fp128 %0, fp128* %scalar.result, align 8 + ret void +} + +; HARD-LABEL: f128_to_i32 +; HARD: fqtoi +; HARD: fqtoi + +; SOFT-LABEL: f128_to_i32 +; SOFT: call _Q_qtou +; SOFT: call _Q_qtoi + + +define i32 @f128_to_i32(fp128* %a, fp128* %b) { +entry: + %0 = load fp128* %a, align 8 + %1 = load fp128* %b, align 8 + %2 = fptoui fp128 %0 to i32 + %3 = fptosi fp128 %1 to i32 + %4 = add i32 %2, %3 + ret i32 %4 +} -- cgit v1.2.3