File: fp16_intrinsic_scalar_3op.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (92 lines) | stat: -rw-r--r-- 2,461 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
; RUN: llc < %s -mtriple=aarch64-eabi -mattr=+v8.2a,+neon,+fullfp16  | FileCheck %s

define dso_local half @t_vfmah_f16(half %a, half %b, half %c) {
; CHECK-LABEL: t_vfmah_f16:
; CHECK:         fmadd h0, h1, h2, h0
; CHECK-NEXT:    ret
entry:
  %0 = tail call half @llvm.fma.f16(half %b, half %c, half %a)
  ret half %0
}

define half @fnma16(half %a, half %b, half %c) nounwind readnone ssp {
; CHECK-LABEL: fnma16:
; CHECK: fnmadd h0, h0, h1, h2
entry:
  %0 = tail call half @llvm.fma.f16(half %a, half %b, half %c)
  %mul = fmul half %0, -1.000000e+00
  ret half %mul
}

define half @fms16(half %a, half %b, half %c) nounwind readnone ssp {
; CHECK-LABEL: fms16:
; CHECK: fmsub h0, h0, h1, h2
entry:
  %mul = fneg half %b
  %0 = tail call half @llvm.fma.f16(half %a, half %mul, half %c)
  ret half %0
}

define half @fms16_com(half %a, half %b, half %c) nounwind readnone ssp {
; CHECK-LABEL: fms16_com:
; CHECK:       fmsub h0, h1, h0, h2
; CHECK-NEXT:  ret
entry:
  %mul = fneg half %b
  %0 = tail call half @llvm.fma.f16(half %mul, half %a, half %c)
  ret half %0
}

define half @fnms16(half %a, half %b, half %c) nounwind readnone ssp {
; CHECK-LABEL: fnms16:
; CHECK:       fnmsub h0, h0, h1, h2
; CHECK-NEXT:  ret
entry:
  %mul = fneg half %c
  %0 = tail call half @llvm.fma.f16(half %a, half %b, half %mul)
  ret half %0
}

define half @test_fmsub(half %a, half %b, half %c) {
; CHECK-LABEL: test_fmsub:
; CHECK:       fmsub h0, h0, h1, h2
; CHECK-NEXT:  ret
entry:
  %nega = fsub half -0.0, %a
  %val = call half @llvm.fma.f16(half %nega, half %b, half %c)
  ret half %val
}

define half @test_fnmadd(half %a, half %b, half %c) {
; CHECK-LABEL: test_fnmadd:
; CHECK:       fnmadd h0, h0, h1, h2
; CHECK-NEXT:  ret
entry:
  %nega = fsub half -0.0, %a
  %negc = fsub half -0.0, %c
  %val = call half @llvm.fma.f16(half %nega, half %b, half %negc)
  ret half %val
}

define half @test_fmadd(half %a, half %b, half %c) {
; CHECK-LABEL: test_fmadd:
; CHECK:       fmadd h0, h0, h1, h2
; CHECK-NEXT:  ret
entry:
  %nega = fsub half -0.0, %a
  %negb = fsub half -0.0, %b
  %val = call half @llvm.fma.f16(half %nega, half %negb, half %c)
  ret half %val
}

define half @test_fnmsub(half %a, half %b, half %c) {
; CHECK-LABEL: test_fnmsub:
; CHECK:       fnmsub h0, h0, h1, h2
; CHECK-NEXT:  ret
entry:
  %negc = fsub half -0.0, %c
  %val = call half @llvm.fma.f16(half %a, half %b, half %negc)
  ret half %val
}

declare half @llvm.fma.f16(half, half, half)