2019-06-06 00:33:10 +02:00
|
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z14 | FileCheck %s
|
|
|
|
|
|
|
|
declare double @llvm.experimental.constrained.fma.f64(double %f1, double %f2, double %f3, metadata, metadata)
|
|
|
|
declare float @llvm.experimental.constrained.fma.f32(float %f1, float %f2, float %f3, metadata, metadata)
|
|
|
|
|
2019-10-04 19:03:46 +02:00
|
|
|
define double @f1(double %f1, double %f2, double %acc) #0 {
|
2019-06-06 00:33:10 +02:00
|
|
|
; CHECK-LABEL: f1:
|
|
|
|
; CHECK: wfnmadb %f0, %f0, %f2, %f4
|
|
|
|
; CHECK: br %r14
|
|
|
|
%res = call double @llvm.experimental.constrained.fma.f64 (
|
|
|
|
double %f1, double %f2, double %acc,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-04 19:03:46 +02:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-11-20 19:07:03 +01:00
|
|
|
%negres = fneg double %res
|
2019-06-06 00:33:10 +02:00
|
|
|
ret double %negres
|
|
|
|
}
|
|
|
|
|
2019-10-04 19:03:46 +02:00
|
|
|
define double @f2(double %f1, double %f2, double %acc) #0 {
|
2019-06-06 00:33:10 +02:00
|
|
|
; CHECK-LABEL: f2:
|
|
|
|
; CHECK: wfnmsdb %f0, %f0, %f2, %f4
|
|
|
|
; CHECK: br %r14
|
2019-11-20 19:07:03 +01:00
|
|
|
%negacc = fneg double %acc
|
2019-06-06 00:33:10 +02:00
|
|
|
%res = call double @llvm.experimental.constrained.fma.f64 (
|
|
|
|
double %f1, double %f2, double %negacc,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-04 19:03:46 +02:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-11-20 19:07:03 +01:00
|
|
|
%negres = fneg double %res
|
2019-06-06 00:33:10 +02:00
|
|
|
ret double %negres
|
|
|
|
}
|
|
|
|
|
2019-10-04 19:03:46 +02:00
|
|
|
define float @f3(float %f1, float %f2, float %acc) #0 {
|
2019-06-06 00:33:10 +02:00
|
|
|
; CHECK-LABEL: f3:
|
|
|
|
; CHECK: wfnmasb %f0, %f0, %f2, %f4
|
|
|
|
; CHECK: br %r14
|
|
|
|
%res = call float @llvm.experimental.constrained.fma.f32 (
|
|
|
|
float %f1, float %f2, float %acc,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-04 19:03:46 +02:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-11-20 19:07:03 +01:00
|
|
|
%negres = fneg float %res
|
2019-06-06 00:33:10 +02:00
|
|
|
ret float %negres
|
|
|
|
}
|
|
|
|
|
2019-10-04 19:03:46 +02:00
|
|
|
define float @f4(float %f1, float %f2, float %acc) #0 {
|
2019-06-06 00:33:10 +02:00
|
|
|
; CHECK-LABEL: f4:
|
|
|
|
; CHECK: wfnmssb %f0, %f0, %f2, %f4
|
|
|
|
; CHECK: br %r14
|
2019-11-20 19:07:03 +01:00
|
|
|
%negacc = fneg float %acc
|
2019-06-06 00:33:10 +02:00
|
|
|
%res = call float @llvm.experimental.constrained.fma.f32 (
|
|
|
|
float %f1, float %f2, float %negacc,
|
|
|
|
metadata !"round.dynamic",
|
2019-10-04 19:03:46 +02:00
|
|
|
metadata !"fpexcept.strict") #0
|
2019-11-20 19:07:03 +01:00
|
|
|
%negres = fneg float %res
|
2019-06-06 00:33:10 +02:00
|
|
|
ret float %negres
|
|
|
|
}
|
|
|
|
|
2019-10-04 19:03:46 +02:00
|
|
|
attributes #0 = { strictfp }
|