Results 1 to 15 of 15
  1. #1
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic

    Simple Server Hack |God|Ammo|Name

    Well, this is just an small source of an working and stable Server Hack.

    This uses an BackGroundWorker to lower the lag and problems caused by using timers.
    This means it will make an "side-process" of the program, so it WONT affect the actual program.

    I have commented some of the tings. So you should be able to understand some of it.

    [Note: I'm not the best coder, so some things I have done, might be "nooby" :P]

    Credit:
    Jorndel

    Don't forget to give credit if you are to use it, or if you got inspired by it

    Scans:
    https://www.virustotal.com/file/1421...is/1352080895/
    Small Server Snippet.rar - Jotti's malware scan

    Side-Note:
    It contains a newer version of my memory class.
    This is "old" but it's the newest I have released so far.

    -Currently writing one for advance usage.
    To help people understand what they do and what the memory class does.
    <b>Downloadable Files</b> Downloadable Files

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  2. The Following 16 Users Say Thank You to Jorndel For This Useful Post:

    BigBoss89 (12-31-2012),Daten119 (08-02-2013),dydy2001 (11-06-2012),F4B1 (11-13-2012),fatpeoplerule (11-11-2012),Hammaren (11-15-2012),HazZzE (11-30-2012),KnooBoLT (11-06-2012),lewisbibo (11-25-2012),NovemberJames (11-05-2012),pionkjeffery (11-05-2012),qwerty765890 (11-06-2012),Skinksteek (11-06-2012),Tobias Atis (11-06-2012),true1495 (11-10-2012),Vokul Services (12-27-2012)

  3. #2
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    /Approved


    CoD Minion from 09/19/2012 to 01/10/2013

  4. The Following User Says Thank You to MarkHC For This Useful Post:

    Geomatrical 0 (11-05-2012)

  5. #3
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Updated memory class? Perfect.
    +rep (Can't atm...)

    I see you added thisI was having a little problem with it but...seems simple now xD)
    Code:
            public void WriteFloat(int Address, float Value)
            {
                byte[] buffer = BitConverter.GetBytes(Value);
                IntPtr R;
                WriteProcessMemory(Open_Memory(), (IntPtr)Address, buffer, (uint)buffer.Length, out R);
            }
    
            public float ReadFloat(uint Address)
            {
                byte[] buffer = new byte[8];
                IntPtr R;
                ReadProcessMemory(Open_Memory(), (IntPtr)Address, buffer, 8, out R);
                return BitConverter.ToSingle(buffer, 0);
            }
    Last edited by Kenshin13; 11-04-2012 at 08:23 PM.

  6. #4
    master131's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    Melbourne, Australia
    Posts
    8,858
    Reputation
    3438
    Thanks
    101,668
    My Mood
    Breezy
    Just a handy tip, a float is 4 bytes, not 8.
    Donate:
    BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9


    Handy Tools/Hacks:
    Extreme Injector v3.7.3
    A powerful and advanced injector in a simple GUI.
    Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!

    Minion Since: 13th January 2011
    Moderator Since: 6th May 2011
    Global Moderator Since: 29th April 2012
    Super User/Unknown Since: 23rd July 2013
    'Game Hacking' Team Since: 30th July 2013

    --My Art--
    [Roxas - Pixel Art, WIP]
    [Natsu - Drawn]
    [Natsu - Coloured]


    All drawings are coloured using Photoshop.

    --Gifts--
    [Kyle]

  7. The Following 3 Users Say Thank You to master131 For This Useful Post:

    barata55 (11-04-2012),Geomatrical 0 (11-05-2012),Kenshin13 (11-05-2012)

  8. #5
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by master131 View Post
    Just a handy tip, a float is 4 bytes, not 8.
    Hmm, suppose.
    Well, forgot to fix it, else I would use the BitConverter :P

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  9. The Following 2 Users Say Thank You to Jorndel For This Useful Post:

    Geomatrical 0 (11-07-2012),Skinksteek (11-07-2012)

  10. #6
    Violence begets violence, so why give it back?
    MPGH Member
    Skinksteek's Avatar
    Join Date
    Aug 2012
    Gender
    male
    Location
    In a Care Package
    Posts
    497
    Reputation
    30
    Thanks
    623
    My Mood
    Angelic
    A sick question, but..

    VB.net, C# or C++?

    ---------- Post added at 03:42 PM ---------- Previous post was at 03:38 PM ----------

    Nevah mind.
    Made by @Jorndel


    [IMG]https://www.danasof*****m/sig/Trololol132237.jpg[/IMG]


    Leecher: 0 []
    Choob: 25 []
    Newbie: 50 []
    Member: 100 []
    Advanced Member: 150 []
    Dual-Keyboard Member: 250 []
    Expert Member: 500 []
    Bobo's Trainer: 750 [X]
    MPGH Expert: 1000 [X]
    Synthetic Hacker: 1250 [X]
    Blackhat Hacker: 1500 [X]
    Whitehat Hacker: 2000 [X]
    Bobo's Guardian: 2500 [X]
    Upcoming MPGHiean: 3000 [X]
    MPGH Addict: 3500 [X]
    MPGHiean: 4000 [X]
    MPGH Knight: 4500 [X]
    MPGH Lord: 5000 [X]
    MPGH Champion: 5500 [X]
    MPGH King: 6000 [X]
    "Wish me a good luck."

  11. #7
    Geomatrical 0's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    Hogwarts.
    Posts
    180
    Reputation
    10
    Thanks
    144
    Quote Originally Posted by Skinksteek View Post
    A sick question, but..

    VB.net, C# or C++?

    ---------- Post added at 03:42 PM ---------- Previous post was at 03:38 PM ----------

    Nevah mind.
    I beleive it's C# young one


    ---------- Post added at 09:16 AM ---------- Previous post was at 09:14 AM ----------

    Quote Originally Posted by master131 View Post
    Just a handy tip, a float is 4 bytes, not 8.
    And it can also be 2-bytes I figure

  12. #8
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Two bytes (in BCD) only has a range of 999 to 0.0000000000000001.... I think.
    58.8 => 588 * (10^-1) = 0x1588
    6.94 => 294 * (10^-2) = 0x2694
    etc..

  13. #9
    Slendyy's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    Unknown
    Posts
    1,322
    Reputation
    10
    Thanks
    306
    My Mood
    Cool
    Quote Originally Posted by Kenshin13 View Post
    Two bytes (in BCD) only has a range of 999 to 0.0000000000000001.... I think.
    58.8 => 588 * (10^-1) = 0x1588
    6.94 => 294 * (10^-2) = 0x2694

    etc..
    I'm guessing you're wrong

  14. The Following User Says Thank You to Slendyy For This Useful Post:

    Kenshin13 (11-07-2012)

  15. #10
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Only way I found so far to store a float in 2 bytes:

    Code:
    // Branch-free implementation of half-precision (16 bit) floating point
    // Copyright 2006 Mike Acton <macton@gmail.com>
    // 
    // Permission is hereby granted, free of charge, to any person obtaining a 
    // copy of this software and associated documentation files (the "Software"),
    // to deal in the Software without restriction, including without limitation
    // the rights to use, copy, modify, merge, publish, distribute, sublicense, 
    // and/or sell copies of the Software, and to permit persons to whom the 
    // Software is furnished to do so, subject to the following conditions:
    // 
    // The above copyright notice and this permission notice shall be included 
    // in all copies or substantial portions of the Software.
    // 
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    // THE SOFTWARE
    //
    // Half-precision floating point format
    // ------------------------------------
    //
    //   | Field    | Last | First | Note
    //   |----------|------|-------|----------
    //   | Sign     | 15   | 15    |
    //   | Exponent | 14   | 10    | Bias = 15
    //   | Mantissa | 9    | 0     |
    //
    // Compiling
    // ---------
    //
    //  Preferred compile flags for GCC: 
    //     -O3 -fstrict-aliasing -std=c99 -pedantic -Wall -Wstrict-aliasing
    //
    //     This file is a C99 source file, intended to be compiled with a C99 
    //     compliant compiler. However, for the moment it remains combatible
    //     with C++98. Therefore if you are using a compiler that poorly implements
    //     C standards (e.g. MSVC), it may be compiled as C++. This is not
    //     guaranteed for future versions. 
    //
    
    
    // Load immediate
    static inline uint32_t _uint32_li( uint32_t a )
    {
      return (a);
    }
    
    // Decrement
    static inline uint32_t _uint32_dec( uint32_t a )
    {
      return (a - 1);
    }
    
    // Increment
    static inline uint32_t _uint32_inc( uint32_t a )
    {
      return (a + 1);
    }
    
    // Complement
    static inline uint32_t _uint32_not( uint32_t a )
    {
      return (~a);
    }
    
    // Negate
    static inline uint32_t _uint32_neg( uint32_t a )
    {
      return (-a);
    }
    
    // Extend sign
    static inline uint32_t _uint32_ext( uint32_t a )
    {
      return (((int32_t)a)>>31);
    }
    
    // And
    static inline uint32_t _uint32_and( uint32_t a, uint32_t b )
    {
      return (a & b);
    }
    
    // Exclusive Or
    static inline uint32_t _uint32_xor( uint32_t a, uint32_t b )
    {
      return (a ^ b);
    }
    
    // And with Complement
    static inline uint32_t _uint32_andc( uint32_t a, uint32_t b )
    {
      return (a & ~b);
    }
    
    // Or
    static inline uint32_t _uint32_or( uint32_t a, uint32_t b )
    {
      return (a | b);
    }
    
    // Shift Right Logical
    static inline uint32_t _uint32_srl( uint32_t a, int sa )
    {
      return (a >> sa);
    }
    
    // Shift Left Logical
    static inline uint32_t _uint32_sll( uint32_t a, int sa )
    {
      return (a << sa);
    }
    
    // Add
    static inline uint32_t _uint32_add( uint32_t a, uint32_t b )
    {
      return (a + b);
    }
    
    // Subtract
    static inline uint32_t _uint32_sub( uint32_t a, uint32_t b )
    {
      return (a - b);
    }
    
    // Multiply
    static inline uint32_t _uint32_mul( uint32_t a, uint32_t b )
    {
      return (a * b);
    }
    
    // Select on Sign bit
    static inline uint32_t _uint32_sels( uint32_t test, uint32_t a, uint32_t b )
    {
      const uint32_t mask   = _uint32_ext( test );
      const uint32_t sel_a  = _uint32_and(  a,     mask  );
      const uint32_t sel_b  = _uint32_andc( b,     mask  );
      const uint32_t result = _uint32_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Select Bits on mask
    static inline uint32_t _uint32_selb( uint32_t mask, uint32_t a, uint32_t b )
    {
      const uint32_t sel_a  = _uint32_and(  a,     mask  );
      const uint32_t sel_b  = _uint32_andc( b,     mask  );
      const uint32_t result = _uint32_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Load Immediate
    static inline uint16_t _uint16_li( uint16_t a )
    {
      return (a);
    }
    
    // Extend sign
    static inline uint16_t _uint16_ext( uint16_t a )
    {
      return (((int16_t)a)>>15);
    }
    
    // Negate
    static inline uint16_t _uint16_neg( uint16_t a )
    {
      return (-a);
    }
    
    // Complement
    static inline uint16_t _uint16_not( uint16_t a )
    {
      return (~a);
    }
    
    // Decrement
    static inline uint16_t _uint16_dec( uint16_t a )
    {
      return (a - 1);
    }
    
    // Shift Left Logical
    static inline uint16_t _uint16_sll( uint16_t a, int sa )
    {
      return (a << sa);
    }
    
    // Shift Right Logical
    static inline uint16_t _uint16_srl( uint16_t a, int sa )
    {
      return (a >> sa);
    }
    
    // Add
    static inline uint16_t _uint16_add( uint16_t a, uint16_t b )
    {
      return (a + b);
    }
    
    // Subtract
    static inline uint16_t _uint16_sub( uint16_t a, uint16_t b )
    {
      return (a - b);
    }
    
    // And
    static inline uint16_t _uint16_and( uint16_t a, uint16_t b )
    {
      return (a & b);
    }
    
    // Or
    static inline uint16_t _uint16_or( uint16_t a, uint16_t b )
    {
      return (a | b);
    }
    
    // Exclusive Or
    static inline uint16_t _uint16_xor( uint16_t a, uint16_t b )
    {
      return (a ^ b);
    }
    
    // And with Complement
    static inline uint16_t _uint16_andc( uint16_t a, uint16_t b )
    {
      return (a & ~b);
    }
    
    // And then Shift Right Logical
    static inline uint16_t _uint16_andsrl( uint16_t a, uint16_t b, int sa )
    {
      return ((a & b) >> sa);
    }
    
    // Shift Right Logical then Mask
    static inline uint16_t _uint16_srlm( uint16_t a, int sa, uint16_t mask )
    {
      return ((a >> sa) & mask);
    }
    
    // Add then Mask
    static inline uint16_t _uint16_addm( uint16_t a, uint16_t b, uint16_t mask )
    {
      return ((a + b) & mask);
    }
    
    
    // Select on Sign bit
    static inline uint16_t _uint16_sels( uint16_t test, uint16_t a, uint16_t b )
    {
      const uint16_t mask   = _uint16_ext( test );
      const uint16_t sel_a  = _uint16_and(  a,     mask  );
      const uint16_t sel_b  = _uint16_andc( b,     mask  );
      const uint16_t result = _uint16_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Count Leading Zeros
    static inline uint32_t _uint32_cntlz( uint32_t x )
    {
    #ifdef __GNUC__
      /* NOTE: __builtin_clz is undefined for x == 0 */
      /* On PowerPC, this will map to insn: cntlzw   */
      /* On Pentium, this will map to insn: clz      */
      uint32_t is_x_nez_msb = _uint32_neg( x );
      uint32_t nlz          = __builtin_clz( x );
      uint32_t result       = _uint32_sels( is_x_nez_msb, nlz, 0x00000020 );
      return (result);
    #else
      const uint32_t x0  = _uint32_srl(  x,  1 );
      const uint32_t x1  = _uint32_or(   x,  x0 );
      const uint32_t x2  = _uint32_srl(  x1, 2 );
      const uint32_t x3  = _uint32_or(   x1, x2 );
      const uint32_t x4  = _uint32_srl(  x3, 4 );
      const uint32_t x5  = _uint32_or(   x3, x4 );
      const uint32_t x6  = _uint32_srl(  x5, 8 );
      const uint32_t x7  = _uint32_or(   x5, x6 );
      const uint32_t x8  = _uint32_srl(  x7, 16 );
      const uint32_t x9  = _uint32_or(   x7, x8 );
      const uint32_t xA  = _uint32_not(  x9 );
      const uint32_t xB  = _uint32_srl(  xA, 1 );
      const uint32_t xC  = _uint32_and(  xB, 0x55555555 );
      const uint32_t xD  = _uint32_sub(  xA, xC );
      const uint32_t xE  = _uint32_and(  xD, 0x33333333 );
      const uint32_t xF  = _uint32_srl(  xD, 2 );
      const uint32_t x10 = _uint32_and(  xF, 0x33333333 );
      const uint32_t x11 = _uint32_add(  xE, x10 );
      const uint32_t x12 = _uint32_srl(  x11, 4 );
      const uint32_t x13 = _uint32_add(  x11, x12 );
      const uint32_t x14 = _uint32_and(  x13, 0x0f0f0f0f );
      const uint32_t x15 = _uint32_srl(  x14, 8 );
      const uint32_t x16 = _uint32_add(  x14, x15 );
      const uint32_t x17 = _uint32_srl(  x16, 16 );
      const uint32_t x18 = _uint32_add(  x16, x17 );
      const uint32_t x19 = _uint32_and(  x18, 0x0000003f );
      return ( x19 );
    #endif
    }
    
    // Count Leading Zeros
    static inline uint16_t _uint16_cntlz( uint16_t x )
    {
    #ifdef __GNUC__
      uint16_t nlz32 = (uint16_t)_uint32_cntlz( (uint32_t)x );
      uint32_t nlz   = _uint32_sub( nlz32, 16 );
      return (nlz);
    #else
      const uint16_t x0  = _uint16_srl(  x,  1 );
      const uint16_t x1  = _uint16_or(   x,  x0 );
      const uint16_t x2  = _uint16_srl(  x1, 2 );
      const uint16_t x3  = _uint16_or(   x1, x2 );
      const uint16_t x4  = _uint16_srl(  x3, 4 );
      const uint16_t x5  = _uint16_or(   x3, x4 );
      const uint16_t x6  = _uint16_srl(  x5, 8 );
      const uint16_t x7  = _uint16_or(   x5, x6 );
      const uint16_t x8  = _uint16_not(  x7 );
      const uint16_t x9  = _uint16_srlm( x8, 1, 0x5555 );
      const uint16_t xA  = _uint16_sub(  x8, x9 );
      const uint16_t xB  = _uint16_and(  xA, 0x3333 );
      const uint16_t xC  = _uint16_srlm( xA, 2, 0x3333 );
      const uint16_t xD  = _uint16_add(  xB, xC );
      const uint16_t xE  = _uint16_srl(  xD, 4 );
      const uint16_t xF  = _uint16_addm( xD, xE, 0x0f0f );
      const uint16_t x10 = _uint16_srl(  xF, 8 );
      const uint16_t x11 = _uint16_addm( xF, x10, 0x001f );
      return ( x11 );
    #endif
    }
    
    uint16_t
    half_from_float( uint32_t f )
    {
      const uint32_t one                        = _uint32_li( 0x00000001 );
      const uint32_t f_s_mask                   = _uint32_li( 0x80000000 );
      const uint32_t f_e_mask                   = _uint32_li( 0x7f800000 );
      const uint32_t f_m_mask                   = _uint32_li( 0x007fffff );
      const uint32_t f_m_hidden_bit             = _uint32_li( 0x00800000 );
      const uint32_t f_m_round_bit              = _uint32_li( 0x00001000 );
      const uint32_t f_snan_mask                = _uint32_li( 0x7fc00000 );
      const uint32_t f_e_pos                    = _uint32_li( 0x00000017 );
      const uint32_t h_e_pos                    = _uint32_li( 0x0000000a );
      const uint32_t h_e_mask                   = _uint32_li( 0x00007c00 );
      const uint32_t h_snan_mask                = _uint32_li( 0x00007e00 );
      const uint32_t h_e_mask_value             = _uint32_li( 0x0000001f );
      const uint32_t f_h_s_pos_offset           = _uint32_li( 0x00000010 );
      const uint32_t f_h_bias_offset            = _uint32_li( 0x00000070 );
      const uint32_t f_h_m_pos_offset           = _uint32_li( 0x0000000d );
      const uint32_t h_nan_min                  = _uint32_li( 0x00007c01 );
      const uint32_t f_h_e_biased_flag          = _uint32_li( 0x0000008f );
      const uint32_t f_s                        = _uint32_and( f,               f_s_mask         );
      const uint32_t f_e                        = _uint32_and( f,               f_e_mask         );
      const uint16_t h_s                        = _uint32_srl( f_s,             f_h_s_pos_offset );
      const uint32_t f_m                        = _uint32_and( f,               f_m_mask         );
      const uint16_t f_e_amount                 = _uint32_srl( f_e,             f_e_pos          );
      const uint32_t f_e_half_bias              = _uint32_sub( f_e_amount,      f_h_bias_offset  );
      const uint32_t f_snan                     = _uint32_and( f,               f_snan_mask      );
      const uint32_t f_m_round_mask             = _uint32_and( f_m,             f_m_round_bit    );
      const uint32_t f_m_round_offset           = _uint32_sll( f_m_round_mask,  one              );
      const uint32_t f_m_rounded                = _uint32_add( f_m,             f_m_round_offset );
      const uint32_t f_m_denorm_sa              = _uint32_sub( one,             f_e_half_bias    );
      const uint32_t f_m_with_hidden            = _uint32_or(  f_m_rounded,     f_m_hidden_bit   );
      const uint32_t f_m_denorm                 = _uint32_srl( f_m_with_hidden, f_m_denorm_sa    );
      const uint32_t h_m_denorm                 = _uint32_srl( f_m_denorm,      f_h_m_pos_offset );
      const uint32_t f_m_rounded_overflow       = _uint32_and( f_m_rounded,     f_m_hidden_bit   );
      const uint32_t m_nan                      = _uint32_srl( f_m,             f_h_m_pos_offset );
      const uint32_t h_em_nan                   = _uint32_or(  h_e_mask,        m_nan            );
      const uint32_t h_e_norm_overflow_offset   = _uint32_inc( f_e_half_bias );
      const uint32_t h_e_norm_overflow          = _uint32_sll( h_e_norm_overflow_offset, h_e_pos          );
      const uint32_t h_e_norm                   = _uint32_sll( f_e_half_bias,            h_e_pos          );
      const uint32_t h_m_norm                   = _uint32_srl( f_m_rounded,              f_h_m_pos_offset );
      const uint32_t h_em_norm                  = _uint32_or(  h_e_norm,                 h_m_norm         );
      const uint32_t is_h_ndenorm_msb           = _uint32_sub( f_h_bias_offset,   f_e_amount    );
      const uint32_t is_f_e_flagged_msb         = _uint32_sub( f_h_e_biased_flag, f_e_half_bias );
      const uint32_t is_h_denorm_msb            = _uint32_not( is_h_ndenorm_msb );
      const uint32_t is_f_m_eqz_msb             = _uint32_dec( f_m   );
      const uint32_t is_h_nan_eqz_msb           = _uint32_dec( m_nan );
      const uint32_t is_f_inf_msb               = _uint32_and( is_f_e_flagged_msb, is_f_m_eqz_msb   );
      const uint32_t is_f_nan_underflow_msb     = _uint32_and( is_f_e_flagged_msb, is_h_nan_eqz_msb );
      const uint32_t is_e_overflow_msb          = _uint32_sub( h_e_mask_value,     f_e_half_bias    );
      const uint32_t is_h_inf_msb               = _uint32_or(  is_e_overflow_msb,  is_f_inf_msb     );
      const uint32_t is_f_nsnan_msb             = _uint32_sub( f_snan,             f_snan_mask      );
      const uint32_t is_m_norm_overflow_msb     = _uint32_neg( f_m_rounded_overflow );
      const uint32_t is_f_snan_msb              = _uint32_not( is_f_nsnan_msb );
      const uint32_t h_em_overflow_result       = _uint32_sels( is_m_norm_overflow_msb, h_e_norm_overflow, h_em_norm                 );
      const uint32_t h_em_nan_result            = _uint32_sels( is_f_e_flagged_msb,     h_em_nan,          h_em_overflow_result      );
      const uint32_t h_em_nan_underflow_result  = _uint32_sels( is_f_nan_underflow_msb, h_nan_min,         h_em_nan_result           );
      const uint32_t h_em_inf_result            = _uint32_sels( is_h_inf_msb,           h_e_mask,          h_em_nan_underflow_result );
      const uint32_t h_em_denorm_result         = _uint32_sels( is_h_denorm_msb,        h_m_denorm,        h_em_inf_result           );
      const uint32_t h_em_snan_result           = _uint32_sels( is_f_snan_msb,          h_snan_mask,       h_em_denorm_result        );
      const uint32_t h_result                   = _uint32_or( h_s, h_em_snan_result );
    
      return (uint16_t)(h_result);
    }
    
    uint32_t 
    half_to_float( uint16_t h )
    {
      const uint32_t h_e_mask              = _uint32_li( 0x00007c00 );
      const uint32_t h_m_mask              = _uint32_li( 0x000003ff );
      const uint32_t h_s_mask              = _uint32_li( 0x00008000 );
      const uint32_t h_f_s_pos_offset      = _uint32_li( 0x00000010 );
      const uint32_t h_f_e_pos_offset      = _uint32_li( 0x0000000d );
      const uint32_t h_f_bias_offset       = _uint32_li( 0x0001c000 );
      const uint32_t f_e_mask              = _uint32_li( 0x7f800000 );
      const uint32_t f_m_mask              = _uint32_li( 0x007fffff );
      const uint32_t h_f_e_denorm_bias     = _uint32_li( 0x0000007e );
      const uint32_t h_f_m_denorm_sa_bias  = _uint32_li( 0x00000008 );
      const uint32_t f_e_pos               = _uint32_li( 0x00000017 );
      const uint32_t h_e_mask_minus_one    = _uint32_li( 0x00007bff );
      const uint32_t h_e                   = _uint32_and( h, h_e_mask );
      const uint32_t h_m                   = _uint32_and( h, h_m_mask );
      const uint32_t h_s                   = _uint32_and( h, h_s_mask );
      const uint32_t h_e_f_bias            = _uint32_add( h_e, h_f_bias_offset );
      const uint32_t h_m_nlz               = _uint32_cntlz( h_m );
      const uint32_t f_s                   = _uint32_sll( h_s,        h_f_s_pos_offset );
      const uint32_t f_e                   = _uint32_sll( h_e_f_bias, h_f_e_pos_offset );
      const uint32_t f_m                   = _uint32_sll( h_m,        h_f_e_pos_offset );
      const uint32_t f_em                  = _uint32_or(  f_e,        f_m              );
      const uint32_t h_f_m_sa              = _uint32_sub( h_m_nlz,             h_f_m_denorm_sa_bias );
      const uint32_t f_e_denorm_unpacked   = _uint32_sub( h_f_e_denorm_bias,   h_f_m_sa             );
      const uint32_t h_f_m                 = _uint32_sll( h_m,                 h_f_m_sa             );
      const uint32_t f_m_denorm            = _uint32_and( h_f_m,               f_m_mask             );
      const uint32_t f_e_denorm            = _uint32_sll( f_e_denorm_unpacked, f_e_pos              );
      const uint32_t f_em_denorm           = _uint32_or(  f_e_denorm,          f_m_denorm           );
      const uint32_t f_em_nan              = _uint32_or(  f_e_mask,            f_m                  );
      const uint32_t is_e_eqz_msb          = _uint32_dec(  h_e );
      const uint32_t is_m_nez_msb          = _uint32_neg(  h_m );
      const uint32_t is_e_flagged_msb      = _uint32_sub(  h_e_mask_minus_one, h_e );
      const uint32_t is_zero_msb           = _uint32_andc( is_e_eqz_msb,       is_m_nez_msb );
      const uint32_t is_inf_msb            = _uint32_andc( is_e_flagged_msb,   is_m_nez_msb );
      const uint32_t is_denorm_msb         = _uint32_and(  is_m_nez_msb,       is_e_eqz_msb );
      const uint32_t is_nan_msb            = _uint32_and(  is_e_flagged_msb,   is_m_nez_msb ); 
      const uint32_t is_zero               = _uint32_ext(  is_zero_msb );
      const uint32_t f_zero_result         = _uint32_andc( f_em, is_zero );
      const uint32_t f_denorm_result       = _uint32_sels( is_denorm_msb, f_em_denorm, f_zero_result );
      const uint32_t f_inf_result          = _uint32_sels( is_inf_msb,    f_e_mask,    f_denorm_result );
      const uint32_t f_nan_result          = _uint32_sels( is_nan_msb,    f_em_nan,    f_inf_result    );
      const uint32_t f_result              = _uint32_or( f_s, f_nan_result );
     
      return (f_result);
    }
    
    // half_add
    // --------
    //
    //  (SUM)        uint16_t z = half_add( x, y );
    //  (DIFFERENCE) uint16_t z = half_add( x, -y );
    //
    //  * Difference of ZEROs is always +ZERO
    //  * Sum round with guard + round + sticky bit (grs)
    //  * QNaN + <x>  = QNaN
    //  * <x>  + +INF = +INF
    //  * <x>  - -INF = -INF
    //  * INF  - INF  = SNaN
    //
    //  Will have exactly (0 ulps difference) the same result as:
    //  (Round up)
    //
    //     union FLOAT_32
    //     {
    //       float    f32;
    //       uint32_t u32;
    //     };
    //
    //     union FLOAT_32 fx = { .u32 = half_to_float( x ) };
    //     union FLOAT_32 fy = { .u32 = half_to_float( y ) };
    //     union FLOAT_32 fz = { .f32 = fx.f32 + fy.f32    };
    //     uint16_t       z  = float_to_half( fz );
    //
    uint16_t
    half_add( uint16_t x, uint16_t y )
    {
      const uint16_t one                       = _uint16_li( 0x0001 );
      const uint16_t msb_to_lsb_sa             = _uint16_li( 0x000f );
      const uint16_t h_s_mask                  = _uint16_li( 0x8000 );
      const uint16_t h_e_mask                  = _uint16_li( 0x7c00 );
      const uint16_t h_m_mask                  = _uint16_li( 0x03ff );
      const uint16_t h_m_msb_mask              = _uint16_li( 0x2000 );
      const uint16_t h_m_msb_sa                = _uint16_li( 0x000d );
      const uint16_t h_m_hidden                = _uint16_li( 0x0400 );
      const uint16_t h_e_pos                   = _uint16_li( 0x000a );
      const uint16_t h_e_bias_minus_one        = _uint16_li( 0x000e );
      const uint16_t h_m_grs_carry             = _uint16_li( 0x4000 );
      const uint16_t h_m_grs_carry_pos         = _uint16_li( 0x000e );
      const uint16_t h_grs_size                = _uint16_li( 0x0003 );
      const uint16_t h_snan                    = _uint16_li( 0xfe00 );
      const uint16_t h_e_mask_minus_one        = _uint16_li( 0x7bff );
      const uint16_t h_grs_round_carry         = _uint16_sll( one, h_grs_size );
      const uint16_t h_grs_round_mask          = _uint16_sub( h_grs_round_carry, one );
      const uint16_t x_e                       = _uint16_and( x, h_e_mask );
      const uint16_t y_e                       = _uint16_and( y, h_e_mask );
      const uint16_t is_y_e_larger_msb         = _uint16_sub( x_e, y_e );
      const uint16_t a                         = _uint16_sels( is_y_e_larger_msb, y, x);
      const uint16_t a_s                       = _uint16_and( a, h_s_mask );
      const uint16_t a_e                       = _uint16_and( a, h_e_mask );
      const uint16_t a_m_no_hidden_bit         = _uint16_and( a, h_m_mask );
      const uint16_t a_em_no_hidden_bit        = _uint16_or( a_e, a_m_no_hidden_bit );
      const uint16_t b                         = _uint16_sels( is_y_e_larger_msb, x, y);
      const uint16_t b_s                       = _uint16_and( b, h_s_mask );
      const uint16_t b_e                       = _uint16_and( b, h_e_mask );
      const uint16_t b_m_no_hidden_bit         = _uint16_and( b, h_m_mask );
      const uint16_t b_em_no_hidden_bit        = _uint16_or( b_e, b_m_no_hidden_bit );
      const uint16_t is_diff_sign_msb          = _uint16_xor( a_s, b_s );
      const uint16_t is_a_inf_msb              = _uint16_sub( h_e_mask_minus_one, a_em_no_hidden_bit );
      const uint16_t is_b_inf_msb              = _uint16_sub( h_e_mask_minus_one, b_em_no_hidden_bit );
      const uint16_t is_undenorm_msb           = _uint16_dec( a_e );
      const uint16_t is_undenorm               = _uint16_ext( is_undenorm_msb );
      const uint16_t is_both_inf_msb           = _uint16_and( is_a_inf_msb, is_b_inf_msb );
      const uint16_t is_invalid_inf_op_msb     = _uint16_and( is_both_inf_msb, b_s );
      const uint16_t is_a_e_nez_msb            = _uint16_neg( a_e );
      const uint16_t is_b_e_nez_msb            = _uint16_neg( b_e );
      const uint16_t is_a_e_nez                = _uint16_ext( is_a_e_nez_msb );
      const uint16_t is_b_e_nez                = _uint16_ext( is_b_e_nez_msb );
      const uint16_t a_m_hidden_bit            = _uint16_and( is_a_e_nez, h_m_hidden );
      const uint16_t b_m_hidden_bit            = _uint16_and( is_b_e_nez, h_m_hidden );
      const uint16_t a_m_no_grs                = _uint16_or( a_m_no_hidden_bit, a_m_hidden_bit );
      const uint16_t b_m_no_grs                = _uint16_or( b_m_no_hidden_bit, b_m_hidden_bit );
      const uint16_t diff_e                    = _uint16_sub( a_e,        b_e );
      const uint16_t a_e_unbias                = _uint16_sub( a_e,        h_e_bias_minus_one );
      const uint16_t a_m                       = _uint16_sll( a_m_no_grs, h_grs_size );
      const uint16_t a_e_biased                = _uint16_srl( a_e,        h_e_pos );
      const uint16_t m_sa_unbias               = _uint16_srl( a_e_unbias, h_e_pos );
      const uint16_t m_sa_default              = _uint16_srl( diff_e,     h_e_pos );
      const uint16_t m_sa_unbias_mask          = _uint16_andc( is_a_e_nez_msb,   is_b_e_nez_msb );
      const uint16_t m_sa                      = _uint16_sels( m_sa_unbias_mask, m_sa_unbias, m_sa_default );
      const uint16_t b_m_no_sticky             = _uint16_sll( b_m_no_grs,        h_grs_size );
      const uint16_t sh_m                      = _uint16_srl( b_m_no_sticky,     m_sa );
      const uint16_t sticky_overflow           = _uint16_sll( one,               m_sa );
      const uint16_t sticky_mask               = _uint16_dec( sticky_overflow );
      const uint16_t sticky_collect            = _uint16_and( b_m_no_sticky, sticky_mask );
      const uint16_t is_sticky_set_msb         = _uint16_neg( sticky_collect );
      const uint16_t sticky                    = _uint16_srl( is_sticky_set_msb, msb_to_lsb_sa);
      const uint16_t b_m                       = _uint16_or( sh_m, sticky );
      const uint16_t is_c_m_ab_pos_msb         = _uint16_sub( b_m, a_m );
      const uint16_t c_inf                     = _uint16_or( a_s, h_e_mask );
      const uint16_t c_m_sum                   = _uint16_add( a_m, b_m );
      const uint16_t c_m_diff_ab               = _uint16_sub( a_m, b_m );
      const uint16_t c_m_diff_ba               = _uint16_sub( b_m, a_m );
      const uint16_t c_m_smag_diff             = _uint16_sels( is_c_m_ab_pos_msb, c_m_diff_ab, c_m_diff_ba );
      const uint16_t c_s_diff                  = _uint16_sels( is_c_m_ab_pos_msb, a_s,         b_s         );
      const uint16_t c_s                       = _uint16_sels( is_diff_sign_msb,  c_s_diff,    a_s         );
      const uint16_t c_m_smag_diff_nlz         = _uint16_cntlz( c_m_smag_diff );
      const uint16_t diff_norm_sa              = _uint16_sub( c_m_smag_diff_nlz, one );
      const uint16_t is_diff_denorm_msb        = _uint16_sub( a_e_biased, diff_norm_sa );
      const uint16_t is_diff_denorm            = _uint16_ext( is_diff_denorm_msb );
      const uint16_t is_a_or_b_norm_msb        = _uint16_neg( a_e_biased );
      const uint16_t diff_denorm_sa            = _uint16_dec( a_e_biased );
      const uint16_t c_m_diff_denorm           = _uint16_sll( c_m_smag_diff, diff_denorm_sa );
      const uint16_t c_m_diff_norm             = _uint16_sll( c_m_smag_diff, diff_norm_sa );
      const uint16_t c_e_diff_norm             = _uint16_sub( a_e_biased,  diff_norm_sa );
      const uint16_t c_m_diff_ab_norm          = _uint16_sels( is_diff_denorm_msb, c_m_diff_denorm, c_m_diff_norm );
      const uint16_t c_e_diff_ab_norm          = _uint16_andc( c_e_diff_norm, is_diff_denorm );
      const uint16_t c_m_diff                  = _uint16_sels( is_a_or_b_norm_msb, c_m_diff_ab_norm, c_m_smag_diff );
      const uint16_t c_e_diff                  = _uint16_sels( is_a_or_b_norm_msb, c_e_diff_ab_norm, a_e_biased    );
      const uint16_t is_diff_eqz_msb           = _uint16_dec( c_m_diff );
      const uint16_t is_diff_exactly_zero_msb  = _uint16_and( is_diff_sign_msb, is_diff_eqz_msb );
      const uint16_t is_diff_exactly_zero      = _uint16_ext( is_diff_exactly_zero_msb );
      const uint16_t c_m_added                 = _uint16_sels( is_diff_sign_msb, c_m_diff, c_m_sum );
      const uint16_t c_e_added                 = _uint16_sels( is_diff_sign_msb, c_e_diff, a_e_biased );
      const uint16_t c_m_carry                 = _uint16_and( c_m_added, h_m_grs_carry );
      const uint16_t is_c_m_carry_msb          = _uint16_neg( c_m_carry );
      const uint16_t c_e_hidden_offset         = _uint16_andsrl( c_m_added, h_m_grs_carry, h_m_grs_carry_pos );
      const uint16_t c_m_sub_hidden            = _uint16_srl( c_m_added, one );
      const uint16_t c_m_no_hidden             = _uint16_sels( is_c_m_carry_msb, c_m_sub_hidden, c_m_added );
      const uint16_t c_e_no_hidden             = _uint16_add( c_e_added,         c_e_hidden_offset  );
      const uint16_t c_m_no_hidden_msb         = _uint16_and( c_m_no_hidden,     h_m_msb_mask       );
      const uint16_t undenorm_m_msb_odd        = _uint16_srl( c_m_no_hidden_msb, h_m_msb_sa         );
      const uint16_t undenorm_fix_e            = _uint16_and( is_undenorm,       undenorm_m_msb_odd );
      const uint16_t c_e_fixed                 = _uint16_add( c_e_no_hidden,     undenorm_fix_e     );
      const uint16_t c_m_round_amount          = _uint16_and( c_m_no_hidden,     h_grs_round_mask   );
      const uint16_t c_m_rounded               = _uint16_add( c_m_no_hidden,     c_m_round_amount   );
      const uint16_t c_m_round_overflow        = _uint16_andsrl( c_m_rounded, h_m_grs_carry, h_m_grs_carry_pos );
      const uint16_t c_e_rounded               = _uint16_add( c_e_fixed, c_m_round_overflow );
      const uint16_t c_m_no_grs                = _uint16_srlm( c_m_rounded, h_grs_size,  h_m_mask );
      const uint16_t c_e                       = _uint16_sll( c_e_rounded, h_e_pos );
      const uint16_t c_em                      = _uint16_or( c_e, c_m_no_grs );
      const uint16_t c_normal                  = _uint16_or( c_s, c_em );
      const uint16_t c_inf_result              = _uint16_sels( is_a_inf_msb, c_inf, c_normal );
      const uint16_t c_zero_result             = _uint16_andc( c_inf_result, is_diff_exactly_zero );
      const uint16_t c_result                  = _uint16_sels( is_invalid_inf_op_msb, h_snan, c_zero_result );
    
      return (c_result);
    }
    
    // half_mul
    // --------
    //
    //  May have 0 or 1 ulp difference from the following result:
    //  (Round to nearest) 
    //  NOTE: Rounding mode differs between conversion and multiply
    //
    //     union FLOAT_32
    //     {
    //       float    f32;
    //       uint32_t u32;
    //     };
    //
    //     union FLOAT_32 fx = { .u32 = half_to_float( x ) };
    //     union FLOAT_32 fy = { .u32 = half_to_float( y ) };
    //     union FLOAT_32 fz = { .f32 = fx.f32 * fy.f32    };
    //     uint16_t       z  = float_to_half( fz );
    //
    uint16_t
    half_mul( uint16_t x, uint16_t y )
    {
      const uint32_t one                                = _uint32_li( 0x00000001 );
      const uint32_t h_s_mask                           = _uint32_li( 0x00008000 );
      const uint32_t h_e_mask                           = _uint32_li( 0x00007c00 );
      const uint32_t h_m_mask                           = _uint32_li( 0x000003ff );
      const uint32_t h_m_hidden                         = _uint32_li( 0x00000400 );
      const uint32_t h_e_pos                            = _uint32_li( 0x0000000a );
      const uint32_t h_e_bias                           = _uint32_li( 0x0000000f );
      const uint32_t h_m_bit_count                      = _uint32_li( 0x0000000a );
      const uint32_t h_m_bit_half_count                 = _uint32_li( 0x00000005 );
      const uint32_t h_nan_min                          = _uint32_li( 0x00007c01 );
      const uint32_t h_e_mask_minus_one                 = _uint32_li( 0x00007bff );
      const uint32_t h_snan                             = _uint32_li( 0x0000fe00 );
      const uint32_t m_round_overflow_bit               = _uint32_li( 0x00000020 );
      const uint32_t m_hidden_bit                       = _uint32_li( 0x00100000 );
      const uint32_t a_s                                = _uint32_and(  x,   h_s_mask );
      const uint32_t b_s                                = _uint32_and(  y,   h_s_mask );
      const uint32_t c_s                                = _uint32_xor(  a_s, b_s      );
      const uint32_t x_e                                = _uint32_and(  x,   h_e_mask );
      const uint32_t x_e_eqz_msb                        = _uint32_dec(  x_e );
      const uint32_t a                                  = _uint32_sels( x_e_eqz_msb, y, x );
      const uint32_t b                                  = _uint32_sels( x_e_eqz_msb, x, y );
      const uint32_t a_e                                = _uint32_and(  a,   h_e_mask );
      const uint32_t b_e                                = _uint32_and(  b,   h_e_mask );
      const uint32_t a_m                                = _uint32_and(  a,   h_m_mask );
      const uint32_t b_m                                = _uint32_and(  b,   h_m_mask );
      const uint32_t a_e_amount                         = _uint32_srl(  a_e,                 h_e_pos                 );
      const uint32_t b_e_amount                         = _uint32_srl(  b_e,                 h_e_pos                 );
      const uint32_t a_m_with_hidden                    = _uint32_or(   a_m,                 h_m_hidden              );
      const uint32_t b_m_with_hidden                    = _uint32_or(   b_m,                 h_m_hidden              );
      const uint32_t c_m_normal                         = _uint32_mul(  a_m_with_hidden,     b_m_with_hidden         );
      const uint32_t c_m_denorm_biased                  = _uint32_mul(  a_m_with_hidden,     b_m                     );
      const uint32_t c_e_denorm_unbias_e                = _uint32_sub(  h_e_bias,            a_e_amount              );
      const uint32_t c_m_denorm_round_amount            = _uint32_and(  c_m_denorm_biased,   h_m_mask                );
      const uint32_t c_m_denorm_rounded                 = _uint32_add(  c_m_denorm_biased,   c_m_denorm_round_amount );
      const uint32_t c_m_denorm_inplace                 = _uint32_srl(  c_m_denorm_rounded,  h_m_bit_count           );
      const uint32_t c_m_denorm_unbiased                = _uint32_srl(  c_m_denorm_inplace,  c_e_denorm_unbias_e     );
      const uint32_t c_m_denorm                         = _uint32_and(  c_m_denorm_unbiased, h_m_mask                );
      const uint32_t c_e_amount_biased                  = _uint32_add(  a_e_amount,          b_e_amount              );
      const uint32_t c_e_amount_unbiased                = _uint32_sub(  c_e_amount_biased,   h_e_bias                );
      const uint32_t is_c_e_unbiased_underflow          = _uint32_ext(  c_e_amount_unbiased );
      const uint32_t c_e_underflow_half_sa              = _uint32_neg(  c_e_amount_unbiased );
      const uint32_t c_e_underflow_sa                   = _uint32_sll(  c_e_underflow_half_sa,     one );
      const uint32_t c_m_underflow                      = _uint32_srl(  c_m_normal,                c_e_underflow_sa );
      const uint32_t c_e_underflow_added                = _uint32_andc( c_e_amount_unbiased,       is_c_e_unbiased_underflow );
      const uint32_t c_m_underflow_added                = _uint32_selb( is_c_e_unbiased_underflow, c_m_underflow, c_m_normal );
      const uint32_t is_mul_overflow_test               = _uint32_and(  c_e_underflow_added, m_round_overflow_bit );
      const uint32_t is_mul_overflow_msb                = _uint32_neg(  is_mul_overflow_test );
      const uint32_t c_e_norm_radix_corrected           = _uint32_inc(  c_e_underflow_added );
      const uint32_t c_m_norm_radix_corrected           = _uint32_srl(  c_m_underflow_added, one );
      const uint32_t c_m_norm_hidden_bit                = _uint32_and(  c_m_norm_radix_corrected,  m_hidden_bit );
      const uint32_t is_c_m_norm_no_hidden_msb          = _uint32_dec(  c_m_norm_hidden_bit );
      const uint32_t c_m_norm_lo                        = _uint32_srl(  c_m_norm_radix_corrected, h_m_bit_half_count );
      const uint32_t c_m_norm_lo_nlz                    = _uint16_cntlz( c_m_norm_lo );
      const uint32_t is_c_m_hidden_nunderflow_msb       = _uint32_sub(  c_m_norm_lo_nlz, c_e_norm_radix_corrected );
      const uint32_t is_c_m_hidden_underflow_msb        = _uint32_not(  is_c_m_hidden_nunderflow_msb );
      const uint32_t is_c_m_hidden_underflow            = _uint32_ext(  is_c_m_hidden_underflow_msb  );
      const uint32_t c_m_hidden_underflow_normalized_sa = _uint32_srl(  c_m_norm_lo_nlz, one );
      const uint32_t c_m_hidden_underflow_normalized    = _uint32_sll(  c_m_norm_radix_corrected, c_m_hidden_underflow_normalized_sa );
      const uint32_t c_m_hidden_normalized              = _uint32_sll(  c_m_norm_radix_corrected, c_m_norm_lo_nlz );
      const uint32_t c_e_hidden_normalized              = _uint32_sub(  c_e_norm_radix_corrected, c_m_norm_lo_nlz );
      const uint32_t c_e_hidden                         = _uint32_andc( c_e_hidden_normalized, is_c_m_hidden_underflow );
      const uint32_t c_m_hidden                         = _uint32_sels( is_c_m_hidden_underflow_msb, c_m_hidden_underflow_normalized, c_m_hidden_normalized );
      const uint32_t c_m_normalized                     = _uint32_sels( is_c_m_norm_no_hidden_msb, c_m_hidden, c_m_norm_radix_corrected );
      const uint32_t c_e_normalized                     = _uint32_sels( is_c_m_norm_no_hidden_msb, c_e_hidden, c_e_norm_radix_corrected );
      const uint32_t c_m_norm_round_amount              = _uint32_and(  c_m_normalized, h_m_mask );
      const uint32_t c_m_norm_rounded                   = _uint32_add(  c_m_normalized, c_m_norm_round_amount );
      const uint32_t is_round_overflow_test             = _uint32_and(  c_e_normalized, m_round_overflow_bit  );
      const uint32_t is_round_overflow_msb              = _uint32_neg(  is_round_overflow_test );
      const uint32_t c_m_norm_inplace                   = _uint32_srl(  c_m_norm_rounded,    h_m_bit_count );
      const uint32_t c_m                                = _uint32_and(  c_m_norm_inplace,    h_m_mask      );
      const uint32_t c_e_norm_inplace                   = _uint32_sll(  c_e_normalized, h_e_pos       );
      const uint32_t c_e                                = _uint32_and(  c_e_norm_inplace,    h_e_mask      );
      const uint32_t c_em_nan                           = _uint32_or(   h_e_mask,  a_m        );
      const uint32_t c_nan                              = _uint32_or(   a_s,       c_em_nan   );
      const uint32_t c_denorm                           = _uint32_or(   c_s,       c_m_denorm );
      const uint32_t c_inf                              = _uint32_or(   c_s,       h_e_mask   );
      const uint32_t c_em_norm                          = _uint32_or(   c_e,       c_m        );
      const uint32_t is_a_e_flagged_msb                 = _uint32_sub(  h_e_mask_minus_one, a_e );
      const uint32_t is_b_e_flagged_msb                 = _uint32_sub(  h_e_mask_minus_one, b_e );
      const uint32_t is_a_e_eqz_msb                     = _uint32_dec(  a_e );
      const uint32_t is_a_m_eqz_msb                     = _uint32_dec(  a_m );
      const uint32_t is_b_e_eqz_msb                     = _uint32_dec(  b_e );
      const uint32_t is_b_m_eqz_msb                     = _uint32_dec(  b_m );
      const uint32_t is_b_eqz_msb                       = _uint32_and(  is_b_e_eqz_msb,          is_b_m_eqz_msb         );
      const uint32_t is_a_eqz_msb                       = _uint32_and(  is_a_e_eqz_msb,          is_a_m_eqz_msb         );
      const uint32_t is_c_nan_via_a_msb                 = _uint32_andc( is_a_e_flagged_msb,      is_b_e_flagged_msb     );
      const uint32_t is_c_nan_via_b_msb                 = _uint32_andc( is_b_e_flagged_msb,      is_b_m_eqz_msb         );
      const uint32_t is_c_nan_msb                       = _uint32_or(   is_c_nan_via_a_msb,      is_c_nan_via_b_msb     );
      const uint32_t is_c_denorm_msb                    = _uint32_andc( is_b_e_eqz_msb,          is_a_e_flagged_msb     );
      const uint32_t is_a_inf_msb                       = _uint32_and(  is_a_e_flagged_msb,      is_a_m_eqz_msb         );
      const uint32_t is_c_snan_msb                      = _uint32_and(  is_a_inf_msb,            is_b_eqz_msb           );
      const uint32_t is_c_nan_min_via_a_msb             = _uint32_and(  is_a_e_flagged_msb,      is_b_eqz_msb           );
      const uint32_t is_c_nan_min_via_b_msb             = _uint32_and(  is_b_e_flagged_msb,      is_a_eqz_msb           );
      const uint32_t is_c_nan_min_msb                   = _uint32_or(   is_c_nan_min_via_a_msb,  is_c_nan_min_via_b_msb );
      const uint32_t is_c_inf_msb                       = _uint32_or(   is_a_e_flagged_msb,      is_b_e_flagged_msb     );
      const uint32_t is_overflow_msb                    = _uint32_or(   is_round_overflow_msb,   is_mul_overflow_msb    );
      const uint32_t c_em_overflow_result               = _uint32_sels( is_overflow_msb, h_e_mask, c_em_norm );
      const uint32_t c_common_result                    = _uint32_or(   c_s, c_em_overflow_result );
      const uint32_t c_zero_result                      = _uint32_sels( is_b_eqz_msb,     c_s,       c_common_result  );
      const uint32_t c_nan_result                       = _uint32_sels( is_c_nan_msb,     c_nan,     c_zero_result );
      const uint32_t c_nan_min_result                   = _uint32_sels( is_c_nan_min_msb, h_nan_min, c_nan_result     );
      const uint32_t c_inf_result                       = _uint32_sels( is_c_inf_msb,     c_inf,     c_nan_min_result   );
      const uint32_t c_denorm_result                    = _uint32_sels( is_c_denorm_msb,  c_denorm,  c_inf_result);
      const uint32_t c_result                           = _uint32_sels( is_c_snan_msb,    h_snan,    c_denorm_result );
    
      return (uint16_t)(c_result);
    }
    2-Byte floats are rather inaccurate though so no one really uses em. What's 2 extra bytes?
    Last edited by Kenshin13; 11-07-2012 at 09:05 AM.

  16. #11
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by Kenshin13 View Post
    Only way I found so far to store a float in 2 bytes:

    Code:
    // Branch-free implementation of half-precision (16 bit) floating point
    // Copyright 2006 Mike Acton <macton@gmail.com>
    // 
    // Permission is hereby granted, free of charge, to any person obtaining a 
    // copy of this software and associated documentation files (the "Software"),
    // to deal in the Software without restriction, including without limitation
    // the rights to use, copy, modify, merge, publish, distribute, sublicense, 
    // and/or sell copies of the Software, and to permit persons to whom the 
    // Software is furnished to do so, subject to the following conditions:
    // 
    // The above copyright notice and this permission notice shall be included 
    // in all copies or substantial portions of the Software.
    // 
    // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
    // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
    // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    // THE SOFTWARE
    //
    // Half-precision floating point format
    // ------------------------------------
    //
    //   | Field    | Last | First | Note
    //   |----------|------|-------|----------
    //   | Sign     | 15   | 15    |
    //   | Exponent | 14   | 10    | Bias = 15
    //   | Mantissa | 9    | 0     |
    //
    // Compiling
    // ---------
    //
    //  Preferred compile flags for GCC: 
    //     -O3 -fstrict-aliasing -std=c99 -pedantic -Wall -Wstrict-aliasing
    //
    //     This file is a C99 source file, intended to be compiled with a C99 
    //     compliant compiler. However, for the moment it remains combatible
    //     with C++98. Therefore if you are using a compiler that poorly implements
    //     C standards (e.g. MSVC), it may be compiled as C++. This is not
    //     guaranteed for future versions. 
    //
    
    
    // Load immediate
    static inline uint32_t _uint32_li( uint32_t a )
    {
      return (a);
    }
    
    // Decrement
    static inline uint32_t _uint32_dec( uint32_t a )
    {
      return (a - 1);
    }
    
    // Increment
    static inline uint32_t _uint32_inc( uint32_t a )
    {
      return (a + 1);
    }
    
    // Complement
    static inline uint32_t _uint32_not( uint32_t a )
    {
      return (~a);
    }
    
    // Negate
    static inline uint32_t _uint32_neg( uint32_t a )
    {
      return (-a);
    }
    
    // Extend sign
    static inline uint32_t _uint32_ext( uint32_t a )
    {
      return (((int32_t)a)>>31);
    }
    
    // And
    static inline uint32_t _uint32_and( uint32_t a, uint32_t b )
    {
      return (a & b);
    }
    
    // Exclusive Or
    static inline uint32_t _uint32_xor( uint32_t a, uint32_t b )
    {
      return (a ^ b);
    }
    
    // And with Complement
    static inline uint32_t _uint32_andc( uint32_t a, uint32_t b )
    {
      return (a & ~b);
    }
    
    // Or
    static inline uint32_t _uint32_or( uint32_t a, uint32_t b )
    {
      return (a | b);
    }
    
    // Shift Right Logical
    static inline uint32_t _uint32_srl( uint32_t a, int sa )
    {
      return (a >> sa);
    }
    
    // Shift Left Logical
    static inline uint32_t _uint32_sll( uint32_t a, int sa )
    {
      return (a << sa);
    }
    
    // Add
    static inline uint32_t _uint32_add( uint32_t a, uint32_t b )
    {
      return (a + b);
    }
    
    // Subtract
    static inline uint32_t _uint32_sub( uint32_t a, uint32_t b )
    {
      return (a - b);
    }
    
    // Multiply
    static inline uint32_t _uint32_mul( uint32_t a, uint32_t b )
    {
      return (a * b);
    }
    
    // Select on Sign bit
    static inline uint32_t _uint32_sels( uint32_t test, uint32_t a, uint32_t b )
    {
      const uint32_t mask   = _uint32_ext( test );
      const uint32_t sel_a  = _uint32_and(  a,     mask  );
      const uint32_t sel_b  = _uint32_andc( b,     mask  );
      const uint32_t result = _uint32_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Select Bits on mask
    static inline uint32_t _uint32_selb( uint32_t mask, uint32_t a, uint32_t b )
    {
      const uint32_t sel_a  = _uint32_and(  a,     mask  );
      const uint32_t sel_b  = _uint32_andc( b,     mask  );
      const uint32_t result = _uint32_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Load Immediate
    static inline uint16_t _uint16_li( uint16_t a )
    {
      return (a);
    }
    
    // Extend sign
    static inline uint16_t _uint16_ext( uint16_t a )
    {
      return (((int16_t)a)>>15);
    }
    
    // Negate
    static inline uint16_t _uint16_neg( uint16_t a )
    {
      return (-a);
    }
    
    // Complement
    static inline uint16_t _uint16_not( uint16_t a )
    {
      return (~a);
    }
    
    // Decrement
    static inline uint16_t _uint16_dec( uint16_t a )
    {
      return (a - 1);
    }
    
    // Shift Left Logical
    static inline uint16_t _uint16_sll( uint16_t a, int sa )
    {
      return (a << sa);
    }
    
    // Shift Right Logical
    static inline uint16_t _uint16_srl( uint16_t a, int sa )
    {
      return (a >> sa);
    }
    
    // Add
    static inline uint16_t _uint16_add( uint16_t a, uint16_t b )
    {
      return (a + b);
    }
    
    // Subtract
    static inline uint16_t _uint16_sub( uint16_t a, uint16_t b )
    {
      return (a - b);
    }
    
    // And
    static inline uint16_t _uint16_and( uint16_t a, uint16_t b )
    {
      return (a & b);
    }
    
    // Or
    static inline uint16_t _uint16_or( uint16_t a, uint16_t b )
    {
      return (a | b);
    }
    
    // Exclusive Or
    static inline uint16_t _uint16_xor( uint16_t a, uint16_t b )
    {
      return (a ^ b);
    }
    
    // And with Complement
    static inline uint16_t _uint16_andc( uint16_t a, uint16_t b )
    {
      return (a & ~b);
    }
    
    // And then Shift Right Logical
    static inline uint16_t _uint16_andsrl( uint16_t a, uint16_t b, int sa )
    {
      return ((a & b) >> sa);
    }
    
    // Shift Right Logical then Mask
    static inline uint16_t _uint16_srlm( uint16_t a, int sa, uint16_t mask )
    {
      return ((a >> sa) & mask);
    }
    
    // Add then Mask
    static inline uint16_t _uint16_addm( uint16_t a, uint16_t b, uint16_t mask )
    {
      return ((a + b) & mask);
    }
    
    
    // Select on Sign bit
    static inline uint16_t _uint16_sels( uint16_t test, uint16_t a, uint16_t b )
    {
      const uint16_t mask   = _uint16_ext( test );
      const uint16_t sel_a  = _uint16_and(  a,     mask  );
      const uint16_t sel_b  = _uint16_andc( b,     mask  );
      const uint16_t result = _uint16_or(   sel_a, sel_b );
    
      return (result);
    }
    
    // Count Leading Zeros
    static inline uint32_t _uint32_cntlz( uint32_t x )
    {
    #ifdef __GNUC__
      /* NOTE: __builtin_clz is undefined for x == 0 */
      /* On PowerPC, this will map to insn: cntlzw   */
      /* On Pentium, this will map to insn: clz      */
      uint32_t is_x_nez_msb = _uint32_neg( x );
      uint32_t nlz          = __builtin_clz( x );
      uint32_t result       = _uint32_sels( is_x_nez_msb, nlz, 0x00000020 );
      return (result);
    #else
      const uint32_t x0  = _uint32_srl(  x,  1 );
      const uint32_t x1  = _uint32_or(   x,  x0 );
      const uint32_t x2  = _uint32_srl(  x1, 2 );
      const uint32_t x3  = _uint32_or(   x1, x2 );
      const uint32_t x4  = _uint32_srl(  x3, 4 );
      const uint32_t x5  = _uint32_or(   x3, x4 );
      const uint32_t x6  = _uint32_srl(  x5, 8 );
      const uint32_t x7  = _uint32_or(   x5, x6 );
      const uint32_t x8  = _uint32_srl(  x7, 16 );
      const uint32_t x9  = _uint32_or(   x7, x8 );
      const uint32_t xA  = _uint32_not(  x9 );
      const uint32_t xB  = _uint32_srl(  xA, 1 );
      const uint32_t xC  = _uint32_and(  xB, 0x55555555 );
      const uint32_t xD  = _uint32_sub(  xA, xC );
      const uint32_t xE  = _uint32_and(  xD, 0x33333333 );
      const uint32_t xF  = _uint32_srl(  xD, 2 );
      const uint32_t x10 = _uint32_and(  xF, 0x33333333 );
      const uint32_t x11 = _uint32_add(  xE, x10 );
      const uint32_t x12 = _uint32_srl(  x11, 4 );
      const uint32_t x13 = _uint32_add(  x11, x12 );
      const uint32_t x14 = _uint32_and(  x13, 0x0f0f0f0f );
      const uint32_t x15 = _uint32_srl(  x14, 8 );
      const uint32_t x16 = _uint32_add(  x14, x15 );
      const uint32_t x17 = _uint32_srl(  x16, 16 );
      const uint32_t x18 = _uint32_add(  x16, x17 );
      const uint32_t x19 = _uint32_and(  x18, 0x0000003f );
      return ( x19 );
    #endif
    }
    
    // Count Leading Zeros
    static inline uint16_t _uint16_cntlz( uint16_t x )
    {
    #ifdef __GNUC__
      uint16_t nlz32 = (uint16_t)_uint32_cntlz( (uint32_t)x );
      uint32_t nlz   = _uint32_sub( nlz32, 16 );
      return (nlz);
    #else
      const uint16_t x0  = _uint16_srl(  x,  1 );
      const uint16_t x1  = _uint16_or(   x,  x0 );
      const uint16_t x2  = _uint16_srl(  x1, 2 );
      const uint16_t x3  = _uint16_or(   x1, x2 );
      const uint16_t x4  = _uint16_srl(  x3, 4 );
      const uint16_t x5  = _uint16_or(   x3, x4 );
      const uint16_t x6  = _uint16_srl(  x5, 8 );
      const uint16_t x7  = _uint16_or(   x5, x6 );
      const uint16_t x8  = _uint16_not(  x7 );
      const uint16_t x9  = _uint16_srlm( x8, 1, 0x5555 );
      const uint16_t xA  = _uint16_sub(  x8, x9 );
      const uint16_t xB  = _uint16_and(  xA, 0x3333 );
      const uint16_t xC  = _uint16_srlm( xA, 2, 0x3333 );
      const uint16_t xD  = _uint16_add(  xB, xC );
      const uint16_t xE  = _uint16_srl(  xD, 4 );
      const uint16_t xF  = _uint16_addm( xD, xE, 0x0f0f );
      const uint16_t x10 = _uint16_srl(  xF, 8 );
      const uint16_t x11 = _uint16_addm( xF, x10, 0x001f );
      return ( x11 );
    #endif
    }
    
    uint16_t
    half_from_float( uint32_t f )
    {
      const uint32_t one                        = _uint32_li( 0x00000001 );
      const uint32_t f_s_mask                   = _uint32_li( 0x80000000 );
      const uint32_t f_e_mask                   = _uint32_li( 0x7f800000 );
      const uint32_t f_m_mask                   = _uint32_li( 0x007fffff );
      const uint32_t f_m_hidden_bit             = _uint32_li( 0x00800000 );
      const uint32_t f_m_round_bit              = _uint32_li( 0x00001000 );
      const uint32_t f_snan_mask                = _uint32_li( 0x7fc00000 );
      const uint32_t f_e_pos                    = _uint32_li( 0x00000017 );
      const uint32_t h_e_pos                    = _uint32_li( 0x0000000a );
      const uint32_t h_e_mask                   = _uint32_li( 0x00007c00 );
      const uint32_t h_snan_mask                = _uint32_li( 0x00007e00 );
      const uint32_t h_e_mask_value             = _uint32_li( 0x0000001f );
      const uint32_t f_h_s_pos_offset           = _uint32_li( 0x00000010 );
      const uint32_t f_h_bias_offset            = _uint32_li( 0x00000070 );
      const uint32_t f_h_m_pos_offset           = _uint32_li( 0x0000000d );
      const uint32_t h_nan_min                  = _uint32_li( 0x00007c01 );
      const uint32_t f_h_e_biased_flag          = _uint32_li( 0x0000008f );
      const uint32_t f_s                        = _uint32_and( f,               f_s_mask         );
      const uint32_t f_e                        = _uint32_and( f,               f_e_mask         );
      const uint16_t h_s                        = _uint32_srl( f_s,             f_h_s_pos_offset );
      const uint32_t f_m                        = _uint32_and( f,               f_m_mask         );
      const uint16_t f_e_amount                 = _uint32_srl( f_e,             f_e_pos          );
      const uint32_t f_e_half_bias              = _uint32_sub( f_e_amount,      f_h_bias_offset  );
      const uint32_t f_snan                     = _uint32_and( f,               f_snan_mask      );
      const uint32_t f_m_round_mask             = _uint32_and( f_m,             f_m_round_bit    );
      const uint32_t f_m_round_offset           = _uint32_sll( f_m_round_mask,  one              );
      const uint32_t f_m_rounded                = _uint32_add( f_m,             f_m_round_offset );
      const uint32_t f_m_denorm_sa              = _uint32_sub( one,             f_e_half_bias    );
      const uint32_t f_m_with_hidden            = _uint32_or(  f_m_rounded,     f_m_hidden_bit   );
      const uint32_t f_m_denorm                 = _uint32_srl( f_m_with_hidden, f_m_denorm_sa    );
      const uint32_t h_m_denorm                 = _uint32_srl( f_m_denorm,      f_h_m_pos_offset );
      const uint32_t f_m_rounded_overflow       = _uint32_and( f_m_rounded,     f_m_hidden_bit   );
      const uint32_t m_nan                      = _uint32_srl( f_m,             f_h_m_pos_offset );
      const uint32_t h_em_nan                   = _uint32_or(  h_e_mask,        m_nan            );
      const uint32_t h_e_norm_overflow_offset   = _uint32_inc( f_e_half_bias );
      const uint32_t h_e_norm_overflow          = _uint32_sll( h_e_norm_overflow_offset, h_e_pos          );
      const uint32_t h_e_norm                   = _uint32_sll( f_e_half_bias,            h_e_pos          );
      const uint32_t h_m_norm                   = _uint32_srl( f_m_rounded,              f_h_m_pos_offset );
      const uint32_t h_em_norm                  = _uint32_or(  h_e_norm,                 h_m_norm         );
      const uint32_t is_h_ndenorm_msb           = _uint32_sub( f_h_bias_offset,   f_e_amount    );
      const uint32_t is_f_e_flagged_msb         = _uint32_sub( f_h_e_biased_flag, f_e_half_bias );
      const uint32_t is_h_denorm_msb            = _uint32_not( is_h_ndenorm_msb );
      const uint32_t is_f_m_eqz_msb             = _uint32_dec( f_m   );
      const uint32_t is_h_nan_eqz_msb           = _uint32_dec( m_nan );
      const uint32_t is_f_inf_msb               = _uint32_and( is_f_e_flagged_msb, is_f_m_eqz_msb   );
      const uint32_t is_f_nan_underflow_msb     = _uint32_and( is_f_e_flagged_msb, is_h_nan_eqz_msb );
      const uint32_t is_e_overflow_msb          = _uint32_sub( h_e_mask_value,     f_e_half_bias    );
      const uint32_t is_h_inf_msb               = _uint32_or(  is_e_overflow_msb,  is_f_inf_msb     );
      const uint32_t is_f_nsnan_msb             = _uint32_sub( f_snan,             f_snan_mask      );
      const uint32_t is_m_norm_overflow_msb     = _uint32_neg( f_m_rounded_overflow );
      const uint32_t is_f_snan_msb              = _uint32_not( is_f_nsnan_msb );
      const uint32_t h_em_overflow_result       = _uint32_sels( is_m_norm_overflow_msb, h_e_norm_overflow, h_em_norm                 );
      const uint32_t h_em_nan_result            = _uint32_sels( is_f_e_flagged_msb,     h_em_nan,          h_em_overflow_result      );
      const uint32_t h_em_nan_underflow_result  = _uint32_sels( is_f_nan_underflow_msb, h_nan_min,         h_em_nan_result           );
      const uint32_t h_em_inf_result            = _uint32_sels( is_h_inf_msb,           h_e_mask,          h_em_nan_underflow_result );
      const uint32_t h_em_denorm_result         = _uint32_sels( is_h_denorm_msb,        h_m_denorm,        h_em_inf_result           );
      const uint32_t h_em_snan_result           = _uint32_sels( is_f_snan_msb,          h_snan_mask,       h_em_denorm_result        );
      const uint32_t h_result                   = _uint32_or( h_s, h_em_snan_result );
    
      return (uint16_t)(h_result);
    }
    
    uint32_t 
    half_to_float( uint16_t h )
    {
      const uint32_t h_e_mask              = _uint32_li( 0x00007c00 );
      const uint32_t h_m_mask              = _uint32_li( 0x000003ff );
      const uint32_t h_s_mask              = _uint32_li( 0x00008000 );
      const uint32_t h_f_s_pos_offset      = _uint32_li( 0x00000010 );
      const uint32_t h_f_e_pos_offset      = _uint32_li( 0x0000000d );
      const uint32_t h_f_bias_offset       = _uint32_li( 0x0001c000 );
      const uint32_t f_e_mask              = _uint32_li( 0x7f800000 );
      const uint32_t f_m_mask              = _uint32_li( 0x007fffff );
      const uint32_t h_f_e_denorm_bias     = _uint32_li( 0x0000007e );
      const uint32_t h_f_m_denorm_sa_bias  = _uint32_li( 0x00000008 );
      const uint32_t f_e_pos               = _uint32_li( 0x00000017 );
      const uint32_t h_e_mask_minus_one    = _uint32_li( 0x00007bff );
      const uint32_t h_e                   = _uint32_and( h, h_e_mask );
      const uint32_t h_m                   = _uint32_and( h, h_m_mask );
      const uint32_t h_s                   = _uint32_and( h, h_s_mask );
      const uint32_t h_e_f_bias            = _uint32_add( h_e, h_f_bias_offset );
      const uint32_t h_m_nlz               = _uint32_cntlz( h_m );
      const uint32_t f_s                   = _uint32_sll( h_s,        h_f_s_pos_offset );
      const uint32_t f_e                   = _uint32_sll( h_e_f_bias, h_f_e_pos_offset );
      const uint32_t f_m                   = _uint32_sll( h_m,        h_f_e_pos_offset );
      const uint32_t f_em                  = _uint32_or(  f_e,        f_m              );
      const uint32_t h_f_m_sa              = _uint32_sub( h_m_nlz,             h_f_m_denorm_sa_bias );
      const uint32_t f_e_denorm_unpacked   = _uint32_sub( h_f_e_denorm_bias,   h_f_m_sa             );
      const uint32_t h_f_m                 = _uint32_sll( h_m,                 h_f_m_sa             );
      const uint32_t f_m_denorm            = _uint32_and( h_f_m,               f_m_mask             );
      const uint32_t f_e_denorm            = _uint32_sll( f_e_denorm_unpacked, f_e_pos              );
      const uint32_t f_em_denorm           = _uint32_or(  f_e_denorm,          f_m_denorm           );
      const uint32_t f_em_nan              = _uint32_or(  f_e_mask,            f_m                  );
      const uint32_t is_e_eqz_msb          = _uint32_dec(  h_e );
      const uint32_t is_m_nez_msb          = _uint32_neg(  h_m );
      const uint32_t is_e_flagged_msb      = _uint32_sub(  h_e_mask_minus_one, h_e );
      const uint32_t is_zero_msb           = _uint32_andc( is_e_eqz_msb,       is_m_nez_msb );
      const uint32_t is_inf_msb            = _uint32_andc( is_e_flagged_msb,   is_m_nez_msb );
      const uint32_t is_denorm_msb         = _uint32_and(  is_m_nez_msb,       is_e_eqz_msb );
      const uint32_t is_nan_msb            = _uint32_and(  is_e_flagged_msb,   is_m_nez_msb ); 
      const uint32_t is_zero               = _uint32_ext(  is_zero_msb );
      const uint32_t f_zero_result         = _uint32_andc( f_em, is_zero );
      const uint32_t f_denorm_result       = _uint32_sels( is_denorm_msb, f_em_denorm, f_zero_result );
      const uint32_t f_inf_result          = _uint32_sels( is_inf_msb,    f_e_mask,    f_denorm_result );
      const uint32_t f_nan_result          = _uint32_sels( is_nan_msb,    f_em_nan,    f_inf_result    );
      const uint32_t f_result              = _uint32_or( f_s, f_nan_result );
     
      return (f_result);
    }
    
    // half_add
    // --------
    //
    //  (SUM)        uint16_t z = half_add( x, y );
    //  (DIFFERENCE) uint16_t z = half_add( x, -y );
    //
    //  * Difference of ZEROs is always +ZERO
    //  * Sum round with guard + round + sticky bit (grs)
    //  * QNaN + <x>  = QNaN
    //  * <x>  + +INF = +INF
    //  * <x>  - -INF = -INF
    //  * INF  - INF  = SNaN
    //
    //  Will have exactly (0 ulps difference) the same result as:
    //  (Round up)
    //
    //     union FLOAT_32
    //     {
    //       float    f32;
    //       uint32_t u32;
    //     };
    //
    //     union FLOAT_32 fx = { .u32 = half_to_float( x ) };
    //     union FLOAT_32 fy = { .u32 = half_to_float( y ) };
    //     union FLOAT_32 fz = { .f32 = fx.f32 + fy.f32    };
    //     uint16_t       z  = float_to_half( fz );
    //
    uint16_t
    half_add( uint16_t x, uint16_t y )
    {
      const uint16_t one                       = _uint16_li( 0x0001 );
      const uint16_t msb_to_lsb_sa             = _uint16_li( 0x000f );
      const uint16_t h_s_mask                  = _uint16_li( 0x8000 );
      const uint16_t h_e_mask                  = _uint16_li( 0x7c00 );
      const uint16_t h_m_mask                  = _uint16_li( 0x03ff );
      const uint16_t h_m_msb_mask              = _uint16_li( 0x2000 );
      const uint16_t h_m_msb_sa                = _uint16_li( 0x000d );
      const uint16_t h_m_hidden                = _uint16_li( 0x0400 );
      const uint16_t h_e_pos                   = _uint16_li( 0x000a );
      const uint16_t h_e_bias_minus_one        = _uint16_li( 0x000e );
      const uint16_t h_m_grs_carry             = _uint16_li( 0x4000 );
      const uint16_t h_m_grs_carry_pos         = _uint16_li( 0x000e );
      const uint16_t h_grs_size                = _uint16_li( 0x0003 );
      const uint16_t h_snan                    = _uint16_li( 0xfe00 );
      const uint16_t h_e_mask_minus_one        = _uint16_li( 0x7bff );
      const uint16_t h_grs_round_carry         = _uint16_sll( one, h_grs_size );
      const uint16_t h_grs_round_mask          = _uint16_sub( h_grs_round_carry, one );
      const uint16_t x_e                       = _uint16_and( x, h_e_mask );
      const uint16_t y_e                       = _uint16_and( y, h_e_mask );
      const uint16_t is_y_e_larger_msb         = _uint16_sub( x_e, y_e );
      const uint16_t a                         = _uint16_sels( is_y_e_larger_msb, y, x);
      const uint16_t a_s                       = _uint16_and( a, h_s_mask );
      const uint16_t a_e                       = _uint16_and( a, h_e_mask );
      const uint16_t a_m_no_hidden_bit         = _uint16_and( a, h_m_mask );
      const uint16_t a_em_no_hidden_bit        = _uint16_or( a_e, a_m_no_hidden_bit );
      const uint16_t b                         = _uint16_sels( is_y_e_larger_msb, x, y);
      const uint16_t b_s                       = _uint16_and( b, h_s_mask );
      const uint16_t b_e                       = _uint16_and( b, h_e_mask );
      const uint16_t b_m_no_hidden_bit         = _uint16_and( b, h_m_mask );
      const uint16_t b_em_no_hidden_bit        = _uint16_or( b_e, b_m_no_hidden_bit );
      const uint16_t is_diff_sign_msb          = _uint16_xor( a_s, b_s );
      const uint16_t is_a_inf_msb              = _uint16_sub( h_e_mask_minus_one, a_em_no_hidden_bit );
      const uint16_t is_b_inf_msb              = _uint16_sub( h_e_mask_minus_one, b_em_no_hidden_bit );
      const uint16_t is_undenorm_msb           = _uint16_dec( a_e );
      const uint16_t is_undenorm               = _uint16_ext( is_undenorm_msb );
      const uint16_t is_both_inf_msb           = _uint16_and( is_a_inf_msb, is_b_inf_msb );
      const uint16_t is_invalid_inf_op_msb     = _uint16_and( is_both_inf_msb, b_s );
      const uint16_t is_a_e_nez_msb            = _uint16_neg( a_e );
      const uint16_t is_b_e_nez_msb            = _uint16_neg( b_e );
      const uint16_t is_a_e_nez                = _uint16_ext( is_a_e_nez_msb );
      const uint16_t is_b_e_nez                = _uint16_ext( is_b_e_nez_msb );
      const uint16_t a_m_hidden_bit            = _uint16_and( is_a_e_nez, h_m_hidden );
      const uint16_t b_m_hidden_bit            = _uint16_and( is_b_e_nez, h_m_hidden );
      const uint16_t a_m_no_grs                = _uint16_or( a_m_no_hidden_bit, a_m_hidden_bit );
      const uint16_t b_m_no_grs                = _uint16_or( b_m_no_hidden_bit, b_m_hidden_bit );
      const uint16_t diff_e                    = _uint16_sub( a_e,        b_e );
      const uint16_t a_e_unbias                = _uint16_sub( a_e,        h_e_bias_minus_one );
      const uint16_t a_m                       = _uint16_sll( a_m_no_grs, h_grs_size );
      const uint16_t a_e_biased                = _uint16_srl( a_e,        h_e_pos );
      const uint16_t m_sa_unbias               = _uint16_srl( a_e_unbias, h_e_pos );
      const uint16_t m_sa_default              = _uint16_srl( diff_e,     h_e_pos );
      const uint16_t m_sa_unbias_mask          = _uint16_andc( is_a_e_nez_msb,   is_b_e_nez_msb );
      const uint16_t m_sa                      = _uint16_sels( m_sa_unbias_mask, m_sa_unbias, m_sa_default );
      const uint16_t b_m_no_sticky             = _uint16_sll( b_m_no_grs,        h_grs_size );
      const uint16_t sh_m                      = _uint16_srl( b_m_no_sticky,     m_sa );
      const uint16_t sticky_overflow           = _uint16_sll( one,               m_sa );
      const uint16_t sticky_mask               = _uint16_dec( sticky_overflow );
      const uint16_t sticky_collect            = _uint16_and( b_m_no_sticky, sticky_mask );
      const uint16_t is_sticky_set_msb         = _uint16_neg( sticky_collect );
      const uint16_t sticky                    = _uint16_srl( is_sticky_set_msb, msb_to_lsb_sa);
      const uint16_t b_m                       = _uint16_or( sh_m, sticky );
      const uint16_t is_c_m_ab_pos_msb         = _uint16_sub( b_m, a_m );
      const uint16_t c_inf                     = _uint16_or( a_s, h_e_mask );
      const uint16_t c_m_sum                   = _uint16_add( a_m, b_m );
      const uint16_t c_m_diff_ab               = _uint16_sub( a_m, b_m );
      const uint16_t c_m_diff_ba               = _uint16_sub( b_m, a_m );
      const uint16_t c_m_smag_diff             = _uint16_sels( is_c_m_ab_pos_msb, c_m_diff_ab, c_m_diff_ba );
      const uint16_t c_s_diff                  = _uint16_sels( is_c_m_ab_pos_msb, a_s,         b_s         );
      const uint16_t c_s                       = _uint16_sels( is_diff_sign_msb,  c_s_diff,    a_s         );
      const uint16_t c_m_smag_diff_nlz         = _uint16_cntlz( c_m_smag_diff );
      const uint16_t diff_norm_sa              = _uint16_sub( c_m_smag_diff_nlz, one );
      const uint16_t is_diff_denorm_msb        = _uint16_sub( a_e_biased, diff_norm_sa );
      const uint16_t is_diff_denorm            = _uint16_ext( is_diff_denorm_msb );
      const uint16_t is_a_or_b_norm_msb        = _uint16_neg( a_e_biased );
      const uint16_t diff_denorm_sa            = _uint16_dec( a_e_biased );
      const uint16_t c_m_diff_denorm           = _uint16_sll( c_m_smag_diff, diff_denorm_sa );
      const uint16_t c_m_diff_norm             = _uint16_sll( c_m_smag_diff, diff_norm_sa );
      const uint16_t c_e_diff_norm             = _uint16_sub( a_e_biased,  diff_norm_sa );
      const uint16_t c_m_diff_ab_norm          = _uint16_sels( is_diff_denorm_msb, c_m_diff_denorm, c_m_diff_norm );
      const uint16_t c_e_diff_ab_norm          = _uint16_andc( c_e_diff_norm, is_diff_denorm );
      const uint16_t c_m_diff                  = _uint16_sels( is_a_or_b_norm_msb, c_m_diff_ab_norm, c_m_smag_diff );
      const uint16_t c_e_diff                  = _uint16_sels( is_a_or_b_norm_msb, c_e_diff_ab_norm, a_e_biased    );
      const uint16_t is_diff_eqz_msb           = _uint16_dec( c_m_diff );
      const uint16_t is_diff_exactly_zero_msb  = _uint16_and( is_diff_sign_msb, is_diff_eqz_msb );
      const uint16_t is_diff_exactly_zero      = _uint16_ext( is_diff_exactly_zero_msb );
      const uint16_t c_m_added                 = _uint16_sels( is_diff_sign_msb, c_m_diff, c_m_sum );
      const uint16_t c_e_added                 = _uint16_sels( is_diff_sign_msb, c_e_diff, a_e_biased );
      const uint16_t c_m_carry                 = _uint16_and( c_m_added, h_m_grs_carry );
      const uint16_t is_c_m_carry_msb          = _uint16_neg( c_m_carry );
      const uint16_t c_e_hidden_offset         = _uint16_andsrl( c_m_added, h_m_grs_carry, h_m_grs_carry_pos );
      const uint16_t c_m_sub_hidden            = _uint16_srl( c_m_added, one );
      const uint16_t c_m_no_hidden             = _uint16_sels( is_c_m_carry_msb, c_m_sub_hidden, c_m_added );
      const uint16_t c_e_no_hidden             = _uint16_add( c_e_added,         c_e_hidden_offset  );
      const uint16_t c_m_no_hidden_msb         = _uint16_and( c_m_no_hidden,     h_m_msb_mask       );
      const uint16_t undenorm_m_msb_odd        = _uint16_srl( c_m_no_hidden_msb, h_m_msb_sa         );
      const uint16_t undenorm_fix_e            = _uint16_and( is_undenorm,       undenorm_m_msb_odd );
      const uint16_t c_e_fixed                 = _uint16_add( c_e_no_hidden,     undenorm_fix_e     );
      const uint16_t c_m_round_amount          = _uint16_and( c_m_no_hidden,     h_grs_round_mask   );
      const uint16_t c_m_rounded               = _uint16_add( c_m_no_hidden,     c_m_round_amount   );
      const uint16_t c_m_round_overflow        = _uint16_andsrl( c_m_rounded, h_m_grs_carry, h_m_grs_carry_pos );
      const uint16_t c_e_rounded               = _uint16_add( c_e_fixed, c_m_round_overflow );
      const uint16_t c_m_no_grs                = _uint16_srlm( c_m_rounded, h_grs_size,  h_m_mask );
      const uint16_t c_e                       = _uint16_sll( c_e_rounded, h_e_pos );
      const uint16_t c_em                      = _uint16_or( c_e, c_m_no_grs );
      const uint16_t c_normal                  = _uint16_or( c_s, c_em );
      const uint16_t c_inf_result              = _uint16_sels( is_a_inf_msb, c_inf, c_normal );
      const uint16_t c_zero_result             = _uint16_andc( c_inf_result, is_diff_exactly_zero );
      const uint16_t c_result                  = _uint16_sels( is_invalid_inf_op_msb, h_snan, c_zero_result );
    
      return (c_result);
    }
    
    // half_mul
    // --------
    //
    //  May have 0 or 1 ulp difference from the following result:
    //  (Round to nearest) 
    //  NOTE: Rounding mode differs between conversion and multiply
    //
    //     union FLOAT_32
    //     {
    //       float    f32;
    //       uint32_t u32;
    //     };
    //
    //     union FLOAT_32 fx = { .u32 = half_to_float( x ) };
    //     union FLOAT_32 fy = { .u32 = half_to_float( y ) };
    //     union FLOAT_32 fz = { .f32 = fx.f32 * fy.f32    };
    //     uint16_t       z  = float_to_half( fz );
    //
    uint16_t
    half_mul( uint16_t x, uint16_t y )
    {
      const uint32_t one                                = _uint32_li( 0x00000001 );
      const uint32_t h_s_mask                           = _uint32_li( 0x00008000 );
      const uint32_t h_e_mask                           = _uint32_li( 0x00007c00 );
      const uint32_t h_m_mask                           = _uint32_li( 0x000003ff );
      const uint32_t h_m_hidden                         = _uint32_li( 0x00000400 );
      const uint32_t h_e_pos                            = _uint32_li( 0x0000000a );
      const uint32_t h_e_bias                           = _uint32_li( 0x0000000f );
      const uint32_t h_m_bit_count                      = _uint32_li( 0x0000000a );
      const uint32_t h_m_bit_half_count                 = _uint32_li( 0x00000005 );
      const uint32_t h_nan_min                          = _uint32_li( 0x00007c01 );
      const uint32_t h_e_mask_minus_one                 = _uint32_li( 0x00007bff );
      const uint32_t h_snan                             = _uint32_li( 0x0000fe00 );
      const uint32_t m_round_overflow_bit               = _uint32_li( 0x00000020 );
      const uint32_t m_hidden_bit                       = _uint32_li( 0x00100000 );
      const uint32_t a_s                                = _uint32_and(  x,   h_s_mask );
      const uint32_t b_s                                = _uint32_and(  y,   h_s_mask );
      const uint32_t c_s                                = _uint32_xor(  a_s, b_s      );
      const uint32_t x_e                                = _uint32_and(  x,   h_e_mask );
      const uint32_t x_e_eqz_msb                        = _uint32_dec(  x_e );
      const uint32_t a                                  = _uint32_sels( x_e_eqz_msb, y, x );
      const uint32_t b                                  = _uint32_sels( x_e_eqz_msb, x, y );
      const uint32_t a_e                                = _uint32_and(  a,   h_e_mask );
      const uint32_t b_e                                = _uint32_and(  b,   h_e_mask );
      const uint32_t a_m                                = _uint32_and(  a,   h_m_mask );
      const uint32_t b_m                                = _uint32_and(  b,   h_m_mask );
      const uint32_t a_e_amount                         = _uint32_srl(  a_e,                 h_e_pos                 );
      const uint32_t b_e_amount                         = _uint32_srl(  b_e,                 h_e_pos                 );
      const uint32_t a_m_with_hidden                    = _uint32_or(   a_m,                 h_m_hidden              );
      const uint32_t b_m_with_hidden                    = _uint32_or(   b_m,                 h_m_hidden              );
      const uint32_t c_m_normal                         = _uint32_mul(  a_m_with_hidden,     b_m_with_hidden         );
      const uint32_t c_m_denorm_biased                  = _uint32_mul(  a_m_with_hidden,     b_m                     );
      const uint32_t c_e_denorm_unbias_e                = _uint32_sub(  h_e_bias,            a_e_amount              );
      const uint32_t c_m_denorm_round_amount            = _uint32_and(  c_m_denorm_biased,   h_m_mask                );
      const uint32_t c_m_denorm_rounded                 = _uint32_add(  c_m_denorm_biased,   c_m_denorm_round_amount );
      const uint32_t c_m_denorm_inplace                 = _uint32_srl(  c_m_denorm_rounded,  h_m_bit_count           );
      const uint32_t c_m_denorm_unbiased                = _uint32_srl(  c_m_denorm_inplace,  c_e_denorm_unbias_e     );
      const uint32_t c_m_denorm                         = _uint32_and(  c_m_denorm_unbiased, h_m_mask                );
      const uint32_t c_e_amount_biased                  = _uint32_add(  a_e_amount,          b_e_amount              );
      const uint32_t c_e_amount_unbiased                = _uint32_sub(  c_e_amount_biased,   h_e_bias                );
      const uint32_t is_c_e_unbiased_underflow          = _uint32_ext(  c_e_amount_unbiased );
      const uint32_t c_e_underflow_half_sa              = _uint32_neg(  c_e_amount_unbiased );
      const uint32_t c_e_underflow_sa                   = _uint32_sll(  c_e_underflow_half_sa,     one );
      const uint32_t c_m_underflow                      = _uint32_srl(  c_m_normal,                c_e_underflow_sa );
      const uint32_t c_e_underflow_added                = _uint32_andc( c_e_amount_unbiased,       is_c_e_unbiased_underflow );
      const uint32_t c_m_underflow_added                = _uint32_selb( is_c_e_unbiased_underflow, c_m_underflow, c_m_normal );
      const uint32_t is_mul_overflow_test               = _uint32_and(  c_e_underflow_added, m_round_overflow_bit );
      const uint32_t is_mul_overflow_msb                = _uint32_neg(  is_mul_overflow_test );
      const uint32_t c_e_norm_radix_corrected           = _uint32_inc(  c_e_underflow_added );
      const uint32_t c_m_norm_radix_corrected           = _uint32_srl(  c_m_underflow_added, one );
      const uint32_t c_m_norm_hidden_bit                = _uint32_and(  c_m_norm_radix_corrected,  m_hidden_bit );
      const uint32_t is_c_m_norm_no_hidden_msb          = _uint32_dec(  c_m_norm_hidden_bit );
      const uint32_t c_m_norm_lo                        = _uint32_srl(  c_m_norm_radix_corrected, h_m_bit_half_count );
      const uint32_t c_m_norm_lo_nlz                    = _uint16_cntlz( c_m_norm_lo );
      const uint32_t is_c_m_hidden_nunderflow_msb       = _uint32_sub(  c_m_norm_lo_nlz, c_e_norm_radix_corrected );
      const uint32_t is_c_m_hidden_underflow_msb        = _uint32_not(  is_c_m_hidden_nunderflow_msb );
      const uint32_t is_c_m_hidden_underflow            = _uint32_ext(  is_c_m_hidden_underflow_msb  );
      const uint32_t c_m_hidden_underflow_normalized_sa = _uint32_srl(  c_m_norm_lo_nlz, one );
      const uint32_t c_m_hidden_underflow_normalized    = _uint32_sll(  c_m_norm_radix_corrected, c_m_hidden_underflow_normalized_sa );
      const uint32_t c_m_hidden_normalized              = _uint32_sll(  c_m_norm_radix_corrected, c_m_norm_lo_nlz );
      const uint32_t c_e_hidden_normalized              = _uint32_sub(  c_e_norm_radix_corrected, c_m_norm_lo_nlz );
      const uint32_t c_e_hidden                         = _uint32_andc( c_e_hidden_normalized, is_c_m_hidden_underflow );
      const uint32_t c_m_hidden                         = _uint32_sels( is_c_m_hidden_underflow_msb, c_m_hidden_underflow_normalized, c_m_hidden_normalized );
      const uint32_t c_m_normalized                     = _uint32_sels( is_c_m_norm_no_hidden_msb, c_m_hidden, c_m_norm_radix_corrected );
      const uint32_t c_e_normalized                     = _uint32_sels( is_c_m_norm_no_hidden_msb, c_e_hidden, c_e_norm_radix_corrected );
      const uint32_t c_m_norm_round_amount              = _uint32_and(  c_m_normalized, h_m_mask );
      const uint32_t c_m_norm_rounded                   = _uint32_add(  c_m_normalized, c_m_norm_round_amount );
      const uint32_t is_round_overflow_test             = _uint32_and(  c_e_normalized, m_round_overflow_bit  );
      const uint32_t is_round_overflow_msb              = _uint32_neg(  is_round_overflow_test );
      const uint32_t c_m_norm_inplace                   = _uint32_srl(  c_m_norm_rounded,    h_m_bit_count );
      const uint32_t c_m                                = _uint32_and(  c_m_norm_inplace,    h_m_mask      );
      const uint32_t c_e_norm_inplace                   = _uint32_sll(  c_e_normalized, h_e_pos       );
      const uint32_t c_e                                = _uint32_and(  c_e_norm_inplace,    h_e_mask      );
      const uint32_t c_em_nan                           = _uint32_or(   h_e_mask,  a_m        );
      const uint32_t c_nan                              = _uint32_or(   a_s,       c_em_nan   );
      const uint32_t c_denorm                           = _uint32_or(   c_s,       c_m_denorm );
      const uint32_t c_inf                              = _uint32_or(   c_s,       h_e_mask   );
      const uint32_t c_em_norm                          = _uint32_or(   c_e,       c_m        );
      const uint32_t is_a_e_flagged_msb                 = _uint32_sub(  h_e_mask_minus_one, a_e );
      const uint32_t is_b_e_flagged_msb                 = _uint32_sub(  h_e_mask_minus_one, b_e );
      const uint32_t is_a_e_eqz_msb                     = _uint32_dec(  a_e );
      const uint32_t is_a_m_eqz_msb                     = _uint32_dec(  a_m );
      const uint32_t is_b_e_eqz_msb                     = _uint32_dec(  b_e );
      const uint32_t is_b_m_eqz_msb                     = _uint32_dec(  b_m );
      const uint32_t is_b_eqz_msb                       = _uint32_and(  is_b_e_eqz_msb,          is_b_m_eqz_msb         );
      const uint32_t is_a_eqz_msb                       = _uint32_and(  is_a_e_eqz_msb,          is_a_m_eqz_msb         );
      const uint32_t is_c_nan_via_a_msb                 = _uint32_andc( is_a_e_flagged_msb,      is_b_e_flagged_msb     );
      const uint32_t is_c_nan_via_b_msb                 = _uint32_andc( is_b_e_flagged_msb,      is_b_m_eqz_msb         );
      const uint32_t is_c_nan_msb                       = _uint32_or(   is_c_nan_via_a_msb,      is_c_nan_via_b_msb     );
      const uint32_t is_c_denorm_msb                    = _uint32_andc( is_b_e_eqz_msb,          is_a_e_flagged_msb     );
      const uint32_t is_a_inf_msb                       = _uint32_and(  is_a_e_flagged_msb,      is_a_m_eqz_msb         );
      const uint32_t is_c_snan_msb                      = _uint32_and(  is_a_inf_msb,            is_b_eqz_msb           );
      const uint32_t is_c_nan_min_via_a_msb             = _uint32_and(  is_a_e_flagged_msb,      is_b_eqz_msb           );
      const uint32_t is_c_nan_min_via_b_msb             = _uint32_and(  is_b_e_flagged_msb,      is_a_eqz_msb           );
      const uint32_t is_c_nan_min_msb                   = _uint32_or(   is_c_nan_min_via_a_msb,  is_c_nan_min_via_b_msb );
      const uint32_t is_c_inf_msb                       = _uint32_or(   is_a_e_flagged_msb,      is_b_e_flagged_msb     );
      const uint32_t is_overflow_msb                    = _uint32_or(   is_round_overflow_msb,   is_mul_overflow_msb    );
      const uint32_t c_em_overflow_result               = _uint32_sels( is_overflow_msb, h_e_mask, c_em_norm );
      const uint32_t c_common_result                    = _uint32_or(   c_s, c_em_overflow_result );
      const uint32_t c_zero_result                      = _uint32_sels( is_b_eqz_msb,     c_s,       c_common_result  );
      const uint32_t c_nan_result                       = _uint32_sels( is_c_nan_msb,     c_nan,     c_zero_result );
      const uint32_t c_nan_min_result                   = _uint32_sels( is_c_nan_min_msb, h_nan_min, c_nan_result     );
      const uint32_t c_inf_result                       = _uint32_sels( is_c_inf_msb,     c_inf,     c_nan_min_result   );
      const uint32_t c_denorm_result                    = _uint32_sels( is_c_denorm_msb,  c_denorm,  c_inf_result);
      const uint32_t c_result                           = _uint32_sels( is_c_snan_msb,    h_snan,    c_denorm_result );
    
      return (uint16_t)(c_result);
    }
    2-Byte floats are rather inaccurate though so no one really uses em. What's 2 extra bytes?
    2 bytes can only hold a value up to: 65025 (byte)

    Since 1 byte = max size of: 255
    FF = 255
    15 * 15 = 255
    Means: 255*255 = 2 (byte) max range/value
    (can't tell much more, we got unsigned bytes and so I suppose, but can't really tell how those operate :S)

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

  17. #12
    Kenshin13's Avatar
    Join Date
    May 2011
    Gender
    male
    Location
    Cloud 9
    Posts
    3,470
    Reputation
    564
    Thanks
    6,168
    My Mood
    Psychedelic
    Im talking floating point precision...that's integer values :P

  18. #13
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by Geomatrical 0 View Post
    And it can also be 2-bytes I figure
    2 Bytes is only Short, a half size integer (__int16) and a wide char (wchar_t) (on C++ ofc)

    Here's a list

    Data Type Ranges (C++)

    The same applies to almost every other programming language.
    Last edited by MarkHC; 11-07-2012 at 01:33 PM.


    CoD Minion from 09/19/2012 to 01/10/2013

  19. The Following User Says Thank You to MarkHC For This Useful Post:

    Geomatrical 0 (11-08-2012)

  20. #14
    -Panda-'s Avatar
    Join Date
    Nov 2012
    Gender
    male
    Location
    Australia
    Posts
    1,764
    Reputation
    42
    Thanks
    209
    My Mood
    Bored
    This worked really well the only thin is if i change my name right i can't be ban right i wana make sure cuz some of my friends went my to use it on them C:

  21. #15
    Jorndel's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Norway
    Posts
    8,676
    Reputation
    905
    Thanks
    19,113
    My Mood
    Angelic
    Quote Originally Posted by PandaThePro View Post
    This worked really well the only thin is if i change my name right i can't be ban right i wana make sure cuz some of my friends went my to use it on them C:
    Changing your name will NOT prevent bans.

     
    Contributor 01.27.2012 - N/A
    Donator 07-17-2012 - Current
    Editor/Manager 12-16-12 - N/A
    Minion 01-10-2013 - 07.17.13
    Former Staff 09-20-2012 - 01-10-2013 / 07-17-2013 - Current
    Cocksucker 20-04-2013 - N/A

Similar Threads

  1. [Source Code] Server Hack - Simple Class
    By Jorndel in forum Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    Replies: 8
    Last Post: 11-03-2012, 07:59 PM
  2. [Release]Name tag hack / Unlimited Ammo / Unlimited Energy
    By hooch in forum Crysis 2 Hacks / Cheats
    Replies: 101
    Last Post: 04-01-2011, 04:21 PM
  3. [Release] Shop Hack,God Mode, Unlimited Ammo, Telekill
    By Littlefighter in forum Combat Arms Mods & Rez Modding
    Replies: 9
    Last Post: 03-19-2011, 05:56 PM
  4. [Release]Name tag hack / Unlimited Ammo
    By hooch in forum Crysis 2 Hacks / Cheats
    Replies: 62
    Last Post: 03-09-2011, 05:08 AM
  5. need ghost recon server hack
    By Mike273 in forum General Game Hacking
    Replies: 8
    Last Post: 03-16-2009, 02:02 PM