2015-04-30 17:57:37 +08:00
|
|
|
; RUN: llc -march=mips -mattr=+msa,+fp64 < %s | FileCheck -check-prefix=ALL %s
|
|
|
|
; RUN: llc -march=mipsel -mattr=+msa,+fp64 < %s | FileCheck -check-prefix=ALL %s
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
@v4f32 = global <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>
|
|
|
|
@v2f64 = global <2 x double> <double 0.0, double 0.0>
|
2014-04-29 21:31:37 +08:00
|
|
|
@i32 = global i32 0
|
2013-10-15 21:14:41 +08:00
|
|
|
@f32 = global float 0.0
|
|
|
|
@f64 = global double 0.0
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
define void @const_v4f32() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: const_v4f32:
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: ldi.b [[R1:\$w[0-9]+]], 0
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: lui [[R1:\$[0-9]+]], 16256
|
|
|
|
; ALL: fill.w [[R2:\$w[0-9]+]], [[R1]]
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 1.0, float 1.0, float 1.0, float 31.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.w [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 65537.0, float 65537.0, float 65537.0, float 65537.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: lui [[R1:\$[0-9]+]], 18304
|
|
|
|
; ALL: ori [[R2:\$[0-9]+]], [[R1]], 128
|
|
|
|
; ALL: fill.w [[R3:\$w[0-9]+]], [[R2]]
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 1.0, float 2.0, float 1.0, float 2.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.w [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <4 x float> <float 3.0, float 4.0, float 5.0, float 6.0>, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.w [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @const_v2f64() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: const_v2f64:
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 0.0, double 0.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: ldi.b [[R1:\$w[0-9]+]], 0
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 72340172838076673.0, double 72340172838076673.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 281479271743489.0, double 281479271743489.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 4294967297.0, double 4294967297.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 1.0, double 1.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 1.0, double 31.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
store volatile <2 x double> <double 3.0, double 4.0>, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: addiu [[G_PTR:\$[0-9]+]], {{.*}}, %lo($
|
|
|
|
; ALL: ld.d [[R1:\$w[0-9]+]], 0([[G_PTR]])
|
2013-09-23 20:02:46 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
2013-09-27 20:17:32 +08:00
|
|
|
|
2013-10-15 21:14:41 +08:00
|
|
|
define void @nonconst_v4f32() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: nonconst_v4f32:
|
2013-10-15 21:14:41 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load float , float *@f32
|
2013-10-15 21:14:41 +08:00
|
|
|
%2 = insertelement <4 x float> undef, float %1, i32 0
|
|
|
|
%3 = insertelement <4 x float> %2, float %1, i32 1
|
|
|
|
%4 = insertelement <4 x float> %3, float %1, i32 2
|
|
|
|
%5 = insertelement <4 x float> %4, float %1, i32 3
|
|
|
|
store volatile <4 x float> %5, <4 x float>*@v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: lwc1 $f[[R1:[0-9]+]], 0(
|
|
|
|
; ALL: splati.w [[R2:\$w[0-9]+]], $w[[R1]]
|
2013-10-15 21:14:41 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @nonconst_v2f64() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: nonconst_v2f64:
|
2013-10-15 21:14:41 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load double , double *@f64
|
2013-10-15 21:14:41 +08:00
|
|
|
%2 = insertelement <2 x double> undef, double %1, i32 0
|
|
|
|
%3 = insertelement <2 x double> %2, double %1, i32 1
|
|
|
|
store volatile <2 x double> %3, <2 x double>*@v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL: ldc1 $f[[R1:[0-9]+]], 0(
|
|
|
|
; ALL: splati.d [[R2:\$w[0-9]+]], $w[[R1]]
|
2013-10-15 21:14:41 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2013-09-27 20:17:32 +08:00
|
|
|
define float @extract_v4f32() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v4f32:
|
2013-09-27 20:17:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]],
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%2 = fadd <4 x float> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.w [[R2:\$w[0-9]+]], [[R1]], [[R1]]
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%3 = extractelement <4 x float> %2, i32 1
|
|
|
|
; Element 1 can be obtained by splatting it across the vector and extracting
|
|
|
|
; $w0:sub_lo
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: splati.w $w0, [[R1]][1]
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
ret float %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define float @extract_v4f32_elt0() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v4f32_elt0:
|
2013-09-27 20:17:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]],
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%2 = fadd <4 x float> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.w $w0, [[R1]], [[R1]]
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%3 = extractelement <4 x float> %2, i32 0
|
|
|
|
; Element 0 can be obtained by extracting $w0:sub_lo ($f0)
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-NOT: copy_u.w
|
|
|
|
; ALL-NOT: mtc1
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
ret float %3
|
|
|
|
}
|
|
|
|
|
2014-03-04 21:54:30 +08:00
|
|
|
define float @extract_v4f32_elt2() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v4f32_elt2:
|
2014-03-04 21:54:30 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]],
|
2014-03-04 21:54:30 +08:00
|
|
|
|
|
|
|
%2 = fadd <4 x float> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.w [[R2:\$w[0-9]+]], [[R1]], [[R1]]
|
2014-03-04 21:54:30 +08:00
|
|
|
|
|
|
|
%3 = extractelement <4 x float> %2, i32 2
|
|
|
|
; Element 2 can be obtained by splatting it across the vector and extracting
|
|
|
|
; $w0:sub_lo
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: splati.w $w0, [[R1]][2]
|
2014-03-04 21:54:30 +08:00
|
|
|
|
|
|
|
ret float %3
|
|
|
|
}
|
|
|
|
|
2014-04-29 21:31:37 +08:00
|
|
|
define float @extract_v4f32_vidx() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v4f32_vidx:
|
2014-04-29 21:31:37 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_V:\$[0-9]+]], %got(v4f32)(
|
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]], 0([[PTR_V]])
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
%2 = fadd <4 x float> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.w [[R2:\$w[0-9]+]], [[R1]], [[R1]]
|
2014-04-29 21:31:37 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%3 = load i32, i32* @i32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_I:\$[0-9]+]], %got(i32)(
|
|
|
|
; ALL-DAG: lw [[IDX:\$[0-9]+]], 0([[PTR_I]])
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
%4 = extractelement <4 x float> %2, i32 %3
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: splat.w $w0, [[R1]]{{\[}}[[IDX]]]
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
ret float %4
|
|
|
|
}
|
|
|
|
|
2013-09-27 20:17:32 +08:00
|
|
|
define double @extract_v2f64() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v2f64:
|
2013-09-27 20:17:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <2 x double>, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.d [[R1:\$w[0-9]+]],
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%2 = fadd <2 x double> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.d [[R2:\$w[0-9]+]], [[R1]], [[R1]]
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%3 = extractelement <2 x double> %2, i32 1
|
|
|
|
; Element 1 can be obtained by splatting it across the vector and extracting
|
|
|
|
; $w0:sub_64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: splati.d $w0, [[R1]][1]
|
|
|
|
; ALL-NOT: copy_u.w
|
|
|
|
; ALL-NOT: mtc1
|
|
|
|
; ALL-NOT: mthc1
|
|
|
|
; ALL-NOT: sll
|
|
|
|
; ALL-NOT: sra
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
ret double %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define double @extract_v2f64_elt0() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v2f64_elt0:
|
2013-09-27 20:17:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <2 x double>, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.d [[R1:\$w[0-9]+]],
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%2 = fadd <2 x double> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.d $w0, [[R1]], [[R1]]
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
%3 = extractelement <2 x double> %2, i32 0
|
|
|
|
; Element 0 can be obtained by extracting $w0:sub_64 ($f0)
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-NOT: copy_u.w
|
|
|
|
; ALL-NOT: mtc1
|
|
|
|
; ALL-NOT: mthc1
|
|
|
|
; ALL-NOT: sll
|
|
|
|
; ALL-NOT: sra
|
2013-09-27 20:17:32 +08:00
|
|
|
|
|
|
|
ret double %3
|
|
|
|
}
|
2013-09-27 20:31:32 +08:00
|
|
|
|
2014-04-29 21:31:37 +08:00
|
|
|
define double @extract_v2f64_vidx() nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: extract_v2f64_vidx:
|
2014-04-29 21:31:37 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <2 x double>, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_V:\$[0-9]+]], %got(v2f64)(
|
|
|
|
; ALL-DAG: ld.d [[R1:\$w[0-9]+]], 0([[PTR_V]])
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
%2 = fadd <2 x double> %1, %1
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: fadd.d [[R2:\$w[0-9]+]], [[R1]], [[R1]]
|
2014-04-29 21:31:37 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%3 = load i32, i32* @i32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_I:\$[0-9]+]], %got(i32)(
|
|
|
|
; ALL-DAG: lw [[IDX:\$[0-9]+]], 0([[PTR_I]])
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
%4 = extractelement <2 x double> %2, i32 %3
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: splat.d $w0, [[R1]]{{\[}}[[IDX]]]
|
2014-04-29 21:31:37 +08:00
|
|
|
|
|
|
|
ret double %4
|
|
|
|
}
|
|
|
|
|
2013-09-27 20:31:32 +08:00
|
|
|
define void @insert_v4f32(float %a) nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: insert_v4f32:
|
2013-09-27 20:31:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]],
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
%2 = insertelement <4 x float> %1, float %a, i32 1
|
|
|
|
; float argument passed in $f12
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: insve.w [[R1]][1], $w12[0]
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
store <4 x float> %2, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: st.w [[R1]]
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @insert_v2f64(double %a) nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: insert_v2f64:
|
2013-09-27 20:31:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <2 x double>, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: ld.d [[R1:\$w[0-9]+]],
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
%2 = insertelement <2 x double> %1, double %a, i32 1
|
|
|
|
; double argument passed in $f12
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: insve.d [[R1]][1], $w12[0]
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
store <2 x double> %2, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: st.d [[R1]]
|
2013-09-27 20:31:32 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
define void @insert_v4f32_vidx(float %a) nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: insert_v4f32_vidx:
|
2014-04-30 20:09:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <4 x float>, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_V:\$[0-9]+]], %got(v4f32)(
|
|
|
|
; ALL-DAG: ld.w [[R1:\$w[0-9]+]], 0([[PTR_V]])
|
2014-04-30 20:09:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load i32, i32* @i32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_I:\$[0-9]+]], %got(i32)(
|
|
|
|
; ALL-DAG: lw [[IDX:\$[0-9]+]], 0([[PTR_I]])
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
%3 = insertelement <4 x float> %1, float %a, i32 %2
|
|
|
|
; float argument passed in $f12
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: sll [[BIDX:\$[0-9]+]], [[IDX]], 2
|
|
|
|
; ALL-DAG: sld.b [[R1]], [[R1]]{{\[}}[[BIDX]]]
|
|
|
|
; ALL-DAG: insve.w [[R1]][0], $w12[0]
|
|
|
|
; ALL-DAG: neg [[NIDX:\$[0-9]+]], [[BIDX]]
|
|
|
|
; ALL-DAG: sld.b [[R1]], [[R1]]{{\[}}[[NIDX]]]
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
store <4 x float> %3, <4 x float>* @v4f32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: st.w [[R1]]
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @insert_v2f64_vidx(double %a) nounwind {
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-LABEL: insert_v2f64_vidx:
|
2014-04-30 20:09:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%1 = load <2 x double>, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_V:\$[0-9]+]], %got(v2f64)(
|
|
|
|
; ALL-DAG: ld.d [[R1:\$w[0-9]+]], 0([[PTR_V]])
|
2014-04-30 20:09:32 +08:00
|
|
|
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load i32, i32* @i32
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: lw [[PTR_I:\$[0-9]+]], %got(i32)(
|
|
|
|
; ALL-DAG: lw [[IDX:\$[0-9]+]], 0([[PTR_I]])
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
%3 = insertelement <2 x double> %1, double %a, i32 %2
|
|
|
|
; double argument passed in $f12
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: sll [[BIDX:\$[0-9]+]], [[IDX]], 3
|
|
|
|
; ALL-DAG: sld.b [[R1]], [[R1]]{{\[}}[[BIDX]]]
|
|
|
|
; ALL-DAG: insve.d [[R1]][0], $w12[0]
|
|
|
|
; ALL-DAG: neg [[NIDX:\$[0-9]+]], [[BIDX]]
|
|
|
|
; ALL-DAG: sld.b [[R1]], [[R1]]{{\[}}[[NIDX]]]
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
store <2 x double> %3, <2 x double>* @v2f64
|
2015-04-30 17:57:37 +08:00
|
|
|
; ALL-DAG: st.d [[R1]]
|
2014-04-30 20:09:32 +08:00
|
|
|
|
|
|
|
ret void
|
|
|
|
}
|