Changeset b4d65c7


Ignore:
Timestamp:
Feb 6, 2017, 4:19:53 PM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
424931d, fe26fbf
Parents:
c0aa336 (diff), 6a5f0e7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Files:
13 added
3 deleted
28 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rc0aa336 rb4d65c7  
    3131
    3232                //Run the tests from the tests directory
    33                 dir ('src/tests') {
    34                         if (full_build) {
    35                                 sh 'make all-tests debug=yes'
    36                                 sh 'make all-tests debug=no'
    37                         }
    38                         else {
    39                                 sh 'make'
    40                         }
     33                if (full_build) {
     34                        sh 'make -C src/tests all-tests debug=yes'
     35                        sh 'make -C src/tests all-tests debug=no'
     36                }
     37                else {
     38                        sh 'make -C src/tests'
    4139                }
    4240
  • configure

    rc0aa336 rb4d65c7  
    61846184
    61856185
    6186 ac_config_files="$ac_config_files Makefile src/driver/Makefile src/Makefile src/examples/Makefile src/tests/Makefile src/prelude/Makefile src/libcfa/Makefile"
     6186ac_config_files="$ac_config_files Makefile src/driver/Makefile src/Makefile src/benchmark/Makefile src/examples/Makefile src/tests/Makefile src/prelude/Makefile src/libcfa/Makefile"
    61876187
    61886188
     
    69456945    "src/driver/Makefile") CONFIG_FILES="$CONFIG_FILES src/driver/Makefile" ;;
    69466946    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     6947    "src/benchmark/Makefile") CONFIG_FILES="$CONFIG_FILES src/benchmark/Makefile" ;;
    69476948    "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;;
    69486949    "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;;
  • configure.ac

    rc0aa336 rb4d65c7  
    190190        src/driver/Makefile
    191191        src/Makefile
     192        src/benchmark/Makefile
    192193        src/examples/Makefile
    193194        src/tests/Makefile
  • src/Common/ScopedMap.h

    rc0aa336 rb4d65c7  
    102102                iterator operator-- (int) { iterator tmp = *this; --(*this); return tmp; }
    103103
    104                 bool operator== (const iterator &that) {
     104                bool operator== (const iterator &that) const {
    105105                        return scopes == that.scopes && level == that.level && it == that.it;
    106106                }
    107                 bool operator!= (const iterator &that) { return !( *this == that ); }
     107                bool operator!= (const iterator &that) const { return !( *this == that ); }
    108108
    109109                size_type get_level() const { return level; }
     
    180180                const_iterator operator-- (int) { const_iterator tmp = *this; --(*this); return tmp; }
    181181
    182                 bool operator== (const const_iterator &that) {
     182                bool operator== (const const_iterator &that) const {
    183183                        return scopes == that.scopes && level == that.level && it == that.it;
    184184                }
    185                 bool operator!= (const const_iterator &that) { return !( *this == that ); }
     185                bool operator!= (const const_iterator &that) const { return !( *this == that ); }
    186186
    187187                size_type get_level() const { return level; }
  • src/Makefile.am

    rc0aa336 rb4d65c7  
    2626
    2727include CodeGen/module.mk
     28include CodeTools/module.mk
    2829include Common/module.mk
    2930include ControlStruct/module.mk
  • src/Makefile.in

    rc0aa336 rb4d65c7  
    2424#SRC +=  ArgTweak/Rewriter.cc \
    2525#       ArgTweak/Mutate.cc
     26
     27######################### -*- Mode: Makefile-Gmake -*- ########################
     28###############################################################################
    2629
    2730######################### -*- Mode: Makefile-Gmake -*- ########################
     
    7174build_triplet = @build@
    7275host_triplet = @host@
    73 DIST_COMMON = $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk \
     76DIST_COMMON = $(srcdir)/CodeGen/module.mk \
     77        $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk \
    7478        $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk \
    7579        $(srcdir)/InitTweak/module.mk $(srcdir)/Makefile.am \
     
    99103        CodeGen/driver_cfa_cpp-FixMain.$(OBJEXT) \
    100104        CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT) \
     105        CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT) \
    101106        Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \
    102107        Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \
     
    376381        CodeGen/CodeGenerator.cc CodeGen/GenType.cc \
    377382        CodeGen/FixNames.cc CodeGen/FixMain.cc \
    378         CodeGen/OperatorTable.cc Common/SemanticError.cc \
    379         Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \
     383        CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \
     384        Common/SemanticError.cc Common/UniqueName.cc \
     385        Common/DebugMalloc.cc Common/Assert.cc \
    380386        ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
    381387        ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
     
    440446.SUFFIXES:
    441447.SUFFIXES: .cc .ll .o .obj .yy
    442 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)
     448$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk $(am__configure_deps)
    443449        @for dep in $?; do \
    444450          case '$(am__configure_deps)' in \
     
    461467            cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
    462468        esac;
    463 $(srcdir)/CodeGen/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk:
     469$(srcdir)/CodeGen/module.mk $(srcdir)/CodeTools/module.mk $(srcdir)/Common/module.mk $(srcdir)/ControlStruct/module.mk $(srcdir)/GenPoly/module.mk $(srcdir)/InitTweak/module.mk $(srcdir)/Parser/module.mk $(srcdir)/ResolvExpr/module.mk $(srcdir)/SymTab/module.mk $(srcdir)/SynTree/module.mk $(srcdir)/Tuples/module.mk:
    464470
    465471$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
     
    526532CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT):  \
    527533        CodeGen/$(am__dirstamp) CodeGen/$(DEPDIR)/$(am__dirstamp)
     534CodeTools/$(am__dirstamp):
     535        @$(MKDIR_P) CodeTools
     536        @: > CodeTools/$(am__dirstamp)
     537CodeTools/$(DEPDIR)/$(am__dirstamp):
     538        @$(MKDIR_P) CodeTools/$(DEPDIR)
     539        @: > CodeTools/$(DEPDIR)/$(am__dirstamp)
     540CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT):  \
     541        CodeTools/$(am__dirstamp) CodeTools/$(DEPDIR)/$(am__dirstamp)
    528542Common/$(am__dirstamp):
    529543        @$(MKDIR_P) Common
     
    813827        -rm -f CodeGen/driver_cfa_cpp-Generate.$(OBJEXT)
    814828        -rm -f CodeGen/driver_cfa_cpp-OperatorTable.$(OBJEXT)
     829        -rm -f CodeTools/driver_cfa_cpp-DeclStats.$(OBJEXT)
    815830        -rm -f Common/driver_cfa_cpp-Assert.$(OBJEXT)
    816831        -rm -f Common/driver_cfa_cpp-DebugMalloc.$(OBJEXT)
     
    922937@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-Generate.Po@am__quote@
    923938@AMDEP_TRUE@@am__include@ @am__quote@CodeGen/$(DEPDIR)/driver_cfa_cpp-OperatorTable.Po@am__quote@
     939@AMDEP_TRUE@@am__include@ @am__quote@CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po@am__quote@
    924940@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-Assert.Po@am__quote@
    925941@AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-DebugMalloc.Po@am__quote@
     
    11481164@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeGen/driver_cfa_cpp-OperatorTable.obj `if test -f 'CodeGen/OperatorTable.cc'; then $(CYGPATH_W) 'CodeGen/OperatorTable.cc'; else $(CYGPATH_W) '$(srcdir)/CodeGen/OperatorTable.cc'; fi`
    11491165
     1166CodeTools/driver_cfa_cpp-DeclStats.o: CodeTools/DeclStats.cc
     1167@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.o -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc
     1168@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po
     1169@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.o' libtool=no @AMDEPBACKSLASH@
     1170@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1171@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.o `test -f 'CodeTools/DeclStats.cc' || echo '$(srcdir)/'`CodeTools/DeclStats.cc
     1172
     1173CodeTools/driver_cfa_cpp-DeclStats.obj: CodeTools/DeclStats.cc
     1174@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT CodeTools/driver_cfa_cpp-DeclStats.obj -MD -MP -MF CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`
     1175@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Tpo CodeTools/$(DEPDIR)/driver_cfa_cpp-DeclStats.Po
     1176@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='CodeTools/DeclStats.cc' object='CodeTools/driver_cfa_cpp-DeclStats.obj' libtool=no @AMDEPBACKSLASH@
     1177@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1178@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o CodeTools/driver_cfa_cpp-DeclStats.obj `if test -f 'CodeTools/DeclStats.cc'; then $(CYGPATH_W) 'CodeTools/DeclStats.cc'; else $(CYGPATH_W) '$(srcdir)/CodeTools/DeclStats.cc'; fi`
     1179
    11501180Common/driver_cfa_cpp-SemanticError.o: Common/SemanticError.cc
    11511181@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc
     
    26312661        -rm -f CodeGen/$(DEPDIR)/$(am__dirstamp)
    26322662        -rm -f CodeGen/$(am__dirstamp)
     2663        -rm -f CodeTools/$(DEPDIR)/$(am__dirstamp)
     2664        -rm -f CodeTools/$(am__dirstamp)
    26332665        -rm -f Common/$(DEPDIR)/$(am__dirstamp)
    26342666        -rm -f Common/$(am__dirstamp)
     
    26642696
    26652697distclean: distclean-am
    2666         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2698        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
    26672699        -rm -f Makefile
    26682700distclean-am: clean-am distclean-compile distclean-generic \
     
    27102742
    27112743maintainer-clean: maintainer-clean-am
    2712         -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
     2744        -rm -rf ./$(DEPDIR) CodeGen/$(DEPDIR) CodeTools/$(DEPDIR) Common/$(DEPDIR) ControlStruct/$(DEPDIR) GenPoly/$(DEPDIR) InitTweak/$(DEPDIR) Parser/$(DEPDIR) ResolvExpr/$(DEPDIR) SymTab/$(DEPDIR) SynTree/$(DEPDIR) Tuples/$(DEPDIR)
    27132745        -rm -f Makefile
    27142746maintainer-clean-am: distclean-am maintainer-clean-generic
  • src/ResolvExpr/Resolver.cc

    rc0aa336 rb4d65c7  
    449449                        TypeSubstitution sub = makeGenericSubstitutuion( sit );
    450450                        StructDecl * st = sit->get_baseStruct();
     451                        if(st->get_members().empty()) return;
    451452                        // want to resolve each initializer to the members of the struct,
    452453                        // but if there are more initializers than members we should stop
     
    458459                        TypeSubstitution sub = makeGenericSubstitutuion( uit );
    459460                        UnionDecl * un = uit->get_baseUnion();
     461                        if(un->get_members().empty()) return;
    460462                        // only resolve to the first member of a union
    461463                        resolveSingleAggrInit( *un->get_members().begin(), init, initEnd, sub );
  • src/libcfa/concurrency/CtxSwitch-x86_64.S

    rc0aa336 rb4d65c7  
    4949        // Save volatile registers on the stack.
    5050
     51        subq   $8,%rsp
     52        stmxcsr 0(%rsp)         // 4 bytes
     53        fnstcw  4(%rsp)         // 2 bytes
    5154        pushq %r15
    5255        pushq %r14
     
    7275        popq %r14
    7376        popq %r15
     77        fldcw   4(%rsp)
     78        ldmxcsr 0(%rsp)
     79        addq $8,%rsp
    7480
    7581        // Return to thread.
  • src/libcfa/concurrency/coroutines

    rc0aa336 rb4d65c7  
    3030};
    3131
    32 #define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this);
     32#define DECL_COROUTINE(X) static inline coroutine* get_coroutine(X* this) { return &this->c; } void main(X* this)
    3333
    3434//-----------------------------------------------------------------------------
     
    6565
    6666// Private wrappers for context switch and stack creation
    67 extern void corCxtSw(coroutine * src, coroutine * dst);
     67extern void CoroutineCtxSwitch(coroutine * src, coroutine * dst);
    6868extern void create_stack( coStack_t * this, unsigned int storageSize );
    6969
     
    8181                src->name, src, src->last->name, src->last );
    8282
    83         corCxtSw( src, src->last );
     83        CoroutineCtxSwitch( src, src->last );
    8484}
    8585
     
    107107
    108108      // always done for performance testing
    109         corCxtSw( src, dst );
     109        CoroutineCtxSwitch( src, dst );
     110}
     111
     112static inline void resume(coroutine * dst) {
     113        coroutine * src = this_coroutine();             // optimization
     114
     115      // not resuming self ?
     116        if ( src != dst ) {
     117                assertf( dst->notHalted ,
     118                        "Attempt by coroutine %.256s (%p) to resume terminated coroutine %.256s (%p).\n"
     119                        "Possible cause is terminated coroutine's main routine has already returned.",
     120                        src->name, src, dst->name, dst );
     121
     122            // set last resumer
     123                dst->last = src;
     124        } // if
     125
     126      // always done for performance testing
     127        CoroutineCtxSwitch( src, dst );
    110128}
    111129
  • src/libcfa/concurrency/coroutines.c

    rc0aa336 rb4d65c7  
    9898}
    9999
    100 // We need to call suspend from invoke.c, so we expose this wrapper that
    101 // is not inline (We can't inline Cforall in C)
    102 void suspend_no_inline(void) {
    103         suspend();
    104 }
    105 
    106 void corCxtSw(coroutine* src, coroutine* dst) {
     100// Wrapper for co
     101void CoroutineCtxSwitch(coroutine* src, coroutine* dst) {
    107102        // THREAD_GETMEM( This )->disableInterrupts();
    108103
     
    167162}
    168163
     164// We need to call suspend from invoke.c, so we expose this wrapper that
     165// is not inline (We can't inline Cforall in C)
     166extern "C" {
     167        void __suspend_internal(void) {
     168                suspend();
     169        }
     170}
     171
    169172// Local Variables: //
    170173// mode: c //
  • src/libcfa/concurrency/invoke.c

    rc0aa336 rb4d65c7  
    2828// Called from the kernel when starting a coroutine or task so must switch back to user mode.
    2929
    30 extern void __suspend_no_inline__F___1(void);
    31 extern void __signal_termination__F_P7sthread__1(struct thread*);
     30extern void __suspend_internal(void);
     31extern void __thread_signal_termination(struct thread*);
    3232
    3333void CtxInvokeCoroutine(
     
    4141
    4242      if(cor->state == Primed) {
    43             __suspend_no_inline__F___1();
     43            __suspend_internal();
    4444      }
    4545
     
    5252
    5353      //Final suspend, should never return
    54       __suspend_no_inline__F___1();
    55       assertf(false, "Resumed dead coroutine");
     54      __suspend_internal();
     55      abortf("Resumed dead coroutine");
    5656}
    5757
     
    6161      void *this
    6262) {
    63       // LIB_DEBUG_PRINTF("Invoke Thread : Received %p (main %p, get_t %p)\n", this, main, get_thread);
    64 
    65       __suspend_no_inline__F___1();
     63      __suspend_internal();
    6664
    6765      struct thread* thrd = get_thread( this );
     
    7270      main( this );
    7371
    74       __signal_termination__F_P7sthread__1(thrd);
     72      __thread_signal_termination(thrd);
    7573
    7674      //Final suspend, should never return
    77       __suspend_no_inline__F___1();
    78       assertf(false, "Resumed dead thread");
     75      __suspend_internal();
     76      abortf("Resumed dead thread");
    7977}
    8078
     
    111109      struct FakeStack {
    112110            void *fixedRegisters[5];                    // fixed registers rbx, r12, r13, r14, r15
    113             void *rturn;                                        // where to go on return from uSwitch
     111            uint32_t mxcr;                                  // SSE Status and Control bits (control bits are preserved across function calls)
     112            uint16_t fcw;                                   // X97 FPU control word (preserved across function calls)
     113            void *rturn;                                      // where to go on return from uSwitch
    114114            void *dummyReturn;                          // NULL return address to provide proper alignment
    115115      };
     
    122122      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[0] = this;
    123123      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fixedRegisters[1] = invoke;
     124      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->mxcr = 0x1F80; //Vol. 2A 3-520
     125      ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    124126#else
    125127      #error Only __i386__ and __x86_64__ is supported for threads in cfa
  • src/libcfa/concurrency/kernel.c

    rc0aa336 rb4d65c7  
    1515//
    1616
     17//Start and stop routine for the kernel, declared first to make sure they run first
     18void kernel_startup(void)  __attribute__((constructor(101)));
     19void kernel_shutdown(void) __attribute__((destructor(101)));
     20
    1721//Header
    1822#include "kernel"
     
    3943};
    4044
    41 DECL_COROUTINE(processorCtx_t)
     45DECL_COROUTINE(processorCtx_t);
    4246
    4347#define KERNEL_STORAGE(T,X) static char X##_storage[sizeof(T)]
     
    5256processor * systemProcessor;
    5357thread * mainThread;
    54 
    55 void kernel_startup(void)  __attribute__((constructor(101)));
    56 void kernel_shutdown(void) __attribute__((destructor(101)));
    5758
    5859//-----------------------------------------------------------------------------
     
    184185void main(processorCtx_t * ctx);
    185186thread * nextThread(cluster * this);
    186 void runThread(processor * this, thread * dst);
     187void scheduleInternal(processor * this, thread * dst);
    187188void spin(processor * this, unsigned int * spin_count);
    188189
     
    197198
    198199                if(readyThread) {
    199                         runThread(this, readyThread);
     200                        scheduleInternal(this, readyThread);
    200201                        spin_count = 0;
    201202                } else {
     
    209210}
    210211
    211 void runThread(processor * this, thread * dst) {
     212//Declarations for scheduleInternal
     213extern void ThreadCtxSwitch(coroutine * src, coroutine * dst);
     214
     215// scheduleInternal runs a thread by context switching
     216// from the processor coroutine to the target thread
     217void scheduleInternal(processor * this, thread * dst) {
     218        // coroutine * proc_ctx = get_coroutine(this->ctx);
     219        // coroutine * thrd_ctx = get_coroutine(dst);
     220
     221        // //Update global state
     222        // this->current_thread = dst;
     223
     224        // // Context Switch to the thread
     225        // ThreadCtxSwitch(proc_ctx, thrd_ctx);
     226        // // when ThreadCtxSwitch returns we are back in the processor coroutine
     227
    212228        coroutine * proc_ctx = get_coroutine(this->ctx);
    213229        coroutine * thrd_ctx = get_coroutine(dst);
    214         thrd_ctx->last = proc_ctx;
    215 
    216         // context switch to specified coroutine
    217         // Which is now the current_coroutine
    218         // LIB_DEBUG_PRINTF("Kernel : switching to ctx %p (from %p, current %p)\n", thrd_ctx, proc_ctx, current_coroutine);
    219         this->current_thread = dst;
    220         this->current_coroutine = thrd_ctx;
    221         CtxSwitch( proc_ctx->stack.context, thrd_ctx->stack.context );
    222         this->current_coroutine = proc_ctx;
    223         // LIB_DEBUG_PRINTF("Kernel : returned from ctx %p (to %p, current %p)\n", thrd_ctx, proc_ctx, current_coroutine);
    224 
    225         // when CtxSwitch returns we are back in the processor coroutine
    226 }
    227 
     230      thrd_ctx->last = proc_ctx;
     231 
     232      // context switch to specified coroutine
     233      // Which is now the current_coroutine
     234      LIB_DEBUG_PRINTF("Kernel : switching to ctx %p (from %p, current %p)\n", thrd_ctx, proc_ctx, this->current_coroutine);
     235      this->current_thread = dst;
     236      this->current_coroutine = thrd_ctx;
     237      CtxSwitch( proc_ctx->stack.context, thrd_ctx->stack.context );
     238      this->current_coroutine = proc_ctx;
     239      LIB_DEBUG_PRINTF("Kernel : returned from ctx %p (to %p, current %p)\n", thrd_ctx, proc_ctx, this->current_coroutine);
     240 
     241      // when CtxSwitch returns we are back in the processor coroutine
     242}
     243
     244// Handles spinning logic
     245// TODO : find some strategy to put cores to sleep after some time
    228246void spin(processor * this, unsigned int * spin_count) {
    229247        (*spin_count)++;
    230248}
    231249
     250// Context invoker for processors
     251// This is the entry point for processors (kernel threads)
     252// It effectively constructs a coroutine by stealing the pthread stack
    232253void * CtxInvokeProcessor(void * arg) {
    233254        processor * proc = (processor *) arg;
     
    241262        processorCtx_t proc_cor_storage = { proc, &info };
    242263
     264        //Set global state
    243265        proc->current_coroutine = &proc->ctx->c;
    244266        proc->current_thread = NULL;
    245267
     268        //We now have a proper context from which to schedule threads
    246269        LIB_DEBUG_PRINTF("Kernel : core %p created (%p)\n", proc, proc->ctx);
    247 
    248         // LIB_DEBUG_PRINTF("Kernel : core    base : %p \n", info.base );
    249         // LIB_DEBUG_PRINTF("Kernel : core storage : %p \n", info.storage );
    250         // LIB_DEBUG_PRINTF("Kernel : core    size : %x \n", info.size );
    251         // LIB_DEBUG_PRINTF("Kernel : core   limit : %p \n", info.limit );
    252         // LIB_DEBUG_PRINTF("Kernel : core context : %p \n", info.context );
    253         // LIB_DEBUG_PRINTF("Kernel : core     top : %p \n", info.top );
    254 
    255         //We now have a proper context from which to schedule threads
    256270
    257271        // SKULLDUGGERY: Since the coroutine doesn't have its own stack, we can't
     
    264278      proc_cor_storage.c.notHalted = false;
    265279
     280        // Main routine of the core returned, the core is now fully terminated
    266281        LIB_DEBUG_PRINTF("Kernel : core %p main ended (%p)\n", proc, proc->ctx);       
    267282
  • src/libcfa/concurrency/threads

    rc0aa336 rb4d65c7  
    2727// Anything that implements this trait can be resumed.
    2828// Anything that is resumed is a coroutine.
    29 trait is_thread(dtype T | sized(T)) {
     29trait is_thread(dtype T) {
    3030      void main(T* this);
    3131      thread* get_thread(T* this);
    3232};
    3333
    34 #define DECL_THREAD(X) static inline thread* get_thread(X* this) { return &this->t; } void main(X* this);
     34#define DECL_THREAD(X) thread* get_thread(X* this) { return &this->t; } void main(X* this)
    3535
    36 forall( dtype T | sized(T) | is_thread(T) )
     36forall( dtype T | is_thread(T) )
    3737static inline coroutine* get_coroutine(T* this) {
    3838        return &get_thread(this)->c;
  • src/libcfa/concurrency/threads.c

    rc0aa336 rb4d65c7  
    3131//-----------------------------------------------------------------------------
    3232// Forward declarations
    33 forall( dtype T | sized(T) | is_thread(T) )
     33forall( dtype T | is_thread(T) )
    3434void start( T* this );
    3535
    36 forall( dtype T | sized(T) | is_thread(T) )
     36forall( dtype T | is_thread(T) )
    3737void stop( T* this );
    3838
     
    7878extern void thread_schedule( thread * );
    7979
    80 forall( dtype T | sized(T) | is_thread(T) )
     80forall( dtype T | is_thread(T) )
    8181void start( T* this ) {
    8282        coroutine* thrd_c = get_coroutine(this);
     
    8585        get_this_processor()->current_coroutine = thrd_c;
    8686
    87         // LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", handle, thrd_c, thrd_h);
     87        LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
    8888
    8989        create_stack(&thrd_c->stack, thrd_c->stack.size);
     
    9191        CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context );
    9292
     93        LIB_DEBUG_PRINTF("Thread started : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
     94
    9395        thread_schedule(thrd_h);
    9496}
    9597
    96 forall( dtype T | sized(T) | is_thread(T) )
     98forall( dtype T | is_thread(T) )
    9799void stop( T* this ) {
    98100        thread*  thrd = get_thread(this);
     
    102104}
    103105
    104 void signal_termination( thread * this ) {
    105         this->c.state = Halt;
    106       this->c.notHalted = false;
    107         unlock( &this->lock );
    108 }
    109 
    110106void yield( void ) {
    111107        thread_schedule( this_thread() );
    112108        suspend();
     109}
     110
     111void ThreadCtxSwitch(coroutine* src, coroutine* dst) {
     112        dst->last = src;
     113
     114        // set state of current coroutine to inactive
     115        src->state = Inactive;
     116
     117        // set new coroutine that task is executing
     118        get_this_processor()->current_coroutine = dst; 
     119
     120        // context switch to specified coroutine
     121        CtxSwitch( src->stack.context, dst->stack.context );
     122        // when CtxSwitch returns we are back in the src coroutine
     123
     124        // set state of new coroutine to active
     125        src->state = Active;
     126}
     127
     128// C Helper to signal the termination of a thread
     129// Used in invoke.c
     130extern "C" {
     131        void __thread_signal_termination( thread * this ) {
     132                this->c.state = Halt;
     133                this->c.notHalted = false;
     134                unlock( &this->lock );
     135        }
    113136}
    114137
  • src/libcfa/containers/vector

    rc0aa336 rb4d65c7  
    118118}
    119119
    120 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    121 static inline const T* cbegin(const vector(T, allocator_t)* this)
    122 {
    123         return data(&this->storage);
    124 }
     120// forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     121// static inline const T* cbegin(const vector(T, allocator_t)* this)
     122// {
     123//      return data(&this->storage);
     124// }
    125125
    126126forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     
    130130}
    131131
    132 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    133 static inline const T* cend(const vector(T, allocator_t)* this)
    134 {
    135         return data(&this->storage) + this->size;
    136 }
     132// forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     133// static inline const T* cend(const vector(T, allocator_t)* this)
     134// {
     135//      return data(&this->storage) + this->size;
     136// }
    137137
    138138//------------------------------------------------------------------------------
  • src/libcfa/stdlib

    rc0aa336 rb4d65c7  
    2929
    3030extern "C" { void * malloc( size_t ); }                                 // use default C routine for void *
    31 forall( otype T ) T * malloc( void );
    32 forall( otype T ) T * malloc( char fill );
    33 forall( otype T ) T * malloc( T * ptr, size_t size );
    34 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
     31forall( dtype T | sized(T) ) T * malloc( void );
     32forall( dtype T | sized(T) ) T * malloc( char fill );
     33forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size );
     34forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill );
    3535extern "C" { void * calloc( size_t nmemb, size_t size ); } // use default C routine for void *
    36 forall( otype T ) T * calloc( size_t nmemb );
     36forall( dtype T | sized(T) ) T * calloc( size_t nmemb );
    3737extern "C" { void * realloc( void * ptr, size_t size ); } // use default C routine for void *
    38 forall( otype T ) T * realloc( T * ptr, size_t size );
    39 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
     38forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size );
     39forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill );
    4040
    41 forall( otype T ) T * aligned_alloc( size_t alignment );
    42 forall( otype T ) T * memalign( size_t alignment );             // deprecated
    43 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
     41forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment );
     42forall( dtype T | sized(T) ) T * memalign( size_t alignment );          // deprecated
     43forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment );
    4444
    4545extern "C" {
     
    4848} // extern "C"
    4949
    50 forall( otype T, ttype Params | { void ?{}(T *, Params); } ) T * new( Params p );
     50forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) T * new( Params p );
    5151forall( dtype T | { void ^?{}(T *); } ) void delete( T * ptr );
    5252
  • src/libcfa/stdlib.c

    rc0aa336 rb4d65c7  
    2727} // extern "C"
    2828
    29 forall( otype T ) T * malloc( void ) {
     29forall( dtype T | sized(T) ) T * malloc( void ) {
    3030        //printf( "malloc1\n" );
    31     return (T *)malloc( sizeof(T) );
    32 } // malloc
    33 forall( otype T ) T * malloc( char fill ) {
     31    return (T *)(void*)malloc( (size_t)sizeof(T) );
     32} // malloc
     33forall( dtype T | sized(T) ) T * malloc( char fill ) {
    3434        //printf( "malloc3\n" );
    35         T * ptr = (T *)malloc( sizeof(T) );
     35        T * ptr = (T *)(void*)malloc( (size_t)sizeof(T) );
    3636    return memset( ptr, (int)fill, sizeof(T) );
    3737} // malloc
    3838
    39 forall( otype T ) T * calloc( size_t nmemb ) {
     39forall( dtype T | sized(T) ) T * calloc( size_t nmemb ) {
    4040        //printf( "calloc\n" );
    4141    return (T *)calloc( nmemb, sizeof(T) );
    4242} // calloc
    4343
    44 forall( otype T ) T * realloc( T * ptr, size_t size ) {
     44forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size ) {
    4545        //printf( "realloc1\n" );
    4646    return (T *)(void *)realloc( (void *)ptr, size );
    4747} // realloc
    48 forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill ) {
     48forall( dtype T | sized(T) ) T * realloc( T * ptr, size_t size, unsigned char fill ) {
    4949        //printf( "realloc2\n" );
    5050    char * nptr = (T *)(void *)realloc( (void *)ptr, size );
     
    5454} // realloc
    5555
    56 forall( otype T ) T * malloc( T * ptr, size_t size ) {
     56forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size ) {
    5757        //printf( "malloc4\n" );
    5858    return (T *)realloc( ptr, size );
    5959} // malloc
    60 forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill ) {
     60forall( dtype T | sized(T) ) T * malloc( T * ptr, size_t size, unsigned char fill ) {
    6161        //printf( "malloc5\n" );
    6262    return (T *)realloc( ptr, size, fill );
    6363} // malloc
    6464
    65 forall( otype T ) T * aligned_alloc( size_t alignment ) {
     65forall( dtype T | sized(T) ) T * aligned_alloc( size_t alignment ) {
    6666        //printf( "aligned_alloc\n" );
    6767    return (T *)memalign( alignment, sizeof(T) );
    6868} // aligned_alloc
    6969
    70 forall( otype T ) T * memalign( size_t alignment ) {
     70forall( dtype T | sized(T) ) T * memalign( size_t alignment ) {
    7171        //printf( "memalign\n" );
    7272    return (T *)memalign( alignment, sizeof(T) );
    7373} // memalign
    7474
    75 forall( otype T ) int posix_memalign( T ** ptr, size_t alignment ) {
     75forall( dtype T | sized(T) ) int posix_memalign( T ** ptr, size_t alignment ) {
    7676        //printf( "posix_memalign\n" );
    7777    return posix_memalign( (void **)ptr, alignment, sizeof(T) );
    7878} // posix_memalign
    7979
    80 forall( otype T, ttype Params | { void ?{}(T *, Params); } )
     80forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } )
    8181T * new( Params p ) {
    8282        return ((T*)malloc()){ p };
  • src/main.cc

    rc0aa336 rb4d65c7  
    3535#include "CodeGen/FixNames.h"
    3636#include "CodeGen/FixMain.h"
     37#include "CodeTools/DeclStats.h"
    3738#include "ControlStruct/Mutate.h"
    3839#include "SymTab/Validate.h"
     
    6162        bboxp = false,
    6263        ctorinitp = false,
     64        declstatsp = false,
    6365        exprp = false,
    6466        expraltp = false,
     
    244246                } // if
    245247
     248                if ( declstatsp ) {
     249                        CodeTools::printDeclStats( translationUnit );
     250                        deleteAll( translationUnit );
     251                        return 0;
     252                }
     253
    246254                if ( bresolvep ) {
    247255                        dump( translationUnit );
     
    339347
    340348void parse_cmdline( int argc, char * argv[], const char *& filename ) {
    341         enum { Ast, Bbox, Bresolver, CtorInitFix, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
     349        enum { Ast, Bbox, Bresolver, CtorInitFix, DeclStats, Expr, ExprAlt, Grammar, LibCFA, Nopreamble, Parse, Prototypes, Resolver, Symbol, Tree, TupleExpansion, Validate, };
    342350
    343351        static struct option long_opts[] = {
     
    346354                { "before-resolver", no_argument, 0, Bresolver },
    347355                { "ctorinitfix", no_argument, 0, CtorInitFix },
     356                { "decl-stats", no_argument, 0, DeclStats },
    348357                { "expr", no_argument, 0, Expr },
    349358                { "expralt", no_argument, 0, ExprAlt },
     
    365374
    366375        int c;
    367         while ( (c = getopt_long( argc, argv, "abBcefglmnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
     376        while ( (c = getopt_long( argc, argv, "abBcdefglmnpqrstTvyzD:F:", long_opts, &long_index )) != -1 ) {
    368377                switch ( c ) {
    369378                  case Ast:
     
    381390                  case 'c':
    382391                        ctorinitp = true;
     392                        break;
     393                  case DeclStats:
     394                  case 'd':
     395                    declstatsp = true;
    383396                        break;
    384397                  case Expr:
  • src/prelude/Makefile.am

    rc0aa336 rb4d65c7  
    2828
    2929# create forward declarations for gcc builtins
    30 builtins.cf : builtins.c
    31         ${AM_V_GEN}if [ -e $< ] ; then \
    32                 @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \
    33         fi
     30builtins.cf : builtins.c prototypes.sed
     31        ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
    3432
    3533builtins.c : builtins.def prototypes.awk
    36         ${AM_V_GEN}if [ -e $< ] ; then \
    37                 @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \
    38         fi
     34        ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
    3935
    4036builtins.def :
  • src/prelude/Makefile.in

    rc0aa336 rb4d65c7  
    424424
    425425# create forward declarations for gcc builtins
    426 builtins.cf : builtins.c
    427         ${AM_V_GEN}if [ -e $< ] ; then \
    428                 @BACKEND_CC@ -E -P $^ | sed -e "/targetm/s/.*//" -e "/_Decimal/s/.*//" -e "s/void (const char \*)0();//" -e "s/\"//g" -e "s/\(__builtin_\) /\1/" > $@ ; \
    429         fi
     426builtins.cf : builtins.c prototypes.sed
     427        ${AM_V_GEN}@BACKEND_CC@ -E -P $< | sed -f prototypes.sed > $@
    430428
    431429builtins.c : builtins.def prototypes.awk
    432         ${AM_V_GEN}if [ -e $< ] ; then \
    433                 @BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@ ; \
    434         fi
     430        ${AM_V_GEN}@BACKEND_CC@ -E prototypes.c | awk -f prototypes.awk > $@
    435431
    436432builtins.def :
  • src/prelude/builtins.c

    rc0aa336 rb4d65c7  
    33#define BT_LAST(NAME) FUNC_SIMPLE(void, NAME)
    44
     5#define BT_BOOL _Bool
    56#define BT_UINTMAX unsigned long int
    67#define BT_UINT16 short int
     
    2223#define BT_LONGLONG long long
    2324#define BT_LONG long
    24 #define BT_DFLOAT32 _Decimal32
    25 #define BT_DFLOAT64 _Decimal64
    26 #define BT_DFLOAT128 _Decimal128
     25#define BT_DFLOAT32 __Unsupported
     26#define BT_DFLOAT64 __Unsupported
     27#define BT_DFLOAT128 __Unsupported
    2728#define BT_DOUBLEPTR double *
    2829#define BT_DOUBLE double
    2930#define BT_FLOATPTR float *
     31#define BT_FLOAT128X __Unsupported
     32#define BT_FLOAT128 __Unsupported
     33#define BT_FLOAT64X __Unsupported
     34#define BT_FLOAT64 __Unsupported
     35#define BT_FLOAT32X __Unsupported
     36#define BT_FLOAT32 __Unsupported
     37#define BT_FLOAT16 __Unsupported
    3038#define BT_FLOAT float
     39#define BT_CONST_VPTR const volatile void *
    3140#define BT_CONST_PTR const void *
    3241#define BT_CONST_STRING const char *
     42#define BT_CONST_TM_PTR const struct tm *
    3343#define BT_PTR_FN_VOID_VAR_PTR_SIZE
    3444#define BT_PTR_CONST_STRING char *const
    3545#define BT_PTRMODE_PTR
    3646#define BT_PTRPTR void **
     47#define BT_VPTR volatile void *
    3748#define BT_PTR void *
    3849#define BT_VOID void
     
    4758#define BT_SSIZE long int
    4859#define BT_PID int
    49 
    50 #define BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_LONGDOUBLE, NAME, BT_LONGDOUBLE)
    51 #define BT_FN_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_VALIST_ARG)
    52 #define BT_FN_VOID_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR)
    53 #define BT_FN_INT_CONST_PTR_CONST_PTR_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
    54 #define BT_FN_VOID_VALIST_REF(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VALIST_REF)
    55 #define BT_FN_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_COMPLEX_FLOAT)
    56 #define BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VAR)
    57 #define BT_FN_VOID_PTR_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_PTR)
    58 #define BT_FN_FLOAT_FLOAT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_LONGDOUBLE)
    59 #define BT_FN_INT_UINT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_UINT)
    60 #define BT_FN_CONST_STRING(NAME) FUNC_SIMPLE(BT_CONST_STRING, NAME)
    61 #define BT_FN_FLOAT_FLOAT_FLOATPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOATPTR)
     60#define BT_I16 __int128
     61#define BT_I8 long long int
     62#define BT_I4 int
     63#define BT_I2 short
     64#define BT_I1 char
     65
    6266#define BT_FN_INT_INT_INT_INT_INT_INT_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_INT, BT_INT, BT_INT, BT_INT, BT_VAR)
    63 #define BT_FN_INT_INT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT)
    64 #define BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
    6567#define BT_FN_INT_LONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_LONG)
    66 #define BT_FN_INT_STRING_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VAR)
    67 #define BT_FN_VOID_PTR_WORD_WORD_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
    6868#define BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_PTR)
    69 #define BT_FN_INT_DFLOAT128(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT128)
    70 #define BT_FN_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE)
    71 #define BT_FN_FLOAT_CONST_STRING(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_CONST_STRING)
    72 #define BT_FN_LONGDOUBLE_LONGDOUBLE_INT(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_INT)
    73 #define BT_FN_FLOAT_FLOAT_INT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_INT)
    74 #define BT_FN_INT_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING)
    75 #define BT_FN_INT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_LONGDOUBLE)
    76 #define BT_FN_SIZE_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_STRING, BT_CONST_STRING)
     69#define BT_FN_VOID_VPTR_I4_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_I4, BT_INT)
     70#define BT_FN_I1_VPTR_I1_INT(NAME) FUNC_SIMPLE(BT_I1, NAME, BT_VPTR, BT_I1, BT_INT)
     71#define BT_FN_INT(NAME) FUNC_SIMPLE(BT_INT, NAME)
     72#define BT_FN_STRING_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_CONST_STRING)
     73#define BT_FN_PTR_CONST_PTR_SIZE_VAR(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_CONST_PTR, BT_SIZE, BT_VAR)
     74#define BT_FN_INT_ULONGLONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_ULONGLONG)
     75#define BT_FN_INT_CONST_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_SIZE)
     76#define BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_PTR_CONST_STRING, BT_PTR_CONST_STRING)
     77#define BT_FN_STRING_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_STRING, BT_CONST_STRING, BT_SIZE)
    7778#define BT_FN_VOID_PTR_SIZE(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_SIZE)
    78 #define BT_FN_INT_CONST_STRING_PTR_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_PTR_CONST_STRING)
    79 #define BT_FN_DFLOAT64(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME)
    80 #define BT_FN_INT_UINTMAX(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_UINTMAX)
    81 #define BT_FN_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME)
    82 #define BT_FN_INT(NAME) FUNC_SIMPLE(BT_INT, NAME)
    83 #define BT_FN_FLOAT_FLOAT_FLOAT_INTPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT, BT_INTPTR)
    84 #define BT_FN_DOUBLE_DOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_LONGDOUBLE)
    85 #define BT_FN_PTR_CONST_PTR_SIZE_VAR(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_CONST_PTR, BT_SIZE, BT_VAR)
    86 #define BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
    87 #define BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_COMPLEX_LONGDOUBLE)
    88 #define BT_FN_STRING_CONST_STRING_CONST_STRING_INT(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_INT)
    89 #define BT_FN_LONGDOUBLE_LONGDOUBLE_LONG(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONG)
    90 #define BT_FN_COMPLEX_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_DOUBLE)
    91 #define BT_FN_VOID(NAME) FUNC_SIMPLE(BT_VOID, NAME)
    92 #define BT_FN_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT)
    93 #define BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_CONST_STRING, BT_VALIST_ARG)
    94 #define BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_FLOAT, BT_FLOATPTR, BT_FLOATPTR)
    95 #define BT_FN_INT_DFLOAT64(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT64)
    96 #define BT_FN_FLOAT_FLOAT_INTPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_INTPTR)
    97 #define BT_FN_WINT_WINT(NAME) FUNC_SIMPLE(BT_WINT, NAME, BT_WINT)
    98 #define BT_FN_LONGLONG_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_LONGDOUBLE)
    99 #define BT_FN_DOUBLE_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE)
    100 #define BT_FN_DFLOAT64_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME, BT_CONST_STRING)
    101 #define BT_FN_DOUBLE_DOUBLE_INT(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_INT)
    10279#define BT_FN_INTMAX_INTMAX(NAME) FUNC_SIMPLE(BT_INTMAX, NAME, BT_INTMAX)
    103 #define BT_FN_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_VAR)
    104 #define BT_FN_LONG_LONG_LONG(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONG, BT_LONG)
    105 #define BT_FN_DOUBLE_DOUBLE_LONG(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_LONG)
    106 #define BT_FN_LONG_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONGDOUBLE)
    107 #define BT_FN_FLOAT_FLOAT_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT, BT_FLOAT)
    108 #define BT_FN_VOID_VALIST_REF_VAR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VALIST_REF, BT_VAR)
    109 #define BT_FN_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING)
     80#define BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
     81#define BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_CONST_PTR, BT_SIZE, BT_SIZE)
    11082#define BT_FN_VOID_VALIST_REF_VALIST_ARG(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VALIST_REF, BT_VALIST_ARG)
    11183#define BT_FN_LONGDOUBLE_CONST_STRING(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_CONST_STRING)
     84#define BT_FN_LONGLONG_FLOAT(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_FLOAT)
     85#define BT_FN_DFLOAT32(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME)
     86#define BT_FN_INT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_LONGDOUBLE)
     87#define BT_FN_BOOL_VPTR_I2_I2(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_I2, BT_I2)
     88#define BT_FN_FLOAT_FLOAT_FLOATPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOATPTR)
     89#define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
     90#define BT_FN_VOID_PTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_INT)
     91#define BT_FN_LONG_LONG(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONG)
     92#define BT_FN_INT_DOUBLE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DOUBLE)
     93#define BT_FN_BOOL_VPTR_PTR_I16_BOOL_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_PTR, BT_I16, BT_BOOL, BT_INT, BT_INT)
     94#define BT_FN_UINT(NAME) FUNC_SIMPLE(BT_UINT, NAME)
     95#define BT_FN_DOUBLE_DOUBLE_INT(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_INT)
     96#define BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_LONGDOUBLE, BT_LONGDOUBLEPTR, BT_LONGDOUBLEPTR)
     97#define BT_FN_INT_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_CONST_STRING, BT_VAR)
     98#define BT_FN_BOOL_INT_INT_INTPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_INT, BT_INT, BT_INTPTR)
     99#define BT_FN_DFLOAT32_DFLOAT32(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME, BT_DFLOAT32)
     100#define BT_FN_VOID_VAR(NAME) FUNC_SIMPLE(BT_VOID, NAME)
     101#define BT_FN_INT_CONST_STRING_FILEPTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_FILEPTR)
     102#define BT_FN_VOID_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_INT)
     103#define BT_FN_DFLOAT128_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME, BT_CONST_STRING)
     104#define BT_FN_BOOL_VPTR_I16_I16(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_I16, BT_I16)
     105#define BT_FN_BOOL_LONG_LONG_LONGPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_LONG, BT_LONG, BT_LONG, BT_PTR)
     106#define BT_FN_INT_DFLOAT64(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT64)
     107#define BT_FN_LONG_FLOAT(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_FLOAT)
     108#define BT_FN_CONST_STRING(NAME) FUNC_SIMPLE(BT_CONST_STRING, NAME)
     109#define BT_FN_SIZE_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_STRING, BT_CONST_STRING)
     110#define BT_FN_COMPLEX_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_FLOAT)
     111#define BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_SIZE, BT_VPTR, BT_PTR, BT_PTR, BT_INT)
     112#define BT_FN_STRING_CONST_STRING_CONST_STRING_INT(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_INT)
     113#define BT_FN_INT_CONST_STRING_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_VAR)
     114#define BT_FN_LONGDOUBLE_LONGDOUBLE_INT(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_INT)
     115#define BT_FN_BOOL_VPTR_I1_I1(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_I1, BT_I1)
     116#define BT_FN_DOUBLE_DOUBLE_DOUBLEPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLEPTR)
     117#define BT_FN_DOUBLE_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE)
     118#define BT_FN_LONGDOUBLE_LONGDOUBLE_LONG(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONG)
     119#define BT_FN_I16_VPTR_I16_INT(NAME) FUNC_SIMPLE(BT_I16, NAME, BT_VPTR, BT_I16, BT_INT)
     120#define BT_FN_INT_STRING_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG)
     121#define BT_FN_INT_STRING_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_CONST_STRING, BT_VAR)
     122#define BT_FN_UINT64_UINT64(NAME) FUNC_SIMPLE(BT_UINT64, NAME, BT_UINT64)
     123#define BT_FN_BOOL_VPTR_PTR_I2_BOOL_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_PTR, BT_I2, BT_BOOL, BT_INT, BT_INT)
     124#define BT_FN_PTR_PTR_CONST_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_CONST_PTR, BT_SIZE)
     125#define BT_FN_STRING_CONST_STRING_INT(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_INT)
     126#define BT_FN_FLOAT_FLOAT_LONG(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_LONG)
     127#define BT_FN_FLOAT_CONST_STRING(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_CONST_STRING)
     128#define BT_FN_FLOAT_FLOAT_INTPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_INTPTR)
     129#define BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
     130#define BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_LONGDOUBLE, NAME, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
     131#define BT_FN_INT_LONGLONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_LONGLONG)
     132#define BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
     133#define BT_FN_PTR_PTR(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR)
     134#define BT_FN_I1_VPTR_I1_I1(NAME) FUNC_SIMPLE(BT_I1, NAME, BT_VPTR, BT_I1, BT_I1)
     135#define BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_COMPLEX_LONGDOUBLE)
     136#define BT_FN_FLOAT_FLOAT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_LONGDOUBLE)
     137#define BT_FN_DOUBLE_CONST_STRING(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_CONST_STRING)
     138#define BT_FN_DFLOAT128(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME)
     139#define BT_FN_I16_CONST_VPTR_INT(NAME) FUNC_SIMPLE(BT_I16, NAME, BT_CONST_VPTR, BT_INT)
     140#define BT_FN_FLOAT_FLOAT_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT, BT_FLOAT)
     141#define BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VAR)
     142#define BT_FN_SIZE_CONST_PTR_INT(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_PTR, BT_INT)
     143#define BT_FN_DOUBLE_DOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_LONGDOUBLE)
     144#define BT_FN_LONG_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONGDOUBLE)
     145#define BT_FN_BOOL_SIZE_CONST_VPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_SIZE, BT_CONST_VPTR)
     146#define BT_FN_I16_VPTR_I16(NAME) FUNC_SIMPLE(BT_I16, NAME, BT_VPTR, BT_I16)
     147#define BT_FN_VOID_VPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR)
     148#define BT_FN_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME)
     149#define BT_FN_VOID_PTRMODE_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTRMODE_PTR)
     150#define BT_FN_WINT_WINT(NAME) FUNC_SIMPLE(BT_WINT, NAME, BT_WINT)
     151#define BT_FN_BOOL_VPTR_I8_I8(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_I8, BT_I8)
     152#define BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_INTPTR)
     153#define BT_FN_DOUBLE_DOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_INTPTR)
     154#define BT_FN_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_COMPLEX_FLOAT)
     155#define BT_FN_BOOL_VPTR_PTR_I8_BOOL_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_PTR, BT_I8, BT_BOOL, BT_INT, BT_INT)
     156#define BT_FN_I4_CONST_VPTR_INT(NAME) FUNC_SIMPLE(BT_I4, NAME, BT_CONST_VPTR, BT_INT)
     157#define BT_FN_INT_WINT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_WINT)
     158#define BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_DOUBLE, BT_DOUBLEPTR, BT_DOUBLEPTR)
     159#define BT_FN_I8_VPTR_I8_INT(NAME) FUNC_SIMPLE(BT_I8, NAME, BT_VPTR, BT_I8, BT_INT)
     160#define BT_FN_VOID_PTR_WORD_WORD_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_WORD, BT_WORD, BT_PTR)
     161#define BT_FN_I4_VPTR_I4_I4(NAME) FUNC_SIMPLE(BT_I4, NAME, BT_VPTR, BT_I4, BT_I4)
     162#define BT_FN_PTR_CONST_PTR_INT_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_CONST_PTR, BT_INT, BT_SIZE)
     163#define BT_FN_INT_UINTMAX(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_UINTMAX)
     164#define BT_FN_BOOL_ULONGLONG_ULONGLONG_ULONGLONGPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG, BT_PTR)
     165#define BT_FN_LONGLONG_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_LONGDOUBLE)
     166#define BT_FN_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT)
     167#define BT_FN_INT_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
     168#define BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_STRING, BT_CONST_STRING, BT_SIZE, BT_SIZE)
     169#define BT_FN_INT_DFLOAT128(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT128)
     170#define BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR_FN_VOID_VAR_PTR_SIZE)
     171#define BT_FN_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_SIZE)
     172#define BT_FN_DFLOAT32_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME, BT_CONST_STRING)
     173#define BT_FN_LONG_LONG_LONG(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONG, BT_LONG)
     174#define BT_FN_VOID_VPTR_I8_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_I8, BT_INT)
     175#define BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VAR)
     176#define BT_FN_BOOL_VAR(NAME) FUNC_SIMPLE(BT_BOOL, NAME)
     177#define BT_FN_INT_FILEPTR_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_CONST_STRING, BT_VAR)
     178#define BT_FN_COMPLEX_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_DOUBLE)
     179#define BT_FN_INT_ULONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_ULONG)
     180#define BT_FN_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_SIZE)
     181#define BT_FN_VOID(NAME) FUNC_SIMPLE(BT_VOID, NAME)
     182#define BT_FN_INT_DFLOAT32(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT32)
     183#define BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_SIZE, BT_CONST_VPTR, BT_PTR, BT_INT)
     184#define BT_FN_UNWINDWORD_PTR(NAME) FUNC_SIMPLE(BT_UNWINDWORD, NAME, BT_PTR)
     185#define BT_FN_I1_CONST_VPTR_INT(NAME) FUNC_SIMPLE(BT_I1, NAME, BT_CONST_VPTR, BT_INT)
     186#define BT_FN_INT_STRING_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VAR)
     187#define BT_FN_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING)
     188#define BT_FN_PTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_SIZE, BT_SIZE)
     189#define BT_FN_VOID_VPTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_INT)
     190#define BT_FN_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME)
     191#define BT_FN_PTR_VAR(NAME) FUNC_SIMPLE(BT_PTR, NAME)
     192#define BT_FN_I8_CONST_VPTR_INT(NAME) FUNC_SIMPLE(BT_I8, NAME, BT_CONST_VPTR, BT_INT)
     193#define BT_FN_LONG_DOUBLE(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_DOUBLE)
     194#define BT_FN_LONGLONG_DOUBLE(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_DOUBLE)
     195#define BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_PTR, BT_I4, BT_BOOL, BT_INT, BT_INT)
     196#define BT_FN_VOID_CONST_PTR_VAR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_CONST_PTR, BT_VAR)
     197#define BT_FN_DOUBLE_DOUBLE_LONG(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_LONG)
     198#define BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE, BT_INTPTR)
     199#define BT_FN_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE)
     200#define BT_FN_INT_PTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_PTR)
    112201#define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INTPTR)
    113 #define BT_FN_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_SIZE)
    114 #define BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
     202#define BT_FN_BOOL_VPTR_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_INT)
     203#define BT_FN_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_VALIST_ARG)
     204#define BT_FN_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_COMPLEX_DOUBLE)
     205#define BT_FN_DOUBLE_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE)
     206#define BT_FN_I2_VPTR_I2_INT(NAME) FUNC_SIMPLE(BT_I2, NAME, BT_VPTR, BT_I2, BT_INT)
     207#define BT_FN_INT_INT_FILEPTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_FILEPTR)
     208#define BT_FN_DFLOAT64_DFLOAT64(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME, BT_DFLOAT64)
     209#define BT_FN_I8_VPTR_I8(NAME) FUNC_SIMPLE(BT_I8, NAME, BT_VPTR, BT_I8)
     210#define BT_FN_DOUBLE_INT_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_INT, BT_DOUBLE)
     211#define BT_FN_I16_VPTR_I16_I16(NAME) FUNC_SIMPLE(BT_I16, NAME, BT_VPTR, BT_I16, BT_I16)
     212#define BT_FN_VOID_VPTR_I16_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_I16, BT_INT)
     213#define BT_FN_VOID_VPTR_I1_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_I1, BT_INT)
     214#define BT_FN_DFLOAT64(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME)
     215#define BT_FN_FLOAT_INT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_INT, BT_FLOAT)
     216#define BT_FN_I2_VPTR_I2_I2(NAME) FUNC_SIMPLE(BT_I2, NAME, BT_VPTR, BT_I2, BT_I2)
     217#define BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_COMPLEX_FLOAT)
     218#define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLE)
     219#define BT_FN_VOID_VALIST_REF_VAR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VALIST_REF, BT_VAR)
     220#define BT_FN_UINT32_UINT32(NAME) FUNC_SIMPLE(BT_UINT32, NAME, BT_UINT32)
     221#define BT_FN_FLOAT_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT)
     222#define BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
     223#define BT_FN_INT_CONST_PTR_CONST_PTR_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
     224#define BT_FN_PTR(NAME) FUNC_SIMPLE(BT_PTR, NAME)
     225#define BT_FN_FLOAT_FLOAT_INT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_INT)
     226#define BT_FN_INT_UINT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_UINT)
     227#define BT_FN_SIZE_CONST_STRING(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_STRING)
     228#define BT_FN_PTR_PTR_INT_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_INT, BT_SIZE)
     229#define BT_FN_I2_VPTR_I2(NAME) FUNC_SIMPLE(BT_I2, NAME, BT_VPTR, BT_I2)
     230#define BT_FN_UINT16_UINT16(NAME) FUNC_SIMPLE(BT_UINT16, NAME, BT_UINT16)
     231#define BT_FN_INT_INTMAX(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INTMAX)
     232#define BT_FN_VOID_PTR_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_PTR)
    115233#define BT_FN_STRING_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_STRING, BT_CONST_STRING)
    116 #define BT_FN_VOID_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_INT)
    117 #define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLE)
    118 #define BT_FN_INT_ULONGLONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_ULONGLONG)
    119 #define BT_FN_INT_FILEPTR_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_CONST_STRING, BT_VAR)
    120 #define BT_FN_LONGLONG_DOUBLE(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_DOUBLE)
    121 #define BT_FN_INT_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_CONST_STRING, BT_VAR)
    122 #define BT_FN_VOID_PTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR, BT_INT)
    123 #define BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_COMPLEX_FLOAT)
    124 #define BT_FN_INT_WINT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_WINT)
    125 #define BT_FN_PTR_PTR_INT_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_INT, BT_SIZE)
    126 #define BT_FN_STRING_CONST_STRING_INT(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_INT)
     234#define BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
     235#define BT_FN_I2_CONST_VPTR_INT(NAME) FUNC_SIMPLE(BT_I2, NAME, BT_CONST_VPTR, BT_INT)
     236#define BT_FN_I1_VPTR_I1(NAME) FUNC_SIMPLE(BT_I1, NAME, BT_VPTR, BT_I1)
     237#define BT_FN_LONGLONG_LONGLONG(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_LONGLONG)
     238#define BT_FN_PID(NAME) FUNC_SIMPLE(BT_PID, NAME)
     239#define BT_FN_I4_VPTR_I4(NAME) FUNC_SIMPLE(BT_I4, NAME, BT_VPTR, BT_I4)
     240#define BT_FN_I8_VPTR_I8_I8(NAME) FUNC_SIMPLE(BT_I8, NAME, BT_VPTR, BT_I8, BT_I8)
     241#define BT_FN_VOID_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTR)
     242#define BT_FN_VOID_VPTR_I2_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VPTR, BT_I2, BT_INT)
     243#define BT_FN_VOID_SIZE_VPTR_PTR_INT(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_SIZE, BT_VPTR, BT_PTR, BT_INT)
     244#define BT_FN_VOID_VALIST_REF(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_VALIST_REF)
     245#define BT_FN_INT_PTRPTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_PTRPTR, BT_SIZE, BT_SIZE)
     246#define BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG)
     247#define BT_FN_INT_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING)
     248#define BT_FN_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_VAR)
     249#define BT_FN_DFLOAT64_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME, BT_CONST_STRING)
     250#define BT_FN_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME)
     251#define BT_FN_PTR_PTR_INT_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_INT, BT_SIZE, BT_SIZE)
     252#define BT_FN_INT_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING)
     253#define BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_LONGDOUBLE, NAME, BT_LONGDOUBLE)
     254#define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLEPTR)
     255#define BT_FN_BOOL_SIZE_VPTR_PTR_PTR_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_SIZE, BT_VPTR, BT_PTR, BT_PTR, BT_INT, BT_INT)
     256#define BT_FN_BOOL_UINT_UINT_UINTPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_UINT, BT_UINT, BT_UINT, BT_PTR)
     257#define BT_FN_BOOL_VPTR_I4_I4(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_I4, BT_I4)
     258#define BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
     259#define BT_FN_FLOAT_FLOAT_FLOAT_INTPTR(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT, BT_INTPTR)
     260#define BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_COMPLEX_DOUBLE)
     261#define BT_FN_I4_VPTR_I4_INT(NAME) FUNC_SIMPLE(BT_I4, NAME, BT_VPTR, BT_I4, BT_INT)
     262#define BT_FN_VOID_CONST_PTR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_CONST_PTR, BT_PTR, BT_SIZE)
     263#define BT_FN_DFLOAT128_DFLOAT128(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME, BT_DFLOAT128)
     264#define BT_FN_LONGDOUBLE_INT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_INT, BT_LONGDOUBLE)
     265#define BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
     266#define BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_CONST_STRING, BT_VALIST_ARG)
     267#define BT_FN_INT_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME)
     268#define BT_FN_INT_CONST_STRING_PTR_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_PTR_CONST_STRING)
     269#define BT_FN_INT_INT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT)
     270#define BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_FLOAT, BT_FLOATPTR, BT_FLOATPTR)
    127271#define BT_FN_INT_FLOAT(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FLOAT)
    128 #define BT_FN_DOUBLE_CONST_STRING(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_CONST_STRING)
    129 #define BT_FN_LONG_FLOAT(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_FLOAT)
    130 #define BT_FN_PTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_SIZE, BT_SIZE)
    131 #define BT_FN_STRING_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_STRING, BT_CONST_STRING, BT_SIZE)
    132 #define BT_FN_LONGLONG_LONGLONG(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_LONGLONG)
    133 #define BT_FN_PTR_PTR(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR)
    134 #define BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_CONST_PTR, BT_SIZE, BT_SIZE)
    135 #define BT_FN_FLOAT_FLOAT_LONG(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_LONG)
     272#define BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
     273#define BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VAR)
     274#define BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_SSIZE, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VAR)
     275#define BT_FN_BOOL_LONGLONG_LONGLONG_LONGLONGPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_LONGLONG, BT_LONGLONG, BT_LONGLONG, BT_PTR)
     276#define BT_FN_PTR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_SIZE)
     277#define BT_FN_PTR_UINT(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_UINT)
    136278#define BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_LONGDOUBLE, NAME, BT_COMPLEX_LONGDOUBLE)
    137 #define BT_FN_PTR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_SIZE)
    138 #define BT_FN_PTR_VAR(NAME) FUNC_SIMPLE(BT_PTR, NAME)
    139 #define BT_FN_SIZE_CONST_PTR_INT(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_PTR, BT_INT)
    140 #define BT_FN_INT_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING)
    141 #define BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
    142 #define BT_FN_INT_STRING_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG)
    143 #define BT_FN_DFLOAT32(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME)
    144 #define BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_INTPTR)
    145 #define BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_STRING, BT_CONST_STRING, BT_SIZE, BT_SIZE)
    146 #define BT_FN_PTR_UINT(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_UINT)
    147 #define BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG)
    148 #define BT_FN_DFLOAT128_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME, BT_CONST_STRING)
    149 #define BT_FN_DOUBLE_DOUBLE_DOUBLEPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLEPTR)
    150 #define BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_SSIZE, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VAR)
    151 #define BT_FN_DFLOAT32_DFLOAT32(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME, BT_DFLOAT32)
    152 #define BT_FN_INT_PTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_PTR)
    153 #define BT_FN_UINT32_UINT32(NAME) FUNC_SIMPLE(BT_UINT32, NAME, BT_UINT32)
    154 #define BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR_FN_VOID_VAR_PTR_SIZE)
    155 #define BT_FN_INT_DOUBLE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DOUBLE)
    156 #define BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VAR)
    157 #define BT_FN_INT_ULONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_ULONG)
    158 #define BT_FN_DOUBLE_DOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_INTPTR)
    159 #define BT_FN_UINT64_UINT64(NAME) FUNC_SIMPLE(BT_UINT64, NAME, BT_UINT64)
    160 #define BT_FN_STRING_CONST_STRING_CONST_STRING(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_CONST_STRING)
    161 #define BT_FN_INT_INT_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
    162 #define BT_FN_PTR_PTR_INT_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_INT, BT_SIZE, BT_SIZE)
    163 #define BT_FN_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_COMPLEX_DOUBLE)
    164 #define BT_FN_VOID_CONST_PTR_VAR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_CONST_PTR, BT_VAR)
    165 #define BT_FN_INT_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME)
    166 #define BT_FN_INT_PTRPTR_SIZE_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_PTRPTR, BT_SIZE, BT_SIZE)
    167 #define BT_FN_INT_CONST_STRING_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_VAR)
    168 #define BT_FN_INT_DFLOAT32(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_DFLOAT32)
    169 #define BT_FN_DFLOAT64_DFLOAT64(NAME) FUNC_SIMPLE(BT_DFLOAT64, NAME, BT_DFLOAT64)
    170 #define BT_FN_VOID_CONST_PTR_PTR_SIZE(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_CONST_PTR, BT_PTR, BT_SIZE)
    171 #define BT_FN_UNWINDWORD_PTR(NAME) FUNC_SIMPLE(BT_UNWINDWORD, NAME, BT_PTR)
    172 #define BT_FN_FLOAT_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_FLOAT, BT_FLOAT)
    173 #define BT_FN_COMPLEX_FLOAT_FLOAT(NAME) FUNC_SIMPLE(BT_COMPLEX_FLOAT, NAME, BT_FLOAT)
    174 #define BT_FN_UINT(NAME) FUNC_SIMPLE(BT_UINT, NAME)
    175 #define BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_DOUBLE, BT_DOUBLE, BT_INTPTR)
    176 #define BT_FN_UINT16_UINT16(NAME) FUNC_SIMPLE(BT_UINT16, NAME, BT_UINT16)
    177 #define BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
    178 #define BT_FN_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE)
    179 #define BT_FN_LONG_LONG(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_LONG)
    180 #define BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
    181 #define BT_FN_FLOAT_INT_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME, BT_INT, BT_FLOAT)
    182 #define BT_FN_PTR(NAME) FUNC_SIMPLE(BT_PTR, NAME)
    183 #define BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
    184 #define BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_DOUBLE, BT_DOUBLEPTR, BT_DOUBLEPTR)
    185 #define BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
    186 #define BT_FN_LONG_DOUBLE(NAME) FUNC_SIMPLE(BT_LONG, NAME, BT_DOUBLE)
    187 #define BT_FN_SIZE_CONST_STRING(NAME) FUNC_SIMPLE(BT_SIZE, NAME, BT_CONST_STRING)
    188 #define BT_FN_LONGLONG_FLOAT(NAME) FUNC_SIMPLE(BT_LONGLONG, NAME, BT_FLOAT)
    189 #define BT_FN_INT_CONST_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_CONST_STRING, BT_SIZE)
    190 #define BT_FN_PTR_PTR_CONST_PTR_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_PTR, BT_CONST_PTR, BT_SIZE)
    191 #define BT_FN_DFLOAT128(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME)
    192 #define BT_FN_PID(NAME) FUNC_SIMPLE(BT_PID, NAME)
    193 #define BT_FN_INT_CONST_STRING_FILEPTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_FILEPTR)
    194 #define BT_FN_INT_LONGLONG(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_LONGLONG)
    195 #define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
    196 #define BT_FN_INT_INT_FILEPTR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INT, BT_FILEPTR)
    197 #define BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_LONGDOUBLE, NAME, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
    198 #define BT_FN_VOID_PTRMODE_PTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_PTRMODE_PTR)
    199 #define BT_FN_INT_STRING_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_STRING, BT_CONST_STRING, BT_VAR)
    200 #define BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE(NAME) FUNC_SIMPLE(BT_COMPLEX_DOUBLE, NAME, BT_COMPLEX_DOUBLE)
    201 #define BT_FN_DFLOAT32_CONST_STRING(NAME) FUNC_SIMPLE(BT_DFLOAT32, NAME, BT_CONST_STRING)
    202 #define BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_CONST_STRING, BT_PTR_CONST_STRING, BT_PTR_CONST_STRING)
    203 #define BT_FN_STRING_CONST_STRING_SIZE(NAME) FUNC_SIMPLE(BT_STRING, NAME, BT_CONST_STRING, BT_SIZE)
    204 #define BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VAR)
    205 #define BT_FN_DFLOAT128_DFLOAT128(NAME) FUNC_SIMPLE(BT_DFLOAT128, NAME, BT_DFLOAT128)
    206 #define BT_FN_DOUBLE_INT_DOUBLE(NAME) FUNC_SIMPLE(BT_DOUBLE, NAME, BT_INT, BT_DOUBLE)
    207 #define BT_FN_FLOAT(NAME) FUNC_SIMPLE(BT_FLOAT, NAME)
    208 #define BT_FN_LONGDOUBLE_INT_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_INT, BT_LONGDOUBLE)
    209 #define BT_FN_PTR_CONST_PTR_INT_SIZE(NAME) FUNC_SIMPLE(BT_PTR, NAME, BT_CONST_PTR, BT_INT, BT_SIZE)
    210 #define BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR(NAME) FUNC_SIMPLE(BT_VOID, NAME, BT_LONGDOUBLE, BT_LONGDOUBLEPTR, BT_LONGDOUBLEPTR)
    211 #define BT_FN_INT_INTMAX(NAME) FUNC_SIMPLE(BT_INT, NAME, BT_INTMAX)
    212 #define BT_FN_LONGDOUBLE(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME)
    213 #define BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR(NAME) FUNC_SIMPLE(BT_LONGDOUBLE, NAME, BT_LONGDOUBLE, BT_LONGDOUBLEPTR)
     279#define BT_FN_BOOL_VPTR_PTR_I1_BOOL_INT_INT(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_VPTR, BT_PTR, BT_I1, BT_BOOL, BT_INT, BT_INT)
     280#define BT_FN_BOOL_ULONG_ULONG_ULONGPTR(NAME) FUNC_SIMPLE(BT_BOOL, NAME, BT_ULONG, BT_ULONG, BT_ULONG, BT_PTR)
    214281
    215282#include "builtins.def"
  • src/prelude/builtins.def

    rc0aa336 rb4d65c7  
    11/* This file contains the definitions and documentation for the
    22   builtins used in the GNU compiler.
    3    Copyright (C) 2000-2014 Free Software Foundation, Inc.
     3   Copyright (C) 2000-2016 Free Software Foundation, Inc.
    44
    55This file is part of GCC.
     
    6363
    6464   The builtins is registered only if COND is true.  */
     65
     66/* A macro for builtins where the
     67   BUILT_IN_*_CHKP = BUILT_IN_* + BEGIN_CHKP_BUILTINS + 1
     68   enums should be defined too.  */
     69#ifndef DEF_BUILTIN_CHKP
     70#define DEF_BUILTIN_CHKP(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P,      \
     71                         FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT, COND)  \
     72  DEF_BUILTIN(ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P, FALLBACK_P,     \
     73              NONANSI_P, ATTRS, IMPLICIT, COND)
     74#endif
    6575
    6676/* A GCC builtin (like __builtin_saveregs) is provided by the
     
    8898  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
    8999               true, true, false, ATTRS, true, true)
     100#undef DEF_LIB_BUILTIN_CHKP
     101#define DEF_LIB_BUILTIN_CHKP(ENUM, NAME, TYPE, ATTRS)   \
     102  DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE,     \
     103                    TYPE, true, true, false, ATTRS, true, true)
    90104
    91105/* Like DEF_LIB_BUILTIN, except that the function is not one that is
     
    97111  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
    98112               true, true, true, ATTRS, false, true)
     113#undef DEF_EXT_LIB_BUILTIN_CHKP
     114#define DEF_EXT_LIB_BUILTIN_CHKP(ENUM, NAME, TYPE, ATTRS)       \
     115  DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE,     \
     116                    TYPE, true, true, true, ATTRS, false, true)
    99117
    100118/* Like DEF_LIB_BUILTIN, except that the function is only a part of
     
    111129  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
    112130               true, true, !flag_isoc99, ATTRS, targetm.libc_has_function (function_c99_misc), true)
     131
     132/* Like DEF_LIB_BUILTIN, except that the function is only a part of
     133   the standard in C11 or above.  */
     134#undef DEF_C11_BUILTIN
     135#define DEF_C11_BUILTIN(ENUM, NAME, TYPE, ATTRS)        \
     136  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
     137               true, true, !flag_isoc11, ATTRS, targetm.libc_has_function (function_c11_misc), true)
    113138
    114139/* Like DEF_C99_BUILTIN, but for complex math functions.  */
     
    140165               false, ATTR_LAST, false, false)
    141166
    142 /* Builtin used by the implementation of GNU OpenMP.  None of these are
    143    actually implemented in the compiler; they're all in libgomp.  */
     167/* Builtin used by the implementation of OpenACC and OpenMP.  Few of these are
     168   actually implemented in the compiler; most are in libgomp.  */
     169/* These builtins also need to be enabled in offloading compilers invoked from
     170   mkoffload; for that purpose, we're checking the -foffload-abi flag here.  */
     171#undef DEF_GOACC_BUILTIN
     172#define DEF_GOACC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
     173  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
     174               false, true, true, ATTRS, false, \
     175               (flag_openacc \
     176                || flag_offload_abi != OFFLOAD_ABI_UNSET))
     177#undef DEF_GOACC_BUILTIN_COMPILER
     178#define DEF_GOACC_BUILTIN_COMPILER(ENUM, NAME, TYPE, ATTRS) \
     179  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
     180               flag_openacc, true, true, ATTRS, false, true)
    144181#undef DEF_GOMP_BUILTIN
    145182#define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
    146183  DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE,    \
    147184               false, true, true, ATTRS, false, \
    148                (flag_openmp || flag_tree_parallelize_loops))
     185               (flag_openacc \
     186                || flag_openmp \
     187                || flag_tree_parallelize_loops > 1 \
     188                || flag_cilkplus \
     189                || flag_offload_abi != OFFLOAD_ABI_UNSET))
    149190
    150191/* Builtin used by implementation of Cilk Plus.  Most of these are decomposed
     
    170211               true, true, true, ATTRS, true, \
    171212              (flag_sanitize & (SANITIZE_ADDRESS | SANITIZE_THREAD \
    172                                 | SANITIZE_UNDEFINED)))
     213                                | SANITIZE_UNDEFINED | SANITIZE_NONDEFAULT) \
     214               || flag_sanitize_coverage))
    173215
    174216#undef DEF_CILKPLUS_BUILTIN
     
    176218  DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, BT_FN_INT_VAR, BT_LAST, \
    177219               false, false, false, ATTRS, false, flag_cilkplus)
     220
     221/* Builtin used by the implementation of Pointer Bounds Checker.  */
     222#undef DEF_CHKP_BUILTIN
     223#define DEF_CHKP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
     224  DEF_BUILTIN_CHKP (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE,     \
     225                    TYPE, true, true, false, ATTRS, true, true)
    178226
    179227/* Define an attribute list for math functions that are normally
     
    224272DEF_C99_BUILTIN        (BUILT_IN_ACOSHL, "acoshl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
    225273DEF_C99_C90RES_BUILTIN (BUILT_IN_ACOSL, "acosl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
     274DEF_C11_BUILTIN        (BUILT_IN_ALIGNED_ALLOC, "aligned_alloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST)
    226275DEF_LIB_BUILTIN        (BUILT_IN_ASIN, "asin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
    227276DEF_C99_C90RES_BUILTIN (BUILT_IN_ASINF, "asinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
     
    428477DEF_C99_BUILTIN        (BUILT_IN_REMQUOF, "remquof", BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
    429478DEF_C99_BUILTIN        (BUILT_IN_REMQUOL, "remquol", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
    430 DEF_C99_BUILTIN        (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
    431 DEF_C99_BUILTIN        (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
    432 DEF_C99_BUILTIN        (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
     479DEF_C99_BUILTIN        (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
     480DEF_C99_BUILTIN        (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
     481DEF_C99_BUILTIN        (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
    433482DEF_C99_BUILTIN        (BUILT_IN_ROUND, "round", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
    434483DEF_C99_BUILTIN        (BUILT_IN_ROUNDF, "roundf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
     
    443492DEF_C99_BUILTIN        (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
    444493DEF_C99_BUILTIN        (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
    445 DEF_EXT_LIB_BUILTIN    (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
     494DEF_EXT_LIB_BUILTIN    (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
    446495DEF_EXT_LIB_BUILTIN    (BUILT_IN_SIGNBITF, "signbitf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
    447496DEF_EXT_LIB_BUILTIN    (BUILT_IN_SIGNBITL, "signbitl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
     
    569618DEF_LIB_BUILTIN        (BUILT_IN_MEMCHR, "memchr", BT_FN_PTR_CONST_PTR_INT_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    570619DEF_LIB_BUILTIN        (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    571 DEF_LIB_BUILTIN        (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    572 DEF_LIB_BUILTIN        (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    573 DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    574 DEF_LIB_BUILTIN        (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     620DEF_LIB_BUILTIN_CHKP   (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     621DEF_LIB_BUILTIN_CHKP   (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     622DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     623DEF_LIB_BUILTIN_CHKP   (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    575624DEF_EXT_LIB_BUILTIN    (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    576 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
     625DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
    577626DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    578627DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    579 DEF_LIB_BUILTIN        (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
    580 DEF_LIB_BUILTIN        (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
     628DEF_LIB_BUILTIN_CHKP   (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
     629DEF_LIB_BUILTIN_CHKP   (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    581630DEF_LIB_BUILTIN        (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    582 DEF_LIB_BUILTIN        (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     631DEF_LIB_BUILTIN_CHKP   (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    583632DEF_LIB_BUILTIN        (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    584633DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
    585634DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
    586 DEF_LIB_BUILTIN        (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
     635DEF_LIB_BUILTIN_CHKP   (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    587636DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
    588637DEF_LIB_BUILTIN        (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     
    658707DEF_C94_BUILTIN        (BUILT_IN_TOWUPPER, "towupper", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
    659708
     709/* Category: integer overflow checking builtins.  */
     710DEF_GCC_BUILTIN        (BUILT_IN_ADD_OVERFLOW, "add_overflow", BT_FN_BOOL_VAR, ATTR_NOTHROW_TYPEGENERIC_LEAF)
     711DEF_GCC_BUILTIN        (BUILT_IN_SUB_OVERFLOW, "sub_overflow", BT_FN_BOOL_VAR, ATTR_NOTHROW_TYPEGENERIC_LEAF)
     712DEF_GCC_BUILTIN        (BUILT_IN_MUL_OVERFLOW, "mul_overflow", BT_FN_BOOL_VAR, ATTR_NOTHROW_TYPEGENERIC_LEAF)
     713/* Clang compatibility.  */
     714DEF_GCC_BUILTIN        (BUILT_IN_SADD_OVERFLOW, "sadd_overflow", BT_FN_BOOL_INT_INT_INTPTR, ATTR_NOTHROW_LEAF_LIST)
     715DEF_GCC_BUILTIN        (BUILT_IN_SADDL_OVERFLOW, "saddl_overflow", BT_FN_BOOL_LONG_LONG_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
     716DEF_GCC_BUILTIN        (BUILT_IN_SADDLL_OVERFLOW, "saddll_overflow", BT_FN_BOOL_LONGLONG_LONGLONG_LONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     717DEF_GCC_BUILTIN        (BUILT_IN_SSUB_OVERFLOW, "ssub_overflow", BT_FN_BOOL_INT_INT_INTPTR, ATTR_NOTHROW_LEAF_LIST)
     718DEF_GCC_BUILTIN        (BUILT_IN_SSUBL_OVERFLOW, "ssubl_overflow", BT_FN_BOOL_LONG_LONG_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
     719DEF_GCC_BUILTIN        (BUILT_IN_SSUBLL_OVERFLOW, "ssubll_overflow", BT_FN_BOOL_LONGLONG_LONGLONG_LONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     720DEF_GCC_BUILTIN        (BUILT_IN_SMUL_OVERFLOW, "smul_overflow", BT_FN_BOOL_INT_INT_INTPTR, ATTR_NOTHROW_LEAF_LIST)
     721DEF_GCC_BUILTIN        (BUILT_IN_SMULL_OVERFLOW, "smull_overflow", BT_FN_BOOL_LONG_LONG_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
     722DEF_GCC_BUILTIN        (BUILT_IN_SMULLL_OVERFLOW, "smulll_overflow", BT_FN_BOOL_LONGLONG_LONGLONG_LONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     723DEF_GCC_BUILTIN        (BUILT_IN_UADD_OVERFLOW, "uadd_overflow", BT_FN_BOOL_UINT_UINT_UINTPTR, ATTR_NOTHROW_LEAF_LIST)
     724DEF_GCC_BUILTIN        (BUILT_IN_UADDL_OVERFLOW, "uaddl_overflow", BT_FN_BOOL_ULONG_ULONG_ULONGPTR, ATTR_NOTHROW_LEAF_LIST)
     725DEF_GCC_BUILTIN        (BUILT_IN_UADDLL_OVERFLOW, "uaddll_overflow", BT_FN_BOOL_ULONGLONG_ULONGLONG_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     726DEF_GCC_BUILTIN        (BUILT_IN_USUB_OVERFLOW, "usub_overflow", BT_FN_BOOL_UINT_UINT_UINTPTR, ATTR_NOTHROW_LEAF_LIST)
     727DEF_GCC_BUILTIN        (BUILT_IN_USUBL_OVERFLOW, "usubl_overflow", BT_FN_BOOL_ULONG_ULONG_ULONGPTR, ATTR_NOTHROW_LEAF_LIST)
     728DEF_GCC_BUILTIN        (BUILT_IN_USUBLL_OVERFLOW, "usubll_overflow", BT_FN_BOOL_ULONGLONG_ULONGLONG_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     729DEF_GCC_BUILTIN        (BUILT_IN_UMUL_OVERFLOW, "umul_overflow", BT_FN_BOOL_UINT_UINT_UINTPTR, ATTR_NOTHROW_LEAF_LIST)
     730DEF_GCC_BUILTIN        (BUILT_IN_UMULL_OVERFLOW, "umull_overflow", BT_FN_BOOL_ULONG_ULONG_ULONGPTR, ATTR_NOTHROW_LEAF_LIST)
     731DEF_GCC_BUILTIN        (BUILT_IN_UMULLL_OVERFLOW, "umulll_overflow", BT_FN_BOOL_ULONGLONG_ULONGLONG_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
     732
    660733/* Category: miscellaneous builtins.  */
    661 DEF_LIB_BUILTIN        (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LEAF_LIST)
     734DEF_LIB_BUILTIN        (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_TMPURE_NORETURN_NOTHROW_LEAF_LIST)
    662735DEF_LIB_BUILTIN        (BUILT_IN_ABS, "abs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
    663736DEF_GCC_BUILTIN        (BUILT_IN_AGGREGATE_INCOMING_ADDRESS, "aggregate_incoming_address", BT_FN_PTR_VAR, ATTR_LEAF_LIST)
     
    794867/* Object size checking builtins.  */
    795868DEF_GCC_BUILTIN        (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
    796 DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    797 DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
    798 DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    799 DEF_EXT_LIB_BUILTIN    (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    800 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     869DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     870DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
     871DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     872DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     873DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    801874DEF_EXT_LIB_BUILTIN    (BUILT_IN_STPNCPY_CHK, "__stpncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    802 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    803 DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     875DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     876DEF_EXT_LIB_BUILTIN_CHKP (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    804877DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
    805878DEF_EXT_LIB_BUILTIN    (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
     
    854927DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
    855928
    856 #if 0
    857929/* Synchronization Primitives.  */
    858930#include "sync-builtins.def"
    859931
    860 /* OpenMP builtins.  */
     932#if 0
     933/* Offloading and Multi Processing builtins.  */
    861934#include "omp-builtins.def"
    862935
     
    872945/* Cilk Plus builtins.  */
    873946#include "cilkplus.def"
     947
     948/* Pointer Bounds Checker builtins.  */
     949#include "chkp-builtins.def"
    874950#endif
     951
     952#undef DEF_BUILTIN_CHKP
     953#undef DEF_BUILTIN
  • src/prelude/prototypes.awk

    rc0aa336 rb4d65c7  
    1717
    1818BEGIN {
    19     FS = "("
     19  FS = "[( )]"
    2020    # order so string search is longest string
    21     types[0]  = "UINTMAX";                                      vtypes[0]  = "unsigned long int"
    22     types[1]  = "UINT16";                                       vtypes[1]  = "short int"
    23     types[2]  = "UINT32";                                       vtypes[2]  = "int"
    24     types[3]  = "UINT64";                                       vtypes[3]  = "long long int"
    25     types[4]  = "UINT";                                         vtypes[4]  = "unsigned int"
    26     types[5]  = "INTMAX";                                       vtypes[5]  = "long int"
    27     types[6]  = "INTPTR";                                       vtypes[6]  = "int *"
    28     types[7]  = "WINT";                                         vtypes[7]  = "unsigned int"
    29     types[8]  = "INT";                                          vtypes[8]  = "int"
    30     types[9]  = "ULONGLONG";                            vtypes[9]  = "unsigned long long"
    31     types[10] = "ULONG";                                        vtypes[10] = "unsigned long"
    32     types[11] = "UNSIGNED";                                     vtypes[11] = "unsigned"
    33     types[12] = "COMPLEX_LONGDOUBLE";           vtypes[12] = "_Complex long double"
    34     types[13] = "COMPLEX_DOUBLE";                       vtypes[13] = "_Complex double"
    35     types[14] = "COMPLEX_FLOAT";                        vtypes[14] = "_Complex float"
    36     types[15] = "LONGDOUBLEPTR";                        vtypes[15] = "long double *"
    37     types[16] = "LONGDOUBLE";                           vtypes[16] = "long double"
    38     types[17] = "LONGLONG";                                     vtypes[17] = "long long"
    39     types[18] = "LONG";                                         vtypes[18] = "long"
    40     types[19] = "DFLOAT32";                                     vtypes[19] = "_Decimal32"
    41     types[20] = "DFLOAT64";                                     vtypes[20] = "_Decimal64"
    42     types[21] = "DFLOAT128";                            vtypes[21] = "_Decimal128"
    43     types[22] = "DOUBLEPTR";                            vtypes[22] = "double *"
    44     types[23] = "DOUBLE";                                       vtypes[23] = "double"
    45     types[24] = "FLOATPTR";                                     vtypes[24] = "float *"
    46     types[25] = "FLOAT";                                        vtypes[25] = "float"
    47     types[26] = "CONST_PTR";                            vtypes[26] = "const void *"
    48     types[27] = "CONST_STRING";                         vtypes[27] = "const char *"
    49     types[28] = "PTR_FN_VOID_VAR_PTR_SIZE";     vtypes[28] = ""
    50     types[29] = "PTR_CONST_STRING";                     vtypes[29] = "char *const"
    51     types[30] = "PTRMODE_PTR";                          vtypes[30] = ""
    52     types[31] = "PTRPTR";                                       vtypes[31] = "void **"
    53     types[32] = "PTR";                                          vtypes[32] = "void *"
    54     types[33] = "VOID";                                         vtypes[33] = "void"
    55     types[34] = "STRING";                                       vtypes[34] = "char *"
    56     types[35] = "FILEPTR";                                      vtypes[35] = "struct _IO_FILE *"
    57     types[36] = "SIZE";                                         vtypes[36] = "unsigned long"
    58     types[37] = "VAR";                                          vtypes[37] = "..."
    59     types[38] = "VALIST_ARG";                           vtypes[38] = "__builtin_va_list"
    60     types[39] = "VALIST_REF";                           vtypes[39] = "__builtin_va_list"
    61     types[40] = "UNWINDWORD";                           vtypes[40] = "void *"
    62     types[41] = "WORD";                                         vtypes[41] = ""
    63     types[42] = "SSIZE";                                        vtypes[42] = "long int"
    64     types[43] = "PID";                                          vtypes[43] = "int"
    65     N = 44
     21    i=-1
     22    types[i+=1] = "BOOL";                                                         vtypes[i] = "_Bool"
     23    types[i+=1] = "UINTMAX";                                            vtypes[i] = "unsigned long int"
     24    types[i+=1] = "UINT16";                                               vtypes[i] = "short int"
     25    types[i+=1] = "UINT32";                                               vtypes[i] = "int"
     26    types[i+=1] = "UINT64";                                               vtypes[i] = "long long int"
     27    types[i+=1] = "UINT";                                                         vtypes[i] = "unsigned int"
     28    types[i+=1] = "INTMAX";                                               vtypes[i] = "long int"
     29    types[i+=1] = "INTPTR";                                               vtypes[i] = "int *"
     30    types[i+=1] = "WINT";                                                         vtypes[i] = "unsigned int"
     31    types[i+=1] = "INT";                                                          vtypes[i] = "int"
     32    types[i+=1] = "ULONGLONG";                                  vtypes[i] = "unsigned long long"
     33    types[i+=1] = "ULONG";                                                vtypes[i] = "unsigned long"
     34    types[i+=1] = "UNSIGNED";                                           vtypes[i] = "unsigned"
     35    types[i+=1] = "COMPLEX_LONGDOUBLE";             vtypes[i] = "_Complex long double"
     36    types[i+=1] = "COMPLEX_DOUBLE";                           vtypes[i] = "_Complex double"
     37    types[i+=1] = "COMPLEX_FLOAT";                            vtypes[i] = "_Complex float"
     38    types[i+=1] = "LONGDOUBLEPTR";                            vtypes[i] = "long double *"
     39    types[i+=1] = "LONGDOUBLE";                                 vtypes[i] = "long double"
     40    types[i+=1] = "LONGLONG";                                           vtypes[i] = "long long"
     41    types[i+=1] = "LONG";                                                         vtypes[i] = "long"
     42    types[i+=1] = "DFLOAT32";                                           vtypes[i] = "__Unsupported"
     43    types[i+=1] = "DFLOAT64";                                           vtypes[i] = "__Unsupported"
     44    types[i+=1] = "DFLOAT128";                                  vtypes[i] = "__Unsupported"
     45    types[i+=1] = "DOUBLEPTR";                              vtypes[i] = "double *"
     46    types[i+=1] = "DOUBLE";                                               vtypes[i] = "double"
     47    types[i+=1] = "FLOATPTR";                                           vtypes[i] = "float *"
     48    types[i+=1] = "FLOAT128X";                                              vtypes[i] = "__Unsupported"
     49    types[i+=1] = "FLOAT128";                                                 vtypes[i] = "__Unsupported"
     50    types[i+=1] = "FLOAT64X";                                                 vtypes[i] = "__Unsupported"
     51    types[i+=1] = "FLOAT64";                                                  vtypes[i] = "__Unsupported"
     52    types[i+=1] = "FLOAT32X";                                                 vtypes[i] = "__Unsupported"
     53    types[i+=1] = "FLOAT32";                                                  vtypes[i] = "__Unsupported"
     54    types[i+=1] = "FLOAT16";                                                  vtypes[i] = "__Unsupported"
     55    types[i+=1] = "FLOAT";                                                vtypes[i] = "float"
     56    types[i+=1] = "CONST_VPTR";                                       vtypes[i] = "const volatile void *"
     57    types[i+=1] = "CONST_PTR";                                  vtypes[i] = "const void *"
     58    types[i+=1] = "CONST_STRING";                                     vtypes[i] = "const char *"
     59    types[i+=1] = "CONST_TM_PTR";                               vtypes[i] = "const struct tm *"
     60    types[i+=1] = "PTR_FN_VOID_VAR_PTR_SIZE";   vtypes[i] = ""
     61    types[i+=1] = "PTR_CONST_STRING";                       vtypes[i] = "char *const"
     62    types[i+=1] = "PTRMODE_PTR";                                      vtypes[i] = ""
     63    types[i+=1] = "PTRPTR";                                               vtypes[i] = "void **"
     64    types[i+=1] = "VPTR";                                                   vtypes[i] = "volatile void *"
     65    types[i+=1] = "PTR";                                                          vtypes[i] = "void *"
     66    types[i+=1] = "VOID";                                                         vtypes[i] = "void"
     67    types[i+=1] = "STRING";                                               vtypes[i] = "char *"
     68    types[i+=1] = "FILEPTR";                                            vtypes[i] = "struct _IO_FILE *"
     69    types[i+=1] = "SIZE";                                                         vtypes[i] = "unsigned long"
     70    types[i+=1] = "VAR";                                                          vtypes[i] = "..."
     71    types[i+=1] = "VALIST_ARG";                                 vtypes[i] = "__builtin_va_list"
     72    types[i+=1] = "VALIST_REF";                                 vtypes[i] = "__builtin_va_list"
     73    types[i+=1] = "UNWINDWORD";                                 vtypes[i] = "void *"
     74    types[i+=1] = "WORD";                                                         vtypes[i] = ""
     75    types[i+=1] = "SSIZE";                                                vtypes[i] = "long int"
     76    types[i+=1] = "PID";                                                          vtypes[i] = "int"
     77    types[i+=1] = "I16";                                                          vtypes[i] = "__int128"
     78    types[i+=1] = "I8";                                                     vtypes[i] = "long long int"
     79    types[i+=1] = "I4";                                                     vtypes[i] = "int"
     80    types[i+=1] = "I2";                                                     vtypes[i] = "short"
     81    types[i+=1] = "I1";                                                     vtypes[i] = "char"
     82    N = i + 1
    6683} # BEGIN
    6784
    68 /^BT_/ { prototypes[$1] = $1 }
     85/BT_FN/ {
     86    for (i = 1; i <= NF; i++) {
     87      if( match($i, "BT_FN") != 0 ) {
     88        prototypes[$i] = $i
     89      }
     90    }
     91  }
    6992
    7093END {
     
    80103
    81104    for ( prototype in prototypes ) {
    82                 if ( index( "BT_LAST", prototype ) == 1 ) {
    83                         continue
    84                 } # if
     105      # printf( "//\"%s\"\n", prototype )
     106      if ( index( "BT_LAST", prototype ) == 1 ) {
     107        continue
     108      } # if
    85109
    86                 printf( "#define %s(NAME) FUNC_SIMPLE(", prototype )
     110      printf( "#define %s(NAME) FUNC_SIMPLE(", prototype )
    87111
    88                 if ( sub( "BT_FN_", "", prototype ) == 0 ) {
    89                         printf( "\n********** BAD MACRO NAME \"%s\" **********\n", prototype )
    90                         exit 0
    91                 } # if
     112      if ( sub( "BT_FN_", "", prototype ) == 0 ) {
     113        printf( "\n********** BAD MACRO NAME \"%s\" **********\n", prototype )
     114        exit 0
     115      } # if
    92116
    93                 # generate function return type as macro
    94                 for ( t = 0; t < N; t += 1 ) {                                  # find longest match
    95                         type = types[t];
    96                         if ( index( prototype, type ) == 1 ) {          # found match
    97                                 printf( "BT_%s, NAME", type )
    98                                 sub( type, "", prototype )
    99                                 break;
    100                         } # if
    101                 } # for
     117      # generate function return type as macro
     118      for ( t = 0; t < N; t += 1 ) {                                    # find longest match
     119        type = types[t];
     120        if ( index( prototype, type ) == 1 ) {          # found match
     121          printf( "BT_%s, NAME", type )
     122          sub( type, "", prototype )
     123          break;
     124        } # if
     125      } # for
    102126
    103                 # generate function parameter types as macro
    104                 if ( index( prototype, "VAR" ) != 2 ) {                 # C-style empty parameters ?
    105                         for ( p = 0; length( prototype ) > 0; p += 1 ) { # until all parameters types are removed
    106                                 sub( "_", "", prototype)                                # remove "_"
    107                                 printf( ", ", type )
    108                                 temp = prototype
    109                                 for ( t = 0; t < N; t += 1 ) {                  # find longest match
    110                                         type = types[t];
    111                                         if ( index( prototype, type ) == 1 ) { # found match
    112                                                 printf( "BT_%s", type )
    113                                                 sub( type, "", prototype )
    114                                                 break;
    115                                         } # if
    116                                 } # for
    117                                 if ( temp == prototype ) {                              # no match found for parameter in macro table
    118                                         printf( "\n********** MISSING TYPE \"%s\" **********\n", prototype )
    119                                         exit 0
    120                                 } # if
    121                         } # for
    122                 } # if
    123                 printf( ")\n" )
     127      # generate function parameter types as macro
     128      if ( index( prototype, "VAR" ) != 2 ) {                   # C-style empty parameters ?
     129        for ( p = 0; length( prototype ) > 0; p += 1 ) { # until all parameters types are removed
     130          sub( "_", "", prototype)                              # remove "_"
     131          printf( ", ", type )
     132          temp = prototype
     133          for ( t = 0; t < N; t += 1 ) {                        # find longest match
     134            type = types[t];
     135            if ( index( prototype, type ) == 1 ) { # found match
     136              printf( "BT_%s", type )
     137              sub( type, "", prototype )
     138              break;
     139            } # if
     140          } # for
     141          if ( temp == prototype ) {                            # no match found for parameter in macro table
     142            printf( "\n********** MISSING TYPE \"%s\" **********\n", prototype )
     143            exit 0
     144          } # if
     145        } # for
     146      } # if
     147      printf( ")\n" )
    124148    } # for
    125149
  • src/tests/Makefile.am

    rc0aa336 rb4d65c7  
    3030
    3131all-local :
    32         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine
     32        @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
    3333
    3434all-tests :
  • src/tests/Makefile.in

    rc0aa336 rb4d65c7  
    651651
    652652all-local :
    653         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine
     653        @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
    654654
    655655all-tests :
  • src/tests/dtor-early-exit.c

    rc0aa336 rb4d65c7  
    2828// don't want these called
    2929void ?{}(A * a) { assert( false ); }
    30 void ?{}(A * a, char * name) { a->name = name; sout | "construct " | name | endl; a->x = malloc(); }
     30void ?{}(A * a, char * name) { a->name = name; sout | "construct " | name | endl; a->x = (int*)malloc(); }
    3131void ?{}(A * a, char * name, int * ptr) { assert( false ); }
    3232
    3333A ?=?(A * a, A a) {  sout | "assign " | a->name | " " | a.name; return a; }
    34 void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = malloc(); }
     34void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = (int*)malloc(); }
    3535void ^?{}(A * a) { sout | "destruct " | a->name | endl; free(a->x); }
    3636
  • src/tests/test.py

    rc0aa336 rb4d65c7  
    168168
    169169def run_test_instance(t, generate, dry_run, debug) :
    170         # print formated name
    171         name_txt = "%20s  " % t.name
    172 
    173         #run the test instance and collect the result
    174         test_failed, error = run_single_test(t, generate, dry_run, debug)
    175 
    176         # update output based on current action
    177         if generate :
    178                 failed_txt = "ERROR"
    179                 success_txt = "Done"
    180         else :
    181                 failed_txt = "FAILED"
    182                 success_txt = "PASSED"
    183 
    184         #print result with error if needed
    185         text = name_txt + (failed_txt if test_failed else success_txt)
    186         out = sys.stdout
    187         if error :
    188                 text = text + "\n" + error
    189                 out = sys.stderr
    190 
    191         print(text, file = out);
    192         sys.stdout.flush()
    193         sys.stderr.flush()
    194 
    195         return test_failed
     170        try :
     171                # print formated name
     172                name_txt = "%20s  " % t.name
     173
     174                #run the test instance and collect the result
     175                test_failed, error = run_single_test(t, generate, dry_run, debug)
     176
     177                # update output based on current action
     178                if generate :
     179                        failed_txt = "ERROR"
     180                        success_txt = "Done"
     181                else :
     182                        failed_txt = "FAILED"
     183                        success_txt = "PASSED"
     184
     185                #print result with error if needed
     186                text = name_txt + (failed_txt if test_failed else success_txt)
     187                out = sys.stdout
     188                if error :
     189                        text = text + "\n" + error
     190                        out = sys.stderr
     191
     192                print(text, file = out);
     193                sys.stdout.flush()
     194                sys.stderr.flush()
     195                return test_failed
     196       
     197        except KeyboardInterrupt:
     198                test_failed = True
     199
    196200
    197201# run the given list of tests with the given parameters
     
    209213        pool = Pool(jobs)
    210214        try :
    211                 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run, debug=debug), tests ).get(99999999)
     215                results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run, debug=debug), tests ).get(9999)
    212216        except KeyboardInterrupt:
    213217                pool.terminate()
  • src/tests/tupleVariadic.c

    rc0aa336 rb4d65c7  
    2929}
    3030
    31 forall(otype T, ttype Params | { void ?{}(T *, Params); })
     31forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } )
    3232T * new(Params p);
    3333
Note: See TracChangeset for help on using the changeset viewer.