Skip to content

Commit c51427f

Browse files
committed
Update comments
1 parent 0f2212f commit c51427f

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,10 +2805,9 @@ 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 generate
2809-
// error-correcting summations for which contraction may lead to an increase
2810-
// in the error of the approximation. Disable contraction for the expanded
2811-
// instructions.
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.
28122811
Flags.setAllowContract(false);
28132812
R = DAG.getNode(ISD::FMUL, DL, VT, Y, C, Flags);
28142813
SDValue NegR = DAG.getNode(ISD::FNEG, DL, VT, R, Flags);
@@ -2832,10 +2831,9 @@ SDValue AMDGPUTargetLowering::LowerFLOGCommon(SDValue Op,
28322831
SDValue YHInt = DAG.getNode(ISD::AND, DL, MVT::i32, YAsInt, MaskConst);
28332832
SDValue YH = DAG.getNode(ISD::BITCAST, DL, MVT::f32, YHInt);
28342833
SDValue YT = DAG.getNode(ISD::FSUB, DL, VT, Y, YH, Flags);
2835-
// Our implementation of LOG is not contract safe because we generate
2836-
// error-correcting summations for which contraction may lead to an increase
2837-
// in the error of the approximation. Disable contraction for the expanded
2838-
// instructions.
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.
28392837
Flags.setAllowContract(false);
28402838
SDValue YTCT = DAG.getNode(ISD::FMUL, DL, VT, YT, CT, Flags);
28412839
SDValue Mad0 = getMad(DAG, DL, VT, YH, CT, YTCT, Flags);

llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3551,10 +3551,9 @@ 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 generate
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.
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.
35583557
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35593558
R = B.buildFMul(Ty, Y, C, NewFlags).getReg(0);
35603559
auto NegR = B.buildFNeg(Ty, R, NewFlags);
@@ -3576,10 +3575,9 @@ bool AMDGPULegalizerInfo::legalizeFlogCommon(MachineInstr &MI,
35763575
auto MaskConst = B.buildConstant(Ty, 0xfffff000);
35773576
auto YH = B.buildAnd(Ty, Y, MaskConst);
35783577
auto YT = B.buildFSub(Ty, Y, YH, Flags);
3579-
// Our implementation of LOG is not contract safe because we generate
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.
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.
35833581
auto NewFlags = Flags & ~(MachineInstr::FmContract);
35843582
auto YTCT = B.buildFMul(Ty, YT, CT, NewFlags);
35853583

0 commit comments

Comments
 (0)