Skip to content

Commit 0f2212f

Browse files
committed
Simplify comments
1 parent 5b3f666 commit 0f2212f

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2806,9 +2806,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28062806
SDValue C = DAG.getConstantFP(IsLog10 ? c_log10 : c_log, DL, VT);
28072807
SDValue CC = DAG.getConstantFP(IsLog10 ? cc_log10 : cc_log, DL, VT);
28082808
// Our implementation of LOG is not contract safe because we generate
2809-
// error-correcting summations based on the rounding error of the first
2810-
// multiplication below, so contracting the multiply with the final add will
2811-
// lead to inaccurate final results. Disable contraction for the expanded
2809+
// error-correcting summations for which contraction may lead to an increase
2810+
// in the error of the approximation. Disable contraction for the expanded
28122811
// instructions.
28132812
Flags.setAllowContract(false);
28142813
R = DAG.getNode(ISD::FMUL, DL, VT, Y, C, Flags);
@@ -2834,9 +2833,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28342833
SDValue YH = DAG.getNode(ISD::BITCAST, DL, MVT::f32, YHInt);
28352834
SDValue YT = DAG.getNode(ISD::FSUB, DL, VT, Y, YH, Flags);
28362835
// Our implementation of LOG is not contract safe because we generate
2837-
// error-correcting summations based on the rounding error of the first
2838-
// multiplication below, so contracting the multiply with the final add will
2839-
// lead to inaccurate final results. Disable contraction for the expanded
2836+
// error-correcting summations for which contraction may lead to an increase
2837+
// in the error of the approximation. Disable contraction for the expanded
28402838
// instructions.
28412839
Flags.setAllowContract(false);
28422840
SDValue YTCT = DAG.getNode(ISD::FMUL, DL, VT, YT, CT, Flags);

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,10 +3552,9 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35523552
auto C = B.buildFConstant(Ty, IsLog10 ? c_log10 : c_log);
35533553
auto CC = B.buildFConstant(Ty, IsLog10 ? cc_log10 : cc_log);
35543554
// Our implementation of LOG is not contract safe because we generate
3555-
// error-correcting summations based on the rounding error of the first
3556-
// multiplication below, so contracting the multiply with the final add will
3557-
// lead to inaccurate final results. Disable contraction for the expanded
3558-
// instructions.
3555+
// error-correcting summations for which contraction may lead to an
3556+
// increase in the error of the approximation. Disable contraction for the
3557+
// expanded instructions.
35593558
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35603559
R = B.buildFMul(Ty, Y, C, NewFlags).getReg(0);
35613560
auto NegR = B.buildFNeg(Ty, R, NewFlags);
@@ -3578,10 +3577,9 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35783577
auto YH = B.buildAnd(Ty, Y, MaskConst);
35793578
auto YT = B.buildFSub(Ty, Y, YH, Flags);
35803579
// Our implementation of LOG is not contract safe because we generate
3581-
// error-correcting summations based on the rounding error of the first
3582-
// multiplication below, so contracting the multiply with the final add will
3583-
// lead to inaccurate final results. Disable contraction for the expanded
3584-
// instructions.
3580+
// error-correcting summations for which contraction may lead to an
3581+
// increase in the error of the approximation. Disable contraction for the
3582+
// expanded instructions.
35853583
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35863584
auto YTCT = B.buildFMul(Ty, YT, CT, NewFlags);
35873585

0 commit comments

Comments
 (0)