Skip to content

Commit

Permalink
[X86] Fix errors in use of strictfp attribute.
Browse files Browse the repository at this point in the history
Errors spotted with use of: https://reviews.llvm.org/D68233
  • Loading branch information
kpneal committed May 29, 2020
1 parent f6a6de2 commit cd74ccc
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 110 deletions.
3 changes: 2 additions & 1 deletion llvm/test/CodeGen/X86/fp-intrinsics.ll
Expand Up @@ -1762,13 +1762,14 @@ entry:
ret i64 %result
}

define i64 @f26(float %x) {
define i64 @f26(float %x) #0 {
; X87-LABEL: f26:
; X87: # %bb.0: # %entry
; X87-NEXT: subl $12, %esp
; X87-NEXT: .cfi_def_cfa_offset 16
; X87-NEXT: flds {{[0-9]+}}(%esp)
; X87-NEXT: fstps (%esp)
; X87-NEXT: wait
; X87-NEXT: calll llrintf
; X87-NEXT: addl $12, %esp
; X87-NEXT: .cfi_def_cfa_offset 4
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/fp-strict-scalar-cmp.ll
Expand Up @@ -4206,7 +4206,7 @@ define void @foo(float %0, float %1) #0 {
br i1 %3, label %4, label %5

4: ; preds = %2
tail call void @bar()
tail call void @bar() #0
br label %5

5: ; preds = %4, %2
Expand Down
20 changes: 10 additions & 10 deletions llvm/test/CodeGen/X86/fp-strict-scalar-round.ll
Expand Up @@ -54,7 +54,7 @@ define float @fceil32(float %f) #0 {
; AVX-X64-NEXT: vroundss $10, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call float @llvm.experimental.constrained.ceil.f32(
float %f, metadata !"fpexcept.strict")
float %f, metadata !"fpexcept.strict") #0
ret float %res
}

Expand Down Expand Up @@ -107,7 +107,7 @@ define double @fceilf64(double %f) #0 {
; AVX-X64-NEXT: vroundsd $10, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call double @llvm.experimental.constrained.ceil.f64(
double %f, metadata !"fpexcept.strict")
double %f, metadata !"fpexcept.strict") #0
ret double %res
}

Expand Down Expand Up @@ -148,7 +148,7 @@ define float @ffloor32(float %f) #0 {
; AVX-X64-NEXT: vroundss $9, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call float @llvm.experimental.constrained.floor.f32(
float %f, metadata !"fpexcept.strict")
float %f, metadata !"fpexcept.strict") #0
ret float %res
}

Expand Down Expand Up @@ -201,7 +201,7 @@ define double @ffloorf64(double %f) #0 {
; AVX-X64-NEXT: vroundsd $9, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call double @llvm.experimental.constrained.floor.f64(
double %f, metadata !"fpexcept.strict")
double %f, metadata !"fpexcept.strict") #0
ret double %res
}

Expand Down Expand Up @@ -242,7 +242,7 @@ define float @ftrunc32(float %f) #0 {
; AVX-X64-NEXT: vroundss $11, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call float @llvm.experimental.constrained.trunc.f32(
float %f, metadata !"fpexcept.strict")
float %f, metadata !"fpexcept.strict") #0
ret float %res
}

Expand Down Expand Up @@ -295,7 +295,7 @@ define double @ftruncf64(double %f) #0 {
; AVX-X64-NEXT: vroundsd $11, %xmm0, %xmm0, %xmm0
; AVX-X64-NEXT: retq
%res = call double @llvm.experimental.constrained.trunc.f64(
double %f, metadata !"fpexcept.strict")
double %f, metadata !"fpexcept.strict") #0
ret double %res
}

Expand Down Expand Up @@ -337,7 +337,7 @@ define float @frint32(float %f) #0 {
; AVX-X64-NEXT: retq
%res = call float @llvm.experimental.constrained.rint.f32(
float %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %res
}

Expand Down Expand Up @@ -391,7 +391,7 @@ define double @frintf64(double %f) #0 {
; AVX-X64-NEXT: retq
%res = call double @llvm.experimental.constrained.rint.f64(
double %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret double %res
}

Expand Down Expand Up @@ -433,7 +433,7 @@ define float @fnearbyint32(float %f) #0 {
; AVX-X64-NEXT: retq
%res = call float @llvm.experimental.constrained.nearbyint.f32(
float %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret float %res
}

Expand Down Expand Up @@ -487,7 +487,7 @@ define double @fnearbyintf64(double %f) #0 {
; AVX-X64-NEXT: retq
%res = call double @llvm.experimental.constrained.nearbyint.f64(
double %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret double %res
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/vec-strict-128.ll
Expand Up @@ -199,7 +199,7 @@ define <4 x float> @f11(<2 x double> %a0, <4 x float> %a1) #0 {
%ext = extractelement <2 x double> %a0, i32 0
%cvt = call float @llvm.experimental.constrained.fptrunc.f32.f64(double %ext,
metadata !"round.dynamic",
metadata !"fpexcept.strict")
metadata !"fpexcept.strict") #0
%res = insertelement <4 x float> %a1, float %cvt, i32 0
ret <4 x float> %res
}
Expand Down
20 changes: 10 additions & 10 deletions llvm/test/CodeGen/X86/vec-strict-256.ll
Expand Up @@ -194,7 +194,7 @@ define <8 x float> @fceilv8f32(<8 x float> %f) #0 {
; CHECK-NEXT: vroundps $10, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x float> @llvm.experimental.constrained.ceil.v8f32(
<8 x float> %f, metadata !"fpexcept.strict")
<8 x float> %f, metadata !"fpexcept.strict") #0
ret <8 x float> %res
}

Expand All @@ -204,7 +204,7 @@ define <4 x double> @fceilv4f64(<4 x double> %f) #0 {
; CHECK-NEXT: vroundpd $10, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <4 x double> @llvm.experimental.constrained.ceil.v4f64(
<4 x double> %f, metadata !"fpexcept.strict")
<4 x double> %f, metadata !"fpexcept.strict") #0
ret <4 x double> %res
}

Expand All @@ -214,7 +214,7 @@ define <8 x float> @ffloorv8f32(<8 x float> %f) #0 {
; CHECK-NEXT: vroundps $9, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x float> @llvm.experimental.constrained.floor.v8f32(
<8 x float> %f, metadata !"fpexcept.strict")
<8 x float> %f, metadata !"fpexcept.strict") #0
ret <8 x float> %res
}

Expand All @@ -224,7 +224,7 @@ define <4 x double> @ffloorv4f64(<4 x double> %f) #0 {
; CHECK-NEXT: vroundpd $9, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <4 x double> @llvm.experimental.constrained.floor.v4f64(
<4 x double> %f, metadata !"fpexcept.strict")
<4 x double> %f, metadata !"fpexcept.strict") #0
ret <4 x double> %res
}

Expand All @@ -235,7 +235,7 @@ define <8 x float> @ftruncv8f32(<8 x float> %f) #0 {
; CHECK-NEXT: vroundps $11, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x float> @llvm.experimental.constrained.trunc.v8f32(
<8 x float> %f, metadata !"fpexcept.strict")
<8 x float> %f, metadata !"fpexcept.strict") #0
ret <8 x float> %res
}

Expand All @@ -245,7 +245,7 @@ define <4 x double> @ftruncv4f64(<4 x double> %f) #0 {
; CHECK-NEXT: vroundpd $11, %ymm0, %ymm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <4 x double> @llvm.experimental.constrained.trunc.v4f64(
<4 x double> %f, metadata !"fpexcept.strict")
<4 x double> %f, metadata !"fpexcept.strict") #0
ret <4 x double> %res
}

Expand All @@ -257,7 +257,7 @@ define <8 x float> @frintv8f32(<8 x float> %f) #0 {
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x float> @llvm.experimental.constrained.rint.v8f32(
<8 x float> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <8 x float> %res
}

Expand All @@ -268,7 +268,7 @@ define <4 x double> @frintv4f64(<4 x double> %f) #0 {
; CHECK-NEXT: ret{{[l|q]}}
%res = call <4 x double> @llvm.experimental.constrained.rint.v4f64(
<4 x double> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <4 x double> %res
}

Expand All @@ -280,7 +280,7 @@ define <8 x float> @fnearbyintv8f32(<8 x float> %f) #0 {
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x float> @llvm.experimental.constrained.nearbyint.v8f32(
<8 x float> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <8 x float> %res
}

Expand All @@ -291,7 +291,7 @@ define <4 x double> @fnearbyintv4f64(<4 x double> %f) #0 {
; CHECK-NEXT: ret{{[l|q]}}
%res = call <4 x double> @llvm.experimental.constrained.nearbyint.v4f64(
<4 x double> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <4 x double> %res
}

Expand Down
20 changes: 10 additions & 10 deletions llvm/test/CodeGen/X86/vec-strict-512.ll
Expand Up @@ -191,7 +191,7 @@ define <16 x float> @strict_vector_fceil_v16f32(<16 x float> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscaleps $10, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <16 x float> @llvm.experimental.constrained.ceil.v16f32(<16 x float> %f, metadata !"fpexcept.strict")
%res = call <16 x float> @llvm.experimental.constrained.ceil.v16f32(<16 x float> %f, metadata !"fpexcept.strict") #0
ret <16 x float> %res
}

Expand All @@ -200,7 +200,7 @@ define <8 x double> @strict_vector_fceil_v8f64(<8 x double> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscalepd $10, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x double> @llvm.experimental.constrained.ceil.v8f64(<8 x double> %f, metadata !"fpexcept.strict")
%res = call <8 x double> @llvm.experimental.constrained.ceil.v8f64(<8 x double> %f, metadata !"fpexcept.strict") #0
ret <8 x double> %res
}

Expand All @@ -209,7 +209,7 @@ define <16 x float> @strict_vector_ffloor_v16f32(<16 x float> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscaleps $9, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <16 x float> @llvm.experimental.constrained.floor.v16f32(<16 x float> %f, metadata !"fpexcept.strict")
%res = call <16 x float> @llvm.experimental.constrained.floor.v16f32(<16 x float> %f, metadata !"fpexcept.strict") #0
ret <16 x float> %res
}

Expand All @@ -218,7 +218,7 @@ define <8 x double> @strict_vector_ffloor_v8f64(<8 x double> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscalepd $9, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x double> @llvm.experimental.constrained.floor.v8f64(<8 x double> %f, metadata !"fpexcept.strict")
%res = call <8 x double> @llvm.experimental.constrained.floor.v8f64(<8 x double> %f, metadata !"fpexcept.strict") #0
ret <8 x double> %res
}

Expand All @@ -227,7 +227,7 @@ define <16 x float> @strict_vector_ftrunc_v16f32(<16 x float> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscaleps $11, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <16 x float> @llvm.experimental.constrained.trunc.v16f32(<16 x float> %f, metadata !"fpexcept.strict")
%res = call <16 x float> @llvm.experimental.constrained.trunc.v16f32(<16 x float> %f, metadata !"fpexcept.strict") #0
ret <16 x float> %res
}

Expand All @@ -236,7 +236,7 @@ define <8 x double> @strict_vector_ftrunc_v8f64(<8 x double> %f) #0 {
; CHECK: # %bb.0:
; CHECK-NEXT: vrndscalepd $11, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x double> @llvm.experimental.constrained.trunc.v8f64(<8 x double> %f, metadata !"fpexcept.strict")
%res = call <8 x double> @llvm.experimental.constrained.trunc.v8f64(<8 x double> %f, metadata !"fpexcept.strict") #0
ret <8 x double> %res
}

Expand All @@ -246,7 +246,7 @@ define <16 x float> @strict_vector_frint_v16f32(<16 x float> %f) #0 {
; CHECK-NEXT: vrndscaleps $4, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <16 x float> @llvm.experimental.constrained.rint.v16f32(<16 x float> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <16 x float> %res
}

Expand All @@ -256,7 +256,7 @@ define <8 x double> @strict_vector_frint_v8f64(<8 x double> %f) #0 {
; CHECK-NEXT: vrndscalepd $4, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x double> @llvm.experimental.constrained.rint.v8f64(<8 x double> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <8 x double> %res
}

Expand All @@ -266,7 +266,7 @@ define <16 x float> @strict_vector_fnearbyint_v16f32(<16 x float> %f) #0 {
; CHECK-NEXT: vrndscaleps $12, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <16 x float> @llvm.experimental.constrained.nearbyint.v16f32(<16 x float> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <16 x float> %res
}

Expand All @@ -276,7 +276,7 @@ define <8 x double> @strict_vector_fnearbyint_v8f64(<8 x double> %f) #0 {
; CHECK-NEXT: vrndscalepd $12, %zmm0, %zmm0
; CHECK-NEXT: ret{{[l|q]}}
%res = call <8 x double> @llvm.experimental.constrained.nearbyint.v8f64(<8 x double> %f,
metadata !"round.dynamic", metadata !"fpexcept.strict")
metadata !"round.dynamic", metadata !"fpexcept.strict") #0
ret <8 x double> %res
}

Expand Down

0 comments on commit cd74ccc

Please sign in to comment.