From: cr88192@gmail.com   
      
   On 10/3/2025 4:04 PM, Thomas Koenig wrote:   
   > Stefan Monnier schrieb:   
   >>>> --------------------------------------------------------------   
   >>>> Integer instructions are now:: {Signed and unSigned}×{Byte,   
   HalfWord,   
   >>>> Word, DoubleWord}   
   >>>> while FP instructions are now:   
   >>>> {Byte, HalfWord, Word, DoubleWord}   
   >>>   
   >>> I doubt any compilers will use this feature.   
   >>> Strong typed languages don't have predefined operators that allow mixing.   
   >>   
   >> Not sure who's confused, but my reading of the above is not some sort of   
   >> "mixing": I believe Mitch is just saying that his addition operation   
   >> (for example) can be specified to operate on either one of int8, uint8,   
   >> int16, uint16, ...   
   >> But that specification applies to all inputs and outputs of the   
   >> instruction, so it does not support adding an int8 to an int32, or other   
   >> "mixes".   
   >   
   > The outputs are correctly extended to a 64-bit number (signed or   
   > unsigned) so it is possible to pass results to wider operations   
   > without conversion.   
   >   
   > One example would be   
   >   
   > unsigned long foo (unsigned int a, unsigned int b)   
   > {   
   > return a + b;   
   > }   
   >   
   > which would need an adjustment after the add, and which would   
   > just be somethign like   
   >   
   > adduw r1,r1,r2   
   > ret   
   >   
   > using Mitch's new encoding.   
   >   
      
      
   Yes.   
      
   Sign extend signed types, zero extend unsigned types.   
   Up-conversion is free.   
      
      
   This is something the RISC-V people got wrong IMO, and adding a bunch of   
   ".UW" instructions in an attempt to patch over it is just kinda ugly.   
      
   Partly for my own uses revived ADDWU and SUBWU (which had been dropped   
   in BitManip), because these are less bad than the alternative.   
      
   I get annoyed that new extensions keep trying to add ever more ".UW"   
   instructions rather than just having the compiler go over to   
   zero-extended unsigned and make this whole mess go away.   
      
   ...   
      
      
      
   Ironically, the number of new instructions being added to my own ISA has   
   mostly died off recently, largely because there is little particularly   
   relevant to add at this point (within the realm of stuff that could be   
   added).   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|