diff options
| author | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-10-11 10:00:06 +0000 |
|---|---|---|
| committer | Daniel Sanders <daniel.sanders@imgtec.com> | 2013-10-11 10:00:06 +0000 |
| commit | 015972bd95faa7f1fd3925d8593bfe58ebcde967 (patch) | |
| tree | 022f3384412b2dfc02363569a9d619a570ecc46d /llvm/test/CodeGen/Mips/msa | |
| parent | 9d8385453b896e06fb621993c0dcf5e248aa25b9 (diff) | |
| download | bcm5719-llvm-015972bd95faa7f1fd3925d8593bfe58ebcde967.tar.gz bcm5719-llvm-015972bd95faa7f1fd3925d8593bfe58ebcde967.zip | |
[mips][msa] Added support for matching ffint_[us].[wd], and ftrunc_[us].[wd] from normal IR (i.e. not intrinsics)
llvm-svn: 192429
Diffstat (limited to 'llvm/test/CodeGen/Mips/msa')
| -rw-r--r-- | llvm/test/CodeGen/Mips/msa/arithmetic_float.ll | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Mips/msa/arithmetic_float.ll b/llvm/test/CodeGen/Mips/msa/arithmetic_float.ll index 0c106f826de..82e05ad8f90 100644 --- a/llvm/test/CodeGen/Mips/msa/arithmetic_float.ll +++ b/llvm/test/CodeGen/Mips/msa/arithmetic_float.ll @@ -184,6 +184,118 @@ define void @fsqrt_v2f64(<2 x double>* %c, <2 x double>* %a) nounwind { ; CHECK: .size fsqrt_v2f64 } +define void @ffint_u_v4f32(<4 x float>* %c, <4 x i32>* %a) nounwind { + ; CHECK: ffint_u_v4f32: + + %1 = load <4 x i32>* %a + ; CHECK-DAG: ld.w [[R1:\$w[0-9]+]], 0($5) + %2 = uitofp <4 x i32> %1 to <4 x float> + ; CHECK-DAG: ffint_u.w [[R3:\$w[0-9]+]], [[R1]] + store <4 x float> %2, <4 x float>* %c + ; CHECK-DAG: st.w [[R3]], 0($4) + + ret void + ; CHECK: .size ffint_u_v4f32 +} + +define void @ffint_u_v2f64(<2 x double>* %c, <2 x i64>* %a) nounwind { + ; CHECK: ffint_u_v2f64: + + %1 = load <2 x i64>* %a + ; CHECK-DAG: ld.d [[R1:\$w[0-9]+]], 0($5) + %2 = uitofp <2 x i64> %1 to <2 x double> + ; CHECK-DAG: ffint_u.d [[R3:\$w[0-9]+]], [[R1]] + store <2 x double> %2, <2 x double>* %c + ; CHECK-DAG: st.d [[R3]], 0($4) + + ret void + ; CHECK: .size ffint_u_v2f64 +} + +define void @ffint_s_v4f32(<4 x float>* %c, <4 x i32>* %a) nounwind { + ; CHECK: ffint_s_v4f32: + + %1 = load <4 x i32>* %a + ; CHECK-DAG: ld.w [[R1:\$w[0-9]+]], 0($5) + %2 = sitofp <4 x i32> %1 to <4 x float> + ; CHECK-DAG: ffint_s.w [[R3:\$w[0-9]+]], [[R1]] + store <4 x float> %2, <4 x float>* %c + ; CHECK-DAG: st.w [[R3]], 0($4) + + ret void + ; CHECK: .size ffint_s_v4f32 +} + +define void @ffint_s_v2f64(<2 x double>* %c, <2 x i64>* %a) nounwind { + ; CHECK: ffint_s_v2f64: + + %1 = load <2 x i64>* %a + ; CHECK-DAG: ld.d [[R1:\$w[0-9]+]], 0($5) + %2 = sitofp <2 x i64> %1 to <2 x double> + ; CHECK-DAG: ffint_s.d [[R3:\$w[0-9]+]], [[R1]] + store <2 x double> %2, <2 x double>* %c + ; CHECK-DAG: st.d [[R3]], 0($4) + + ret void + ; CHECK: .size ffint_s_v2f64 +} + +define void @ftrunc_u_v4f32(<4 x i32>* %c, <4 x float>* %a) nounwind { + ; CHECK: ftrunc_u_v4f32: + + %1 = load <4 x float>* %a + ; CHECK-DAG: ld.w [[R1:\$w[0-9]+]], 0($5) + %2 = fptoui <4 x float> %1 to <4 x i32> + ; CHECK-DAG: ftrunc_u.w [[R3:\$w[0-9]+]], [[R1]] + store <4 x i32> %2, <4 x i32>* %c + ; CHECK-DAG: st.w [[R3]], 0($4) + + ret void + ; CHECK: .size ftrunc_u_v4f32 +} + +define void @ftrunc_u_v2f64(<2 x i64>* %c, <2 x double>* %a) nounwind { + ; CHECK: ftrunc_u_v2f64: + + %1 = load <2 x double>* %a + ; CHECK-DAG: ld.d [[R1:\$w[0-9]+]], 0($5) + %2 = fptoui <2 x double> %1 to <2 x i64> + ; CHECK-DAG: ftrunc_u.d [[R3:\$w[0-9]+]], [[R1]] + store <2 x i64> %2, <2 x i64>* %c + ; CHECK-DAG: st.d [[R3]], 0($4) + + ret void + ; CHECK: .size ftrunc_u_v2f64 +} + +define void @ftrunc_s_v4f32(<4 x i32>* %c, <4 x float>* %a) nounwind { + ; CHECK: ftrunc_s_v4f32: + + %1 = load <4 x float>* %a + ; CHECK-DAG: ld.w [[R1:\$w[0-9]+]], 0($5) + %2 = fptosi <4 x float> %1 to <4 x i32> + ; CHECK-DAG: ftrunc_s.w [[R3:\$w[0-9]+]], [[R1]] + store <4 x i32> %2, <4 x i32>* %c + ; CHECK-DAG: st.w [[R3]], 0($4) + + ret void + ; CHECK: .size ftrunc_s_v4f32 +} + +define void @ftrunc_s_v2f64(<2 x i64>* %c, <2 x double>* %a) nounwind { + ; CHECK: ftrunc_s_v2f64: + + %1 = load <2 x double>* %a + ; CHECK-DAG: ld.d [[R1:\$w[0-9]+]], 0($5) + %2 = fptosi <2 x double> %1 to <2 x i64> + ; CHECK-DAG: ftrunc_s.d [[R3:\$w[0-9]+]], [[R1]] + store <2 x i64> %2, <2 x i64>* %c + ; CHECK-DAG: st.d [[R3]], 0($4) + + ret void + ; CHECK: .size ftrunc_s_v2f64 +} + declare <4 x float> @llvm.fabs.v4f32(<4 x float> %Val) declare <2 x double> @llvm.fabs.v2f64(<2 x double> %Val) declare <4 x float> @llvm.sqrt.v4f32(<4 x float> %Val) |

