Fastest C/C++ comparison function for an opaque field containing doubles Description:
Write the fastest comparison function for an opaque field containing a double. Here is my example:
// Three-way comparison function:
//   if a &lt; b: negative result
//   if a &gt; b: positive result
//   else: zero result
inline int Compare(const unsigned char* a, const unsigned char* b) const 
{
    if (*(double*)a &lt; *(double*)b) return -1;
    if (*(double*)a &gt; *(double*)b) return +1;
    return 0;
}

Size: 188 characters (excluding the comments)
Speed: N/A
Background:
Google's LevelDB stores keys as opaque fields (i.e. bytes) and it requires the use of a comparator when the keys cannot be compared as bytes, such as the case with doubles. You can read this article to see why Floating-Point binary comparison is tricky, so when LevelDB stores key-value pairs on disk it has to properly compare the opaque keys in order to achieve good data locality.
Correct Submission:

The submission must be written in C/C++.
The submission must correctly compare the opaque fields as doubles.
Given that 1 and 2 are satisfied, the winner should be selected based on the minimum CPU operations ticks (i.e. the fastest comparison).

If there is a tie, then the shortest correct submission will be awarded.
P.S. This is my first time posting, so please let me know if I should correct/improve something in the competition.
This function is written in MMIX assembly. It should perform the calculation in 2&upsilon;
+ 5&mu;. If you inline it, the call is no longer needed so you can save the POP instruction. This function should be compatible with gcc for MMIX. (Read TAOCP vol 1. fasc 1 for more information):

compareDoubles IS @  ; Declare symbol, @ is the current position
   LDOU $0,$0,0      ; Load first double  (LDOU: load octa unsigned), 1v
   LDOU $1,$1,0      ; Load second double, 1
   FCMP $0,$0,$1     ; Compare floating point values, 4µ
   POP  1,0          ; return, 1µ


If you assemble it, the code is 16 bytes long and may looks this:

8f 00 00 00  8f 01 01 00  01 00 00 01  f8 01 00 00