llvm.org GIT mirror llvm / a08b9a1
[AArch64] Add vmulxh_lane fp16 vector intrinsic https://reviews.llvm.org/D44591 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328035 91177308-0d34-0410-b5e6-96231b3b80d8 Abderrazek Zaafrani 2 years ago
1 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+fullfp16 | FileCheck %s
11
2 declare half @llvm.aarch64.neon.fmulx.f16(half, half)
23 declare <4 x half> @llvm.aarch64.neon.fmulx.v4f16(<4 x half>, <4 x half>)
34 declare <8 x half> @llvm.aarch64.neon.fmulx.v8f16(<8 x half>, <8 x half>)
45 declare <4 x half> @llvm.fma.v4f16(<4 x half>, <4 x half>, <4 x half>)
235236 ret half %1
236237 }
237238
239 define dso_local half @t_vmulx_f16(half %a, half %b) {
240 ; CHECK-LABEL: t_vmulx_f16:
241 ; CHECK: fmulx h0, h0, h1
242 ; CHECK-NEXT: ret
243 entry:
244 %fmulx.i = tail call half @llvm.aarch64.neon.fmulx.f16(half %a, half %b)
245 ret half %fmulx.i
246 }
247
248 define dso_local half @t_vmulxh_lane_f16(half %a, <4 x half> %b, i32 %lane) {
249 ; CHECK-LABEL: t_vmulxh_lane_f16:
250 ; CHECK: fmulx h0, h0, v1.h[3]
251 ; CHECK-NEXT: ret
252 entry:
253 %extract = extractelement <4 x half> %b, i32 3
254 %fmulx.i = tail call half @llvm.aarch64.neon.fmulx.f16(half %a, half %extract)
255 ret half %fmulx.i
256 }
257
238258 define dso_local <4 x half> @t_vmulx_lane_f16(<4 x half> %a, <4 x half> %b, i32 %lane) {
239259 ; CHECK-LABEL: t_vmulx_lane_f16:
240260 ; CHECK: fmulx v0.4h, v0.4h, v1.h[0]
273293 %shuffle = shufflevector <8 x half> %b, <8 x half> undef, <8 x i32> zeroinitializer
274294 %vmulx2.i = tail call <8 x half> @llvm.aarch64.neon.fmulx.v8f16(<8 x half> %a, <8 x half> %shuffle) #4
275295 ret <8 x half> %vmulx2.i
296 }
297
298 define dso_local half @t_vmulxh_laneq_f16(half %a, <8 x half> %b, i32 %lane) {
299 ; CHECK-LABEL: t_vmulxh_laneq_f16:
300 ; CHECK: fmulx h0, h0, v1.h[7]
301 ; CHECK-NEXT: ret
302 entry:
303 %extract = extractelement <8 x half> %b, i32 7
304 %fmulx.i = tail call half @llvm.aarch64.neon.fmulx.f16(half %a, half %extract)
305 ret half %fmulx.i
276306 }
277307
278308 define dso_local <4 x half> @t_vmulx_n_f16(<4 x half> %a, half %c) {