File: fma-phi-213-to-231.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (37 lines) | stat: -rw-r--r-- 1,343 bytes parent folder | download | duplicates (27)
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
; RUN: llc < %s -mtriple=i386-apple-darwin10  -mattr=+fma,-fma4  | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -mattr=+fma,-fma4 | FileCheck %s
; RUN: llc < %s -mtriple=i686-- -mcpu=bdver2 -mattr=-fma4  | FileCheck %s

; Test FMA3 variant selection

; CHECK-LABEL: fma3_select231ssX:
; CHECK: vfmadd231ss %xmm
define float @fma3_select231ssX(float %x, float %y) {
entry:
  br label %while.body
while.body:
  %acc.01 = phi float [ 0.000000e+00, %entry ], [ %acc, %while.body ]
  %acc = call float @llvm.fma.f32(float %x, float %y, float %acc.01)
  %b = fcmp ueq float %acc, 0.0
  br i1 %b, label %while.body, label %while.end
while.end:
  ret float %acc
}

; CHECK-LABEL: fma3_select231pdY:
; CHECK: vfmadd231pd %ymm
define <4 x double> @fma3_select231pdY(<4 x double> %x, <4 x double> %y) {
entry:
  br label %while.body
while.body:
  %acc.04 = phi <4 x double> [ zeroinitializer, %entry ], [ %add, %while.body ]
  %add = call <4 x double> @llvm.fma.v4f64(<4 x double> %x, <4 x double> %y, <4 x double> %acc.04)
  %vecext = extractelement <4 x double> %add, i32 0
  %cmp = fcmp oeq double %vecext, 0.000000e+00
  br i1 %cmp, label %while.body, label %while.end
while.end:
  ret <4 x double> %add
}

declare float @llvm.fma.f32(float, float, float)
declare <4 x double> @llvm.fma.v4f64(<4 x double>, <4 x double>, <4 x double>)