59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 62; RUN: llc --mtriple=loongarch32 -mattr=+32s,+lsx < %s | FileCheck %s3; RUN: llc --mtriple=loongarch64 -mattr=+lsx < %s | FileCheck %s4 5define <4 x float> @fadd_elt0_v4f32(float %a) nounwind {6; CHECK-LABEL: fadd_elt0_v4f32:7; CHECK: # %bb.0: # %entry8; CHECK-NEXT: vldi $vr1, -11689; CHECK-NEXT: fadd.s $fa0, $fa0, $fa110; CHECK-NEXT: ret11entry:12 %b = insertelement <4 x float> poison, float %a, i32 013 %c = fadd <4 x float> %b, <float 1.0, float poison, float poison, float poison>14 ret <4 x float> %c15}16 17define <2 x double> @fadd_elt0_v2f64(double %a) nounwind {18; CHECK-LABEL: fadd_elt0_v2f64:19; CHECK: # %bb.0: # %entry20; CHECK-NEXT: vldi $vr1, -91221; CHECK-NEXT: fadd.d $fa0, $fa0, $fa122; CHECK-NEXT: ret23entry:24 %b = insertelement <2 x double> poison, double %a, i32 025 %c = fadd <2 x double> %b, <double 1.0, double poison>26 ret <2 x double> %c27}28 29define <4 x float> @fsub_splat_v4f32(float %b) nounwind {30; CHECK-LABEL: fsub_splat_v4f32:31; CHECK: # %bb.0: # %entry32; CHECK-NEXT: vldi $vr1, -116833; CHECK-NEXT: fsub.s $fa0, $fa1, $fa034; CHECK-NEXT: vreplvei.w $vr0, $vr0, 035; CHECK-NEXT: ret36entry:37 %insa = insertelement <4 x float> poison, float 1.0, i32 038 %insb = insertelement <4 x float> poison, float %b, i32 039 %va = shufflevector <4 x float> %insa, <4 x float> poison, <4 x i32> zeroinitializer40 %vb = shufflevector <4 x float> %insb, <4 x float> poison, <4 x i32> zeroinitializer41 %c = fsub <4 x float> %va, %vb42 ret <4 x float> %c43}44 45define <2 x double> @fsub_splat_v2f64(double %a, double %b) nounwind {46; CHECK-LABEL: fsub_splat_v2f64:47; CHECK: # %bb.0: # %entry48; CHECK-NEXT: fsub.d $fa0, $fa0, $fa149; CHECK-NEXT: vreplvei.d $vr0, $vr0, 050; CHECK-NEXT: ret51entry:52 %insa = insertelement <2 x double> poison, double %a, i32 053 %insb = insertelement <2 x double> poison, double %b, i32 054 %va = shufflevector <2 x double> %insa, <2 x double> poison, <2 x i32> zeroinitializer55 %vb = shufflevector <2 x double> %insb, <2 x double> poison, <2 x i32> zeroinitializer56 %c = fsub <2 x double> %va, %vb57 ret <2 x double> %c58}59