Skip to content

Commit 8dad7e5

Browse files
committed
Update comments
1 parent fbf91a4 commit 8dad7e5

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,9 +2805,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28052805

28062806
SDValue C = DAG.getConstantFP(IsLog10 ? c_log10 : c_log, DL, VT);
28072807
SDValue CC = DAG.getConstantFP(IsLog10 ? cc_log10 : cc_log, DL, VT);
2808-
// Our implementation of LOG is not contract safe because we add correction
2809-
// terms for which contraction may lead to an increase in the error of the
2810-
// approximation. Disable contraction for the expanded instructions.
2808+
// This adds correction terms for which contraction may lead to an increase
2809+
// in the error of the approximation, so disable it.
28112810
Flags.setAllowContract(false);
28122811
R = DAG.getNode(ISD::FMUL, DL, VT, Y, C, Flags);
28132812
SDValue NegR = DAG.getNode(ISD::FNEG, DL, VT, R, Flags);
@@ -2831,9 +2830,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28312830
SDValue YHInt = DAG.getNode(ISD::AND, DL, MVT::i32, YAsInt, MaskConst);
28322831
SDValue YH = DAG.getNode(ISD::BITCAST, DL, MVT::f32, YHInt);
28332832
SDValue YT = DAG.getNode(ISD::FSUB, DL, VT, Y, YH, Flags);
2834-
// Our implementation of LOG is not contract safe because we add correction
2835-
// terms for which contraction may lead to an increase in the error of the
2836-
// approximation. Disable contraction for the expanded instructions.
2833+
// This adds correction terms for which contraction may lead to an increase
2834+
// in the error of the approximation, so disable it.
28372835
Flags.setAllowContract(false);
28382836
SDValue YTCT = DAG.getNode(ISD::FMUL, DL, VT, YT, CT, Flags);
28392837
SDValue Mad0 = getMad(DAG, DL, VT, YH, CT, YTCT, Flags);

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,9 +3561,8 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35613561

35623562
auto C = B.buildFConstant(Ty, IsLog10 ? c_log10 : c_log);
35633563
auto CC = B.buildFConstant(Ty, IsLog10 ? cc_log10 : cc_log);
3564-
// Our implementation of LOG is not contract safe because we add correction
3565-
// terms for which contraction may lead to an increase in the error of the
3566-
// approximation. Disable contraction for the expanded instructions.
3564+
// This adds correction terms for which contraction may lead to an increase
3565+
// in the error of the approximation, so disable it.
35673566
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35683567
R = B.buildFMul(Ty, Y, C, NewFlags).getReg(0);
35693568
auto NegR = B.buildFNeg(Ty, R, NewFlags);
@@ -3585,9 +3584,8 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35853584
auto MaskConst = B.buildConstant(Ty, 0xfffff000);
35863585
auto YH = B.buildAnd(Ty, Y, MaskConst);
35873586
auto YT = B.buildFSub(Ty, Y, YH, Flags);
3588-
// Our implementation of LOG is not contract safe because we add correction
3589-
// terms for which contraction may lead to an increase in the error of the
3590-
// approximation. Disable contraction for the expanded instructions.
3587+
// This adds correction terms for which contraction may lead to an increase
3588+
// in the error of the approximation, so disable it.
35913589
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35923590
auto YTCT = B.buildFMul(Ty, YT, CT, NewFlags);
35933591

0 commit comments

Comments
 (0)