blob: 2735d787432d44440591b68b677695f1d8e6de8e [file] [log] [blame]
Akira Hatanaka252f54f2013-05-16 21:17:15 +00001; RUN: llc -march=mipsel < %s | FileCheck %s -check-prefix=32
Daniel Sanders1d3ae272014-04-14 16:00:28 +00002; RUN: llc -march=mips64el -mcpu=mips4 < %s | FileCheck %s -check-prefix=64
Akira Hatanaka252f54f2013-05-16 21:17:15 +00003; RUN: llc -march=mips64el -mcpu=mips64 < %s | FileCheck %s -check-prefix=64
4
5@gint_ = external global i32
6@gLL_ = external global i64
7
Stephen Lind24ab202013-07-14 06:24:09 +00008; 32-LABEL: store_int_float_:
Akira Hatanaka252f54f2013-05-16 21:17:15 +00009; 32: trunc.w.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
10; 32: swc1 $f[[R0]],
11
12define void @store_int_float_(float %a) {
13entry:
14 %conv = fptosi float %a to i32
15 store i32 %conv, i32* @gint_, align 4
16 ret void
17}
18
Stephen Lind24ab202013-07-14 06:24:09 +000019; 32-LABEL: store_int_double_:
Akira Hatanaka252f54f2013-05-16 21:17:15 +000020; 32: trunc.w.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
21; 32: swc1 $f[[R0]],
Stephen Lind24ab202013-07-14 06:24:09 +000022; 64-LABEL: store_int_double_:
Akira Hatanaka252f54f2013-05-16 21:17:15 +000023; 64: trunc.w.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
24; 64: swc1 $f[[R0]],
25
26define void @store_int_double_(double %a) {
27entry:
28 %conv = fptosi double %a to i32
29 store i32 %conv, i32* @gint_, align 4
30 ret void
31}
32
Stephen Lind24ab202013-07-14 06:24:09 +000033; 64-LABEL: store_LL_float_:
Akira Hatanaka252f54f2013-05-16 21:17:15 +000034; 64: trunc.l.s $f[[R0:[0-9]+]], $f{{[0-9]+}}
35; 64: sdc1 $f[[R0]],
36
37define void @store_LL_float_(float %a) {
38entry:
39 %conv = fptosi float %a to i64
40 store i64 %conv, i64* @gLL_, align 8
41 ret void
42}
43
Stephen Lind24ab202013-07-14 06:24:09 +000044; 64-LABEL: store_LL_double_:
Akira Hatanaka252f54f2013-05-16 21:17:15 +000045; 64: trunc.l.d $f[[R0:[0-9]+]], $f{{[0-9]+}}
46; 64: sdc1 $f[[R0]],
47
48define void @store_LL_double_(double %a) {
49entry:
50 %conv = fptosi double %a to i64
51 store i64 %conv, i64* @gLL_, align 8
52 ret void
53}