Skip to content

Commit 1c12e12

Browse files
committed
[CostModel][X86] Add fdiv(double) throughput x87 costs for
1 parent e438ce5 commit 1c12e12

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ InstructionCost X86TTIImpl::getArithmeticInstrCost(
11891189
{ ISD::FADD, MVT::f64, { 2, 3, 1, 1 } }, // (x87)
11901190
{ ISD::FSUB, MVT::f64, { 2, 3, 1, 1 } }, // (x87)
11911191
{ ISD::FMUL, MVT::f64, { 2, 5, 1, 1 } }, // (x87)
1192+
{ ISD::FDIV, MVT::f64, { 38 } }, // (x87)
11921193
};
11931194

11941195
if (const auto *Entry = CostTableLookup(X86CostTbl, ISD, LT.second))

llvm/test/Analysis/CostModel/X86/arith-fp.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,10 @@ define i32 @fdiv(i32 %arg) {
527527
; SSE1-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %V4F32 = fdiv <4 x float> undef, undef
528528
; SSE1-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %V8F32 = fdiv <8 x float> undef, undef
529529
; SSE1-NEXT: Cost Model: Found an estimated cost of 136 for instruction: %V16F32 = fdiv <16 x float> undef, undef
530-
; SSE1-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %F64 = fdiv double undef, undef
531-
; SSE1-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V2F64 = fdiv <2 x double> undef, undef
532-
; SSE1-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V4F64 = fdiv <4 x double> undef, undef
533-
; SSE1-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V8F64 = fdiv <8 x double> undef, undef
530+
; SSE1-NEXT: Cost Model: Found an estimated cost of 38 for instruction: %F64 = fdiv double undef, undef
531+
; SSE1-NEXT: Cost Model: Found an estimated cost of 76 for instruction: %V2F64 = fdiv <2 x double> undef, undef
532+
; SSE1-NEXT: Cost Model: Found an estimated cost of 152 for instruction: %V4F64 = fdiv <4 x double> undef, undef
533+
; SSE1-NEXT: Cost Model: Found an estimated cost of 304 for instruction: %V8F64 = fdiv <8 x double> undef, undef
534534
; SSE1-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 undef
535535
;
536536
; SSE2-LABEL: 'fdiv'

0 commit comments

Comments
 (0)