~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/bench.py

  • Committer: Matthew Gretton-Dann
  • Author(s): Marcus Shawcroft
  • Date: 2013-01-16 20:55:59 UTC
  • mto: This revision was merged to the branch mainline in revision 99.
  • Revision ID: matthew.gretton-dann@linaro.org-20130116205559-7nye0l7d8fvzdye3
This patch fixes an issue in the AArch64 strnlen implementation which
occurs if  ULONG_MAX-15 <= n <= ULONG_MAX.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
HAS = {
23
23
    'this': 'bounce memchr memcpy memset strchr strcpy strlen',
24
 
    'bionic-a9': 'memcmp memcpy memset strcmp strcpy strlen',
25
 
    'bionic-a15': 'memcmp memcpy memset strcmp strcpy strlen',
 
24
    'bionic': 'memcmp memcpy memset strcmp strcpy strlen',
26
25
    'bionic-c': ALL,
27
26
    'csl': 'memcpy memset',
28
27
    'glibc': 'memcpy memset strlen',
59
58
 
60
59
    return took
61
60
 
62
 
def run_many(cache, variants, bytes, alignments, all_functions):
 
61
def run_many(cache, variants, bytes, alignments):
63
62
    # We want the data to come out in a useful order.  So fix an
64
63
    # alignment and function, and do all sizes for a variant first
65
64
    bytes = sorted(bytes)
66
65
    mid = bytes[len(bytes)/2]
67
66
 
68
 
    if not all_functions:
69
 
        # Use the ordering in 'this' as the default
70
 
        all_functions = HAS['this'].split()
 
67
    # Use the ordering in 'this' as the default
 
68
    all_functions = HAS['this'].split()
71
69
 
72
 
        # Find all other functions
73
 
        for functions in HAS.values():
74
 
            for function in functions.split():
75
 
                if function not in all_functions:
76
 
                    all_functions.append(function)
 
70
    # Find all other functions
 
71
    for functions in HAS.values():
 
72
        for function in functions.split():
 
73
            if function not in all_functions:
 
74
                all_functions.append(function)
77
75
 
78
76
    for alignment in alignments:
79
77
        for function in all_functions:
105
103
 
106
104
def run_top(cache):
107
105
    variants = sorted(HAS.keys())
108
 
    functions = sys.argv[1:]
109
106
 
110
107
    # Upper limit in bytes to test to
111
108
    top = 512*1024
124
121
 
125
122
    alignments = [8, 16, 4, 1, 2, 32]
126
123
 
127
 
    run_many(cache, variants, bytes, alignments, functions)
 
124
    run_many(cache, variants, bytes, alignments)
128
125
 
129
126
def main():
130
127
    cachename = 'cache.txt'