File: fp16_intrinsic_scalar_3op.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (92 lines) | stat: -rw-r--r-- 2,456 bytes parent folder | download | duplicates (7)
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 -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)