[Updating to the right interest@ address] On Friday 29 November 2024 17:48:18 Pacific Standard Time David C. Partridge wrote: > The header file qnumeric.h includes <intrin.h> if the MVSC compiler is in > use so that implementations of qMulOverflow and qAddOverFlow that exploit > the intrinsics can be defined. > > As far as I can determine, the code also implements "generic" versions of > those which do not rely on the use of MSVC intrinsics.
Hello David I also see you've filed https://bugreports.qt.io/browse/QTBUG-131757, which I'd closed but have now reopened as a suggestion. The "generic" versions work, but they are worse than simply asking the CPU if the operation in question has overflown. For additions the cost is minimal, but for multiplications it's very difficult to do it generically properly without processor support. You suggested moving the operations out-of-line but I think that's worse. The cost of the call is going to be worse than even the fallback implementations for additions and some of the optimisable multiplications. Moreover, none of the ABIs allow returning flags, so there are more operations required. Those functions were not originally public. We made them so in 6.1.0 because I think someone asked us. As discussed in the task, I'll accept a macro to disable the #include and therefore fall back to the alternative implementations. -- Thiago Macieira - thiago.macieira (AT) intel.com Principal Engineer - Intel DCAI Platform & System Engineering
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest