[vtk-developers] Deprecating vtkFastNumericConversion
David Partyka
david.partyka at kitware.com
Wed Jun 22 13:37:58 EDT 2011
Sounds reasonable to me. I recently modified that class to deal with
modularization issues and found its contents to be a bit eyebrow raising
myself.
On Wed, Jun 22, 2011 at 1:14 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi All,
>
> I'd like to remove vtkFastNumericConversion.h/.cxx. This is an
> obsolete file uses bit-tricks to accelerate float-to-int conversions
> on old pentium processors (i.e. Pentium II and earlier, or any code
> compiled for compatibility with such processors). It has now become
> irrelevant and, in my opinion, dangerous.
>
> Of note is that:
> 1) It applies these "bit tricks" whenever compiled a 32-bit x86
> processor, even though modern i386-family processors do not need them
> 2) On all other processors, it gives incorrect results!!!
> 3) It is only used in the ray cast volume mapper, as far as I've seen
>
> The incorrect results I mentioned are as follows: whenever
> VTK_USE_TRICK is not set, it falls back to this code:
>
> int QuickFloor(double val)
> {
> return static_cast<int>(val);
> }
>
> int SafeFloor(double val)
> {
> return static_cast<int>(val);
> }
>
> In other words, on any non-i386 CPU, including x86_64, the results are
> incorrect if "val" is negative. So I would like to mark the whole
> thing "LEGACY" for now, and remove the file completely before the VTK
> 6.0 release.
>
> - David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110622/6f3dd392/attachment.html>
More information about the vtk-developers
mailing list