|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 |
| 2 | +; RUN: llc -start-before=codegenprepare -mtriple=aarch64-gnu-linux -mattr=+neon,+sve \ |
| 3 | +; RUN: -vector-library=ArmPL < %s | FileCheck %s -check-prefix=ARMPL |
| 4 | + |
| 5 | +define <4 x float> @test_pow_v4f32(<4 x float> %x, <4 x float> %y) nounwind { |
| 6 | +; ARMPL-LABEL: test_pow_v4f32: |
| 7 | +; ARMPL: // %bb.0: |
| 8 | +; ARMPL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill |
| 9 | +; ARMPL-NEXT: bl armpl_vpowq_f32 |
| 10 | +; ARMPL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload |
| 11 | +; ARMPL-NEXT: ret |
| 12 | + %result = call <4 x float> @llvm.pow.v4f32(<4 x float> %x, <4 x float> %y) |
| 13 | + ret <4 x float> %result |
| 14 | +} |
| 15 | + |
| 16 | +define <2 x double> @test_pow_v2f64(<2 x double> %x, <2 x double> %y) nounwind { |
| 17 | +; ARMPL-LABEL: test_pow_v2f64: |
| 18 | +; ARMPL: // %bb.0: |
| 19 | +; ARMPL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill |
| 20 | +; ARMPL-NEXT: bl armpl_vpowq_f64 |
| 21 | +; ARMPL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload |
| 22 | +; ARMPL-NEXT: ret |
| 23 | + %result = call <2 x double> @llvm.pow.v2f64(<2 x double> %x, <2 x double> %y) |
| 24 | + ret <2 x double> %result |
| 25 | +} |
| 26 | + |
| 27 | +define <vscale x 4 x float> @test_pow_nxv4f32(<vscale x 4 x float> %x, <vscale x 4 x float> %y) nounwind { |
| 28 | +; ARMPL-LABEL: test_pow_nxv4f32: |
| 29 | +; ARMPL: // %bb.0: |
| 30 | +; ARMPL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill |
| 31 | +; ARMPL-NEXT: ptrue p0.s |
| 32 | +; ARMPL-NEXT: bl armpl_svpow_f32_x |
| 33 | +; ARMPL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload |
| 34 | +; ARMPL-NEXT: ret |
| 35 | + %result = call <vscale x 4 x float> @llvm.pow.nxv4f32(<vscale x 4 x float> %x, <vscale x 4 x float> %y) |
| 36 | + ret <vscale x 4 x float> %result |
| 37 | +} |
| 38 | + |
| 39 | +define <vscale x 2 x double> @test_pow_nxv2f64(<vscale x 2 x double> %x, <vscale x 2 x double> %y) nounwind { |
| 40 | +; ARMPL-LABEL: test_pow_nxv2f64: |
| 41 | +; ARMPL: // %bb.0: |
| 42 | +; ARMPL-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill |
| 43 | +; ARMPL-NEXT: ptrue p0.d |
| 44 | +; ARMPL-NEXT: bl armpl_svpow_f64_x |
| 45 | +; ARMPL-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload |
| 46 | +; ARMPL-NEXT: ret |
| 47 | + %result = call <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %x, <vscale x 2 x double> %y) |
| 48 | + ret <vscale x 2 x double> %result |
| 49 | +} |
| 50 | + |
| 51 | +define <4 x float> @test_pow_v4f32_025(<4 x float> %x) nounwind { |
| 52 | +; ARMPL-LABEL: test_pow_v4f32_025: |
| 53 | +; ARMPL: // %bb.0: |
| 54 | +; ARMPL-NEXT: fsqrt v0.4s, v0.4s |
| 55 | +; ARMPL-NEXT: fsqrt v0.4s, v0.4s |
| 56 | +; ARMPL-NEXT: ret |
| 57 | + %result = call fast <4 x float> @llvm.pow.v4f32(<4 x float> %x, <4 x float> splat (float 2.5e-01)) |
| 58 | + ret <4 x float> %result |
| 59 | +} |
| 60 | + |
| 61 | +define <vscale x 2 x double> @test_pow_nxv2f64_075(<vscale x 2 x double> %x) nounwind { |
| 62 | +; ARMPL-LABEL: test_pow_nxv2f64_075: |
| 63 | +; ARMPL: // %bb.0: |
| 64 | +; ARMPL-NEXT: ptrue p0.d |
| 65 | +; ARMPL-NEXT: fsqrt z0.d, p0/m, z0.d |
| 66 | +; ARMPL-NEXT: movprfx z1, z0 |
| 67 | +; ARMPL-NEXT: fsqrt z1.d, p0/m, z0.d |
| 68 | +; ARMPL-NEXT: fmul z0.d, z0.d, z1.d |
| 69 | +; ARMPL-NEXT: ret |
| 70 | + %result = call fast <vscale x 2 x double> @llvm.pow.nxv2f64(<vscale x 2 x double> %x, <vscale x 2 x double> splat (double 7.5e-01)) |
| 71 | + ret <vscale x 2 x double> %result |
| 72 | +} |
0 commit comments