|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 |
| 2 | +; RUN: llc --mtriple=loongarch32 -mattr=+32s,+lasx < %s | FileCheck %s |
| 3 | +; RUN: llc --mtriple=loongarch64 -mattr=+lasx < %s | FileCheck %s |
| 4 | + |
| 5 | +define <8 x float> @fadd_elt0_v8f32(float %a) nounwind { |
| 6 | +; CHECK-LABEL: fadd_elt0_v8f32: |
| 7 | +; CHECK: # %bb.0: # %entry |
| 8 | +; CHECK-NEXT: # kill: def $f0 killed $f0 def $xr0 |
| 9 | +; CHECK-NEXT: xvldi $xr1, -1424 |
| 10 | +; CHECK-NEXT: xvfadd.s $xr0, $xr0, $xr1 |
| 11 | +; CHECK-NEXT: ret |
| 12 | +entry: |
| 13 | + %b = insertelement <8 x float> poison, float %a, i32 0 |
| 14 | + %c = fadd <8 x float> %b, <float 1.0, float poison, float poison, float poison, float poison, float poison, float poison, float poison> |
| 15 | + ret <8 x float> %c |
| 16 | +} |
| 17 | + |
| 18 | +define <4 x double> @fadd_elt0_v4f64(double %a) nounwind { |
| 19 | +; CHECK-LABEL: fadd_elt0_v4f64: |
| 20 | +; CHECK: # %bb.0: # %entry |
| 21 | +; CHECK-NEXT: # kill: def $f0_64 killed $f0_64 def $xr0 |
| 22 | +; CHECK-NEXT: xvldi $xr1, -912 |
| 23 | +; CHECK-NEXT: xvfadd.d $xr0, $xr0, $xr1 |
| 24 | +; CHECK-NEXT: ret |
| 25 | +entry: |
| 26 | + %b = insertelement <4 x double> poison, double %a, i32 0 |
| 27 | + %c = fadd <4 x double> %b, <double 1.0, double poison, double poison, double poison> |
| 28 | + ret <4 x double> %c |
| 29 | +} |
| 30 | + |
| 31 | +define <8 x float> @fsub_splat_v8f32(float %a, float %b) nounwind { |
| 32 | +; CHECK-LABEL: fsub_splat_v8f32: |
| 33 | +; CHECK: # %bb.0: # %entry |
| 34 | +; CHECK-NEXT: # kill: def $f1 killed $f1 def $vr1 |
| 35 | +; CHECK-NEXT: # kill: def $f0 killed $f0 def $vr0 |
| 36 | +; CHECK-NEXT: vfsub.s $vr0, $vr0, $vr1 |
| 37 | +; CHECK-NEXT: xvpermi.d $xr0, $xr0, 68 |
| 38 | +; CHECK-NEXT: xvrepl128vei.w $xr0, $xr0, 0 |
| 39 | +; CHECK-NEXT: ret |
| 40 | +entry: |
| 41 | + %insa = insertelement <8 x float> poison, float %a, i32 0 |
| 42 | + %insb = insertelement <8 x float> poison, float %b, i32 0 |
| 43 | + %va = shufflevector <8 x float> %insa, <8 x float> poison, <8 x i32> zeroinitializer |
| 44 | + %vb = shufflevector <8 x float> %insb, <8 x float> poison, <8 x i32> zeroinitializer |
| 45 | + %c = fsub <8 x float> %va, %vb |
| 46 | + ret <8 x float> %c |
| 47 | +} |
| 48 | + |
| 49 | +define <4 x double> @fsub_splat_v4f64(double %a) nounwind { |
| 50 | +; CHECK-LABEL: fsub_splat_v4f64: |
| 51 | +; CHECK: # %bb.0: # %entry |
| 52 | +; CHECK-NEXT: # kill: def $f0_64 killed $f0_64 def $xr0 |
| 53 | +; CHECK-NEXT: xvldi $xr1, -784 |
| 54 | +; CHECK-NEXT: xvfadd.d $xr0, $xr0, $xr1 |
| 55 | +; CHECK-NEXT: xvpermi.d $xr0, $xr0, 0 |
| 56 | +; CHECK-NEXT: ret |
| 57 | +entry: |
| 58 | + %insa = insertelement <4 x double> poison, double %a, i32 0 |
| 59 | + %insb = insertelement <4 x double> poison, double 1.0, i32 0 |
| 60 | + %va = shufflevector <4 x double> %insa, <4 x double> poison, <4 x i32> zeroinitializer |
| 61 | + %vb = shufflevector <4 x double> %insb, <4 x double> poison, <4 x i32> zeroinitializer |
| 62 | + %c = fsub <4 x double> %va, %vb |
| 63 | + ret <4 x double> %c |
| 64 | +} |
0 commit comments