Changeset dbe8e31c


Ignore:
Timestamp:
Jul 12, 2020, 10:43:59 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
ccb776b
Parents:
a3d3efc
Message:

use #if to elide int128 code for 32-bit build

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/prelude/builtins.c

    ra3d3efc rdbe8e31c  
    1010// Created On       : Fri Jul 21 16:21:03 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Jul  8 22:43:14 2020
    13 // Update Count     : 105
     12// Last Modified On : Sun Jul 12 10:40:57 2020
     13// Update Count     : 107
    1414//
    1515
     
    9595static inline forall( dtype DT ) DT * intptr( uintptr_t addr ) { return (DT *)addr; }
    9696
     97#if __SIZEOF_POINTER__ == 8                                                             // 64-bit mode
    9798// constructor for 128-bit numbers (all constants are unsigned as +/- are operators)
    9899static inline void ?{}( unsigned int128 & this, unsigned long int h, unsigned long int l ) {
    99100        this = (unsigned int128)h << 64 | (unsigned int128)l;
    100101} // ?{}
     102#endif // 64-bit mode
    101103
    102104// exponentiation operator implementation
  • src/Parser/ExpressionNode.cc

    ra3d3efc rdbe8e31c  
    1010// Created On       : Sat May 16 13:17:07 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul 11 16:44:49 2020
    13 // Update Count     : 1034
     12// Last Modified On : Sun Jul 12 08:15:12 2020
     13// Update Count     : 1039
    1414//
    1515
     
    185185
    186186        // Cannot be just "0"/"1"; sscanf stops at the suffix, if any; value goes over the wall => always generate
     187
     188#if __SIZEOF_POINTER__ == 8                                                             // 64-bit mode
     189        if ( type == 5 ) SemanticError( yylloc, "int128 constant is not supported on this target " + str );
     190#endif // 64-bit mode
    187191       
    188192        if ( str[0] == '0' ) {                                                          // radix character ?
     
    215219                        if ( type < 5 ) {                                                       // not L128 ?
    216220                                sscanf( (char *)str.c_str(), "%llo", &v );
     221#if __SIZEOF_POINTER__ == 8                                                             // 64-bit mode
    217222                        } else {                                                                        // octal int128 constant
    218223                                unsigned int len = str.length();
     
    240245                                        str = buf;
    241246                                } // if
     247#endif // 64-bit mode
    242248                        } // if
    243249                        //printf( "%#llo %llu\n", v, v );
     
    246252                if ( type < 5 ) {                                                               // not L128 ?
    247253                        sscanf( (char *)str.c_str(), "%llu", &v );
     254#if __SIZEOF_POINTER__ == 8                                                             // 64-bit mode
    248255                } else {                                                                                // decimal int128 constant
    249256                        #define P10_UINT64 10'000'000'000'000'000'000ULL // 19 zeroes
     
    273280                                str = buf;
    274281                        } // if
     282#endif // 64-bit mode
    275283                } // if
    276284                //printf( "%llu\n", v );
Note: See TracChangeset for help on using the changeset viewer.