Skip to content

Commit 91d5897

Browse files
committed
Update comments
1 parent 1b6c258 commit 91d5897

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
@@ -2804,9 +2804,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28042804

28052805
SDValue C = DAG.getConstantFP(IsLog10 ? c_log10 : c_log, DL, VT);
28062806
SDValue CC = DAG.getConstantFP(IsLog10 ? cc_log10 : cc_log, DL, VT);
2807-
// Our implementation of LOG is not contract safe because we add correction
2808-
// terms for which contraction may lead to an increase in the error of the
2809-
// approximation. Disable contraction for the expanded instructions.
2807+
// This adds correction terms for which contraction may lead to an increase
2808+
// in the error of the approximation, so disable it.
28102809
Flags.setAllowContract(false);
28112810
R = DAG.getNode(ISD::FMUL, DL, VT, Y, C, Flags);
28122811
SDValue NegR = DAG.getNode(ISD::FNEG, DL, VT, R, Flags);
@@ -2830,9 +2829,8 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28302829
SDValue YHInt = DAG.getNode(ISD::AND, DL, MVT::i32, YAsInt, MaskConst);
28312830
SDValue YH = DAG.getNode(ISD::BITCAST, DL, MVT::f32, YHInt);
28322831
SDValue YT = DAG.getNode(ISD::FSUB, DL, VT, Y, YH, Flags);
2833-
// Our implementation of LOG is not contract safe because we add correction
2834-
// terms for which contraction may lead to an increase in the error of the
2835-
// approximation. Disable contraction for the expanded instructions.
2832+
// This adds correction terms for which contraction may lead to an increase
2833+
// in the error of the approximation, so disable it.
28362834
Flags.setAllowContract(false);
28372835
SDValue YTCT = DAG.getNode(ISD::FMUL, DL, VT, YT, CT, Flags);
28382836
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
@@ -3551,9 +3551,8 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35513551

35523552
auto C = B.buildFConstant(Ty, IsLog10 ? c_log10 : c_log);
35533553
auto CC = B.buildFConstant(Ty, IsLog10 ? cc_log10 : cc_log);
3554-
// Our implementation of LOG is not contract safe because we add correction
3555-
// terms for which contraction may lead to an increase in the error of the
3556-
// approximation. Disable contraction for the expanded instructions.
3554+
// This adds correction terms for which contraction may lead to an increase
3555+
// in the error of the approximation, so disable it.
35573556
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35583557
R = B.buildFMul(Ty, Y, C, NewFlags).getReg(0);
35593558
auto NegR = B.buildFNeg(Ty, R, NewFlags);
@@ -3575,9 +3574,8 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35753574
auto MaskConst = B.buildConstant(Ty, 0xfffff000);
35763575
auto YH = B.buildAnd(Ty, Y, MaskConst);
35773576
auto YT = B.buildFSub(Ty, Y, YH, Flags);
3578-
// Our implementation of LOG is not contract safe because we add correction
3579-
// terms for which contraction may lead to an increase in the error of the
3580-
// approximation. Disable contraction for the expanded instructions.
3577+
// This adds correction terms for which contraction may lead to an increase
3578+
// in the error of the approximation, so disable it.
35813579
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35823580
auto YTCT = B.buildFMul(Ty, YT, CT, NewFlags);
35833581

0 commit comments

Comments
 (0)