Fast CRC32

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fast CRC32

pianoman-3
    Hello , I need to know whether someone has fast routines to calculate
crc32 of let's say 64 k buffer.
Any help would be appreciated
Pianoman
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Sunday, April 16, 2006 12:02 PM
Subject: fpc-pascal Digest, Vol 20, Issue 18


> Send fpc-pascal mailing list submissions to
> [hidden email]
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> or, via email, send a message with subject or body 'help' to
> [hidden email]
>
> You can reach the person managing the list at
> [hidden email]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of fpc-pascal digest..."
>
>
> Today's Topics:
>
>    1. Re:  Division by Zero - not raised exception (Sasa Zeman)
>    2. Re:  Division by Zero - not raised exception (Florian Klaempfl)
>    3. Re:  Division by Zero - not raised exception (Sasa Zeman)
>    4. Re:  Division by Zero - not raised exception (Florian Klaempfl)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sun, 16 Apr 2006 10:16:27 +0200
> From: "Sasa Zeman" <[hidden email]>
> Subject: Re: [fpc-pascal] Division by Zero - not raised exception
> To: "FPC-Pascal users discussions" <[hidden email]>
> Message-ID: <001b01c6612e$11bfa500$6ec6f4d5@u>
> Content-Type: text/plain; charset="iso-8859-1"
>
> > > FPC 2.0.2 do not rasie exception on integer/floats division by Zero,
> which
> > > is suitable for calucaltion I currently developing. Instead, division
> > > return infinity:
> > >
> > > writeln(1/0) -> +inf
> > > writeln(1.0/0) -> +inf
> > Already fixed.
>
> Unfortunatelly, bug still persists when division is performed with
> constants.
> Please take a look bug report #5018 for details.
>
>
> ------------------------------
>
> Message: 2
> Date: Sun, 16 Apr 2006 10:23:06 +0200
> From: Florian Klaempfl <[hidden email]>
> Subject: Re: [fpc-pascal] Division by Zero - not raised exception
> To: FPC-Pascal users discussions <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Sasa Zeman wrote:
> >>> FPC 2.0.2 do not rasie exception on integer/floats division by Zero,
> > which
> >>> is suitable for calucaltion I currently developing. Instead, division
> >>> return infinity:
> >>>
> >>> writeln(1/0) -> +inf
> >>> writeln(1.0/0) -> +inf
> >> Already fixed.
> >
> > Unfortunatelly, bug still persists when division is performed with
> > constants.
> > Please take a look bug report #5018 for details.
>
> We don't consider this as a bug, it's for delphi compatibility reasons.
> These expressions are evaluated at compile time, so it's something
> differnt. If you want to get an error, compile with -Cr.
>
> ------------------------------
>
> Message: 3
> Date: Sun, 16 Apr 2006 11:34:45 +0200
> From: "Sasa Zeman" <[hidden email]>
> Subject: Re: [fpc-pascal] Division by Zero - not raised exception
> To: "FPC-Pascal users discussions" <[hidden email]>
> Message-ID: <003601c66139$02378160$6ec6f4d5@u>
> Content-Type: text/plain; charset="iso-8859-1"
>
> > We don't consider this as a bug, it's for delphi compatibility reasons.
> > These expressions are evaluated at compile time, so it's something
> > differnt. If you want to get an error, compile with -Cr.
>
> The -Cr will point on error in the code, however, enabling range checking
> will also affect on global speed performance.
>
> Definition in documentation (RTL.pdf):
> "
> 29.20 EDivByZero
> 29.20.1 Description
> EDivByZero is used when the operating system or CPU signals a division by
> zero error.
> "
> As defined, reported issue is a bug. As well globaly, in consistency
terms.
>
> Far I can see, the core of the problem is in definiton of Infinity
constant
> as 1.0/0.0 and NaN with ln(-1.0) or 0.0/0.0 Perhaps this is necessary to
> avoid problem with probably difference between different CPU/FPUs.
However,

> IEEE specification should be followed by all of them and bits manipulation
> to perform infinity should be enough, instead to calculate it (as is
> performed currently).
>
>
> ------------------------------
>
> Message: 4
> Date: Sun, 16 Apr 2006 11:40:35 +0200
> From: Florian Klaempfl <[hidden email]>
> Subject: Re: [fpc-pascal] Division by Zero - not raised exception
> To: FPC-Pascal users discussions <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Sasa Zeman wrote:
> >> We don't consider this as a bug, it's for delphi compatibility reasons.
> >> These expressions are evaluated at compile time, so it's something
> >> differnt. If you want to get an error, compile with -Cr.
> >
> > The -Cr will point on error in the code, however, enabling range
checking

> > will also affect on global speed performance.
>
> The program won't compile with -Cr.
>
> >
> > Definition in documentation (RTL.pdf):
> > "
> > 29.20 EDivByZero
> > 29.20.1 Description
> > EDivByZero is used when the operating system or CPU signals a division
by
> > zero error.
> > "
> > As defined, reported issue is a bug. As well globaly, in consistency
terms.

>
> ... operating system or CPU ...
> but not the compiler ;)
>
> The point is: this div by zero is encountered at compilation time.
> The other option is to stop compilation always. Executing the operation
> at run time is useless imo and a waste of CPU cycles.
>
> >
> > Far I can see, the core of the problem is in definiton of Infinity
constant
> > as 1.0/0.0 and NaN with ln(-1.0) or 0.0/0.0
>
> No. These constants are defined in const blocks. A const block couldn't
> throw an exception.
>
> > Perhaps this is necessary to
> > avoid problem with probably difference between different CPU/FPUs.
However,
> > IEEE specification should be followed by all of them and bits
manipulation

> > to perform infinity should be enough, instead to calculate it (as is
> > performed currently).
> >
> > _______________________________________________
> > fpc-pascal maillist  -  [hidden email]
> > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> >
>
>
> ------------------------------
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
> End of fpc-pascal Digest, Vol 20, Issue 18
> ******************************************
>
>
> __________ Informacia od NOD32 1.1490 (20060415) __________
>
> Tato sprava bola preverena antivirusovym systemom NOD32.
> http://www.eset.sk
>
>

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Fast CRC32

Sasa Zeman
>     Hello , I need to know whether someone has fast routines to calculate
> crc32 of let's say 64 k buffer.
> Any help would be appreciated

Almost all table oriented impelmentations using pointer arithmetic are fast
enough. You may be interested to take a look CRC32 unit on my site.  It is
operated with memory, streams and files.

Sasa
--
www.szutils.net

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal