Changeset 97d58dc


Ignore:
Timestamp:
Nov 18, 2021, 5:42:51 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
fefd77a
Parents:
4d0eb1c
Message:

String perf make-run refactor into fewer rules

Location:
tests/zombies/string-perf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/zombies/string-perf/Makefile

    r4d0eb1c r97d58dc  
    2424all : $(PERFPROGS)
    2525
    26 perfexp-cfa-hl-pta-share : prog.cfa $(LIBCFA)
    27         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_HL_SHARE -DOP_PLUS_THEN_ASSIGN
     26# upper-case conversion function
     27define uc
     28$(shell echo $(1) | tr  '[:lower:]' '[:upper:]')
     29endef
    2830
    29 perfexp-cfa-hl-peq-share : prog.cfa $(LIBCFA)
    30         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_HL_SHARE -DOP_PLUSEQ
     31perfexp-cfa-%: APILEVEL=$(call uc,$(word 3,$(subst -, ,$@)))
     32perfexp-cfa-%: OPERATION=$(call uc,$(word 4,$(subst -, ,$@)))
     33perfexp-cfa-%: SHARING=$(call uc,$(word 5,$(subst -, ,$@)))
     34perfexp-cfa-%: prog.cfa $(LIBCFA)
     35        $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_$(APILEVEL)_$(SHARING) -DOP_$(OPERATION)
    3136
    32 perfexp-cfa-ll-pta-share : prog.cfa $(LIBCFA)
    33         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_LL_SHARE -DOP_PLUS_THEN_ASSIGN
     37perfexp-stl-%: OPERATION=$(call uc,$(word 3,$(subst -, ,$@)))
     38perfexp-stl-%: prog.cfa
     39        $(CXX) -xc++ $(PERFFLAGS_CXX) $< -o $@ -DIMPL_STL -DOP_$(OPERATION)
    3440
    35 perfexp-cfa-ll-peq-share : prog.cfa $(LIBCFA)
    36         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_LL_SHARE -DOP_PLUSEQ
    37 
    38 perfexp-cfa-hl-pta-noshare : prog.cfa $(LIBCFA)
    39         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_HL_NOSHARE -DOP_PLUS_THEN_ASSIGN
    40 
    41 perfexp-cfa-hl-peq-noshare : prog.cfa $(LIBCFA)
    42         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_HL_NOSHARE -DOP_PLUSEQ
    43 
    44 perfexp-cfa-ll-pta-noshare : prog.cfa $(LIBCFA)
    45         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_LL_NOSHARE -DOP_PLUS_THEN_ASSIGN
    46 
    47 perfexp-cfa-ll-peq-noshare : prog.cfa $(LIBCFA)
    48         $(CFA) $(PERFFLAGS_CFA) $< -o $@ -DIMPL_CFA_LL_NOSHARE -DOP_PLUSEQ
    49 
    50 perfexp-stl-pta : prog.cfa
    51         $(CXX) -xc++ $(PERFFLAGS_CXX) $< -o $@ -DIMPL_STL -DOP_PLUS_THEN_ASSIGN
    52 
    53 perfexp-stl-peq : prog.cfa
    54         $(CXX) -xc++ $(PERFFLAGS_CXX) $< -o $@ -DIMPL_STL -DOP_PLUSEQ
    55 
    56 perfexp-buhr94-pta.o : prog.cfa
    57         $(CXX) -xc++ -c $(PERFFLAGS_CXX) $< -o $@ -DIMPL_BUHR94 -DOP_PLUS_THEN_ASSIGN
    58 
    59 perfexp-buhr94-peq.o : prog.cfa
    60         $(CXX) -xc++ -c $(PERFFLAGS_CXX) $< -o $@ -DIMPL_BUHR94 -DOP_PLUSEQ
     41perfexp-buhr94-%.o: OPERATION=$(call uc,$(word 3,$(subst -, ,$(basename $@))))
     42perfexp-buhr94-%.o: prog.cfa
     43        $(CXX) -xc++ -c $(PERFFLAGS_CXX) $< -o $@ -DIMPL_BUHR94 -DOP_$(OPERATION)
    6144
    6245buhr94-string.o:
     
    6649        $(CXX) -xc++ -c $(PERFFLAGS_CXX) ~/usys1/sm/string/StringSharing/src/VbyteSM.cc -o $@
    6750
    68 perfexp-buhr94-pta : perfexp-buhr94-pta.o buhr94-string.o buhr94-VbyteSM.o
    69         $(CXX) $(PERFFLAGS_CXX) $^ -o $@
    70 
    71 perfexp-buhr94-peq : perfexp-buhr94-peq.o buhr94-string.o buhr94-VbyteSM.o
     51perfexp-buhr94-% : perfexp-buhr94-%.o buhr94-string.o buhr94-VbyteSM.o
    7252        $(CXX) $(PERFFLAGS_CXX) $^ -o $@
    7353
  • tests/zombies/string-perf/prog.cfa

    r4d0eb1c r97d58dc  
    111111        string_res x = "starter";
    112112        string_res y;
    113       #if defined OP_PLUS_THEN_ASSIGN
     113      #if defined OP_PTA
    114114        string_res z;
    115115      #endif
     
    129129              MAYBE( PRINT(y) )
    130130              char *toAppend = corpus[i % corpuslen]; // ? corpus[rand() % corpuslen]
    131               #if defined OP_PLUS_THEN_ASSIGN && defined IMPL_CFA_LL
     131              #if defined OP_PTA && defined IMPL_CFA_LL
    132132                 z = y;
    133133                 z += toAppend;
    134134                 y = z;
    135               #elif defined OP_PLUS_THEN_ASSIGN
     135              #elif defined OP_PTA
    136136                 y = y + toAppend;
    137               #elif defined OP_PLUSEQ
     137              #elif defined OP_PEQ
    138138                 y += toAppend;
    139139              #endif
Note: See TracChangeset for help on using the changeset viewer.