diff options
author | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
---|---|---|
committer | Joshua Bakita <bakitajoshua@gmail.com> | 2019-10-07 19:13:39 -0400 |
commit | 386b7d3366f1359a265da207a9cafa3edf553b64 (patch) | |
tree | c76120c2c138faed822e4ae386be6ef22a738a78 /all_pairs/source/anagram | |
parent | 54a3f7091a2146b29c73a6fdc4b62a5c4ad7a3d8 (diff) |
Reorganize and commit all the modified TACLeBench code and run scripts
Diffstat (limited to 'all_pairs/source/anagram')
-rw-r--r-- | all_pairs/source/anagram/ChangeLog.txt | 125 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram.c | 670 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagramTest.txt | 100 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_compare.h | 27 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_ctype.h | 45 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_input.c | 2317 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_stdlib.c | 153 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_stdlib.h | 29 | ||||
-rw-r--r-- | all_pairs/source/anagram/anagram_strings.h | 27 |
9 files changed, 3493 insertions, 0 deletions
diff --git a/all_pairs/source/anagram/ChangeLog.txt b/all_pairs/source/anagram/ChangeLog.txt new file mode 100644 index 0000000..fdba1cc --- /dev/null +++ b/all_pairs/source/anagram/ChangeLog.txt | |||
@@ -0,0 +1,125 @@ | |||
1 | File: anagram.c | ||
2 | Original provenience: unknown | ||
3 | Source: unknown | ||
4 | |||
5 | 2017-04-18: | ||
6 | - Annotated anagram_main as entry-point for timing analysis | ||
7 | |||
8 | 2016-06-22: | ||
9 | - Fixed type signature of function anagram_main to conform to TACLeBench | ||
10 | standard, i.e. `void anagram_main (void)`. | ||
11 | |||
12 | 2016-05-24: | ||
13 | - Changed type of global variables anagram_achPhrase and | ||
14 | anagram_dictionary to `char const *[]`. | ||
15 | - Changed parameter type of function anagram_BuildMask to | ||
16 | `char const *`. | ||
17 | |||
18 | 2016-04-26: | ||
19 | - Fixed array out-of-bounds access introduced by earlier change. | ||
20 | |||
21 | 2016-04-20: | ||
22 | - Fixed some compiler warnings. | ||
23 | - Return value of anagram_return depends on the computation inside | ||
24 | of anagram_main. | ||
25 | |||
26 | 2016-03-22 | ||
27 | - Added forward declarations for all functions. | ||
28 | - Renamed function main to anagram_main. | ||
29 | - Added function anagram_init that calls anagram_ReadDict, removed | ||
30 | call to anagram_ReadDict from anagram_main. | ||
31 | - Added function anagram_return that handles the return value. | ||
32 | - Added new function main that first calls anagram_init, | ||
33 | then anagram_main and finally returns the return value of | ||
34 | anagram_return. | ||
35 | - Added generic TACLeBench header to all files. | ||
36 | - Introduced comments to split file in sections for type | ||
37 | definitions, forward declarations, global variables, | ||
38 | initialization-related and return-value-related functions, | ||
39 | core benchmark functions, and main routine. | ||
40 | - Renamed ch2i, DICTWORDS, Quad, MASK_BITS, MAX_QUADS, MAXCAND, | ||
41 | MAXSOL, ALPHABET, Word, PWord, PPWord, apwCand, cpwCand, Letter, | ||
42 | PLetter, alPhrase, cchPhraseLength, aqMainMask, aqMainSign, | ||
43 | cchMinLength, auGlobalFrequency, achByFrequency, pchDictionary, | ||
44 | Reset, ReadDict, BuildMask, NewWord, NextWord, BuildWord, | ||
45 | AddWords, apwSol, cpwLast, OneStep, DumpWords, FindAnagram and | ||
46 | SortCandidates to anagram_ch2i, anagram_DICTWORDS, anagram_Quad, | ||
47 | anagram_MASK_BITS, anagram_MAX_QUADS, anagram_MAXCAND, | ||
48 | anagram_MAXSOL, anagram_ALPHABET, anagram_Word, anagram_PWord, | ||
49 | anagram_PPWord, anagram_apwCand, anagram_cpwCand, anagram_Letter, | ||
50 | anagram_PLetter, anagram_alPhrase, anagram_cchPhraseLength, | ||
51 | anagram_aqMainMask, anagram_aqMainSign, anagram_cchMinLength, | ||
52 | anagram_auGlobalFrequency, anagram_achByFrequency, | ||
53 | anagram_pchDictionary, anagram_Reset, anagram_ReadDict, | ||
54 | anagram_BuildMask, anagram_NewWord, anagram_NextWord, | ||
55 | anagram_BuildWord, anagram_AddWords, anagram_apwSol, | ||
56 | anagram_cpwLast, anagram_OneStep, anagram_DumpWords, | ||
57 | anagram_FindAnagram and anagram_SortCandidates. | ||
58 | - Renamed swapi, pivot, qsorts, simulated_heap and freeHeapPos to | ||
59 | anagram_swapi, anagram_pivot, anagram_qsorts, | ||
60 | anagram_simulated_heap and anagram_freeHeapPos. | ||
61 | - Renamed achPhrase and dictionary to anagram_achPhrase and | ||
62 | anagram_dictionary. | ||
63 | - Renamed CompareFrequency to anagram_CompareFrequency. | ||
64 | - Increased simulated heap in anagram_stdlib.c to 18000 bytes to | ||
65 | prevent segmentation fault. | ||
66 | - Changed header guard _WCCMALLOC_H to ANAGRAM_STRINGS_H. | ||
67 | - Renamed wccmalloc, wccbzero to anagram_malloc, anagram_bzero. | ||
68 | - Moved declaration of anagram_malloc to header anagram_stdlib.h. | ||
69 | - Introduced header guard ANAGRAM_CTYPE_H. | ||
70 | - Renamed wccislower, wccisupper, wccisalpha, wcctolower to | ||
71 | anagram_islower, anagram_isupper, anagram_isalpha, | ||
72 | anagram_tolower. | ||
73 | - Removed illegal keyword "inline". | ||
74 | - Changed header guard _WCCSTDLIB_H to ANAGRAM_STDLIB_H. | ||
75 | - Renamed wccqsort to anagram_qsort. | ||
76 | - Fixed compiler warning "no previous extern declaration for | ||
77 | non-static variable" for variables simulated_heap and | ||
78 | freeHeapPos by declaring them static. | ||
79 | - Renamed preprocessor define HEAP_SIZE to ANAGRAM_HEAP_SIZE. | ||
80 | - Fixed compiler warning "no previous prototype for function" by | ||
81 | moving includes to the top of the file. | ||
82 | - Fixed compiler warnings "implicit conversion changes signedness" | ||
83 | and "comparison of integers of different signs" by consistenly | ||
84 | using the type unsigned long in qsort helper functions. | ||
85 | - Moved function CompareFrequency to file anagram.c, added | ||
86 | declaration for it in file anagram_compare.h and included it in | ||
87 | anagram_stdlib.h. | ||
88 | - Fixed compiler warning "no previous extern declaration for | ||
89 | non-static variable" by adding forward declarations. | ||
90 | - Fixed compiler warning "macro is not used" by removing unused | ||
91 | macros MAXWORDS and i2ch. | ||
92 | - Replaced macro ch2i by proper function. | ||
93 | - Fixed compiler warning "array subscript is of type 'char' in | ||
94 | function CompareFrequency. | ||
95 | - Fixed compiler warning "unused variable" by removing variable i | ||
96 | in function Reset. | ||
97 | - Fixed compiler warning "no previous extern declaration for | ||
98 | non-static variable" by making global variables in file | ||
99 | anagram.c static. | ||
100 | - Replaced macro lPhrase by its expansion. | ||
101 | - Fixed compiler warnings "implicit conversion loses integer | ||
102 | precision" and "implicit conversion changes signedness" by | ||
103 | adding explicit casts or using the appropriate type for local | ||
104 | variables. | ||
105 | - Fixed compiler warning "array subscript is of type 'char'" by | ||
106 | changing type of some local variables as well as of global | ||
107 | variable achByFrequency to int. | ||
108 | - Changed all //-style comments to /* */-style comments. | ||
109 | - Moved contents of wccmalloc.c to anagram_stdlib.c. | ||
110 | - Renamed input.c to anagram_input.c. | ||
111 | - Renamed wccctype.h to anagram_ctype.h. | ||
112 | - Renamed wccstdlib.c to anagram_stdlib.c. | ||
113 | - Renamed wccstdlib.h to anagram_stdlib.h. | ||
114 | - Renamed wccmalloc.h to anagram_strings.h. | ||
115 | - Applied TACLeBench formatting rules via | ||
116 | astyle --options=doc/example/astylerc.txt | ||
117 | - Tested conformance to C99 via | ||
118 | clang -fsyntax-only -Weverything -Wno-unknown-pragmas -Wno-padded -pedantic -std=c99 | ||
119 | |||
120 | 2017-06-27 | ||
121 | - Remove static declarations. | ||
122 | |||
123 | 2017-07-10: | ||
124 | - Adjust alignment calculation in anagram_malloc to not add padding on already | ||
125 | aligned addresses. This prevents a buffer overflow of anagram_simulated_heap. | ||
diff --git a/all_pairs/source/anagram/anagram.c b/all_pairs/source/anagram/anagram.c new file mode 100644 index 0000000..8f140a3 --- /dev/null +++ b/all_pairs/source/anagram/anagram.c | |||
@@ -0,0 +1,670 @@ | |||
1 | /* | ||
2 | |||
3 | This program is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: A program that computes anagrams. | ||
11 | |||
12 | Source: See below. | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See below. | ||
19 | |||
20 | */ | ||
21 | |||
22 | /* | ||
23 | Anagram program by Raymond Chen, | ||
24 | inspired by a similar program by Brian Scearce | ||
25 | |||
26 | This program is Copyright 1991 by Raymond Chen. | ||
27 | (rjc@math.princeton.edu) | ||
28 | |||
29 | This program may be freely distributed provided all alterations | ||
30 | to the original are clearly indicated as such. | ||
31 | */ | ||
32 | |||
33 | /* There are two tricks. First is the Basic Idea: | ||
34 | |||
35 | When the user types in a phrase, the phrase is first preprocessed to | ||
36 | determine how many of each letter appears. A bit field is then constructed | ||
37 | dynamically, such that each field is large enough to hold the next power | ||
38 | of two larger than the number of times the character appears. For example, | ||
39 | if the phrase is hello, world, the bit field would be | ||
40 | |||
41 | 00 00 00 000 000 00 00 | ||
42 | d e h l o r w | ||
43 | |||
44 | The phrase hello, world, itself would be encoded as | ||
45 | |||
46 | 01 01 01 011 010 01 01 | ||
47 | d e h l o r w | ||
48 | |||
49 | and the word hollow would be encoded as | ||
50 | |||
51 | 00 00 01 010 010 00 01 | ||
52 | d e h l o r w | ||
53 | |||
54 | The top bit of each field is set in a special value called the sign. | ||
55 | Here, the sign would be | ||
56 | |||
57 | 10 10 10 100 100 10 10 | ||
58 | d e h l o r w | ||
59 | |||
60 | |||
61 | The reason for packing the values into a bit field is that the operation | ||
62 | of subtracting out the letters of a word from the current phrase can be | ||
63 | carried out in parallel. for example, subtracting the word hello from | ||
64 | the phrase hello, world, is merely | ||
65 | |||
66 | d e h l o r w | ||
67 | 01 01 01 011 010 01 01 (dehllloorw) | ||
68 | - 00 00 01 010 010 00 01 (hlloow) | ||
69 | ======================== | ||
70 | 01 01 00 001 000 01 00 (delr) | ||
71 | |||
72 | Since none of the sign bits is set, the word fits, and we can continue. | ||
73 | Suppose the next word we tried was hood. | ||
74 | |||
75 | d e h l o r w | ||
76 | 01 01 00 001 000 01 00 (delr) | ||
77 | - 01 00 01 000 010 00 00 (hood) | ||
78 | ======================== | ||
79 | 00 00 11 000 110 01 00 | ||
80 | ^ ^ | ||
81 | A sign bit is set. (Two, actually.) This means that hood does not | ||
82 | fit in delr, so we skip it and try another word. (Observe that | ||
83 | when a sign bit becomes set, it screws up the values for the letters to | ||
84 | the left of that bit, but that's not important.) | ||
85 | |||
86 | The inner loop of an anagram program is testing to see if a | ||
87 | word fits in the collection of untried letters. Traditional methods | ||
88 | keep an array of 26 integers, which are then compared in turn. This | ||
89 | means that there are 26 comparisons per word. | ||
90 | |||
91 | This method reduces the number of comparisons to MAX_QUAD, typically 2. | ||
92 | Instead of looping through an array, we merely perform the indicated | ||
93 | subtraction and test if any of the sign bits is set. | ||
94 | */ | ||
95 | |||
96 | /* The nuts and bolts: | ||
97 | |||
98 | The dictionary is loaded and preprocessed. The preprocessed dictionary | ||
99 | is a concatenation of copies of the structure: | ||
100 | |||
101 | struct dictword { | ||
102 | char bStructureSize; -- size of this structure | ||
103 | char cLetters; -- number of letters in the word | ||
104 | char achWord[]; -- the word itself (0-terminated) | ||
105 | } | ||
106 | |||
107 | Since this is a variable-sized structure, we keep its size in the structure | ||
108 | itself for rapid stepping through the table. | ||
109 | |||
110 | When a phrase is typed in, it is first preprocessed as described in the | ||
111 | Basic Idea. We then go through the dictionary, testing each word. If | ||
112 | the word fits in our phrase, we build the bit field for its frequency | ||
113 | table and add it to the list of candidates. | ||
114 | */ | ||
115 | |||
116 | /* | ||
117 | The Second Trick: | ||
118 | |||
119 | Before diving into our anagram search, we then tabulate how many times | ||
120 | each letter appears in our list of candidates, and sort the table, with | ||
121 | the rarest letter first. | ||
122 | |||
123 | We then do our anagram search. | ||
124 | |||
125 | Like most anagram programs, this program does a depth-first search. | ||
126 | Although most anagram programs do some sort of heuristics to decide what | ||
127 | order to place words in the list_of_candidates, the search itself proceeds | ||
128 | according to a greedy algorithm. That is, once you find a word that fits, | ||
129 | subtract it and recurse. | ||
130 | |||
131 | This anagram program exercises some restraint and does not march down | ||
132 | every branch that shows itself. Instead, it only goes down branches | ||
133 | that use the rarest unused letter. This helps to find dead ends faster. | ||
134 | |||
135 | FindAnagram(unused_letters, list_of_candidates) { | ||
136 | l = the rarest letter as yet unused | ||
137 | For word in list_of_candidates { | ||
138 | if word does not fit in unused_letters, go on to the next word. | ||
139 | if word does not contain l, defer. | ||
140 | FindAnagram(unused_letters - word, list_of_candidates[word,...]) | ||
141 | } | ||
142 | } | ||
143 | |||
144 | |||
145 | The heuristic of the Second Trick can probably be improved. I invite | ||
146 | anyone willing to improve it to do so. | ||
147 | */ | ||
148 | |||
149 | /* Before compiling, make sure Quad and MASK_BITS are set properly. For best | ||
150 | results, make Quad the largest integer size supported on your machine. | ||
151 | So if your machine has long longs, make Quad an unsigned long long. | ||
152 | (I called it Quad because on most machines, the largest integer size | ||
153 | supported is a four-byte unsigned long.) | ||
154 | |||
155 | If you need to be able to anagram larger phrases, increase MAX_QUADS. | ||
156 | If you increase it beyond 4, you'll have to add a few more loop unrolling | ||
157 | steps to FindAnagram. | ||
158 | */ | ||
159 | |||
160 | #include "../extra.h" | ||
161 | #include "anagram_ctype.h" | ||
162 | #include "anagram_stdlib.h" | ||
163 | #include "anagram_strings.h" | ||
164 | |||
165 | #include "anagram_compare.h" | ||
166 | |||
167 | |||
168 | /* | ||
169 | Defines | ||
170 | */ | ||
171 | |||
172 | #define anagram_DICTWORDS 2279 | ||
173 | #define anagram_MASK_BITS 32 /* number of bits in a Quad */ | ||
174 | #define anagram_MAX_QUADS 2 /* controls largest phrase */ | ||
175 | #define anagram_MAXCAND 100 /* candidates */ | ||
176 | #define anagram_MAXSOL 51 /* words in the solution */ | ||
177 | #define anagram_ALPHABET 26 /* letters in the alphabet */ | ||
178 | |||
179 | #define anagram_OneStep( i ) \ | ||
180 | if ( ( aqNext[ i ] = pqMask[ i ] - pw->aqMask[ i ] ) & anagram_aqMainSign[ i ] ) { \ | ||
181 | ppwStart ++; \ | ||
182 | continue; \ | ||
183 | } | ||
184 | |||
185 | |||
186 | /* | ||
187 | Type definitions | ||
188 | */ | ||
189 | |||
190 | typedef unsigned int anagram_Quad; /* for building our bit mask */ | ||
191 | |||
192 | /* A Word remembers the information about a candidate word. */ | ||
193 | typedef struct { | ||
194 | char *pchWord; /* the word itself */ | ||
195 | anagram_Quad aqMask[ anagram_MAX_QUADS ]; /* the word's mask */ | ||
196 | unsigned cchLength; /* letters in the word */ | ||
197 | char padding[4]; | ||
198 | } anagram_Word; | ||
199 | typedef anagram_Word *anagram_PWord; | ||
200 | typedef anagram_Word **anagram_PPWord; | ||
201 | |||
202 | /* A Letter remembers information about each letter in the phrase to | ||
203 | be anagrammed. */ | ||
204 | typedef struct { | ||
205 | unsigned uFrequency; /* how many times it appears */ | ||
206 | unsigned uShift; /* how to mask */ | ||
207 | unsigned uBits; /* the bit mask itself */ | ||
208 | unsigned iq; /* which Quad to inspect? */ | ||
209 | } anagram_Letter; | ||
210 | typedef anagram_Letter *anagram_PLetter; | ||
211 | |||
212 | |||
213 | /* | ||
214 | Forward declaration of functions | ||
215 | */ | ||
216 | |||
217 | void anagram_init( void ); | ||
218 | void anagram_main( void ); | ||
219 | int anagram_return( void ); | ||
220 | int anagram_ch2i( int ch ); | ||
221 | void anagram_AddWords( void ); | ||
222 | void anagram_BuildMask( char const *pchPhrase ); | ||
223 | void anagram_BuildWord( char *pchWord ); | ||
224 | void anagram_DumpWords( void ); | ||
225 | void anagram_FindAnagram( anagram_Quad *pqMask, | ||
226 | anagram_PPWord ppwStart, | ||
227 | int iLetter ); | ||
228 | anagram_PWord anagram_NewWord( void ); | ||
229 | anagram_PWord anagram_NextWord( void ); | ||
230 | void anagram_ReadDict( void ); | ||
231 | void anagram_Reset( void ); | ||
232 | void anagram_SortCandidates( void ); | ||
233 | |||
234 | |||
235 | /* | ||
236 | Declaration of global variables | ||
237 | */ | ||
238 | |||
239 | extern char const *anagram_achPhrase[ 3 ]; | ||
240 | extern char const *anagram_dictionary[ anagram_DICTWORDS ]; | ||
241 | |||
242 | /* candidates we've found so far */ | ||
243 | static anagram_PWord anagram_apwCand[ anagram_MAXCAND ]; | ||
244 | /* how many of them? */ | ||
245 | static unsigned anagram_cpwCand; | ||
246 | |||
247 | /* statistics on the current phrase */ | ||
248 | static anagram_Letter anagram_alPhrase[ anagram_ALPHABET ]; | ||
249 | |||
250 | /* number of letters in phrase */ | ||
251 | static int anagram_cchPhraseLength; | ||
252 | |||
253 | /* the bit field for the full phrase */ | ||
254 | static anagram_Quad anagram_aqMainMask[ anagram_MAX_QUADS ]; | ||
255 | /* where the sign bits are */ | ||
256 | static anagram_Quad anagram_aqMainSign[ anagram_MAX_QUADS ]; | ||
257 | |||
258 | static const int anagram_cchMinLength = 3; | ||
259 | |||
260 | /* auGlobalFrequency counts the number of times each letter appears, | ||
261 | summed over all candidate words. This is used to decide which letter | ||
262 | to attack first. */ | ||
263 | static unsigned anagram_auGlobalFrequency[ anagram_ALPHABET ]; | ||
264 | static int anagram_achByFrequency[ anagram_ALPHABET ]; /* for sorting */ | ||
265 | |||
266 | /* the dictionary is read here */ | ||
267 | static char *anagram_pchDictionary; | ||
268 | |||
269 | /* the answers */ | ||
270 | static anagram_PWord anagram_apwSol[ anagram_MAXSOL ]; | ||
271 | static int anagram_cpwLast; | ||
272 | |||
273 | /* buffer to write an answer */ | ||
274 | static char anagram_buffer[30]; | ||
275 | |||
276 | /* | ||
277 | Initialization- and return-value-related functions | ||
278 | */ | ||
279 | |||
280 | /* ReadDict -- read the dictionary file into memory and preprocess it | ||
281 | |||
282 | A word of length cch in the dictionary is encoded as follows: | ||
283 | |||
284 | byte 0 = cch + 3 | ||
285 | byte 1 = number of letters in the word | ||
286 | byte 2... = the word itself, null-terminated | ||
287 | |||
288 | Observe that cch+3 is the length of the total encoding. These | ||
289 | byte streams are concatenated, and terminated with a 0. | ||
290 | */ | ||
291 | void anagram_ReadDict( void ) | ||
292 | { | ||
293 | char *pch; | ||
294 | char *pchBase; | ||
295 | unsigned len; | ||
296 | unsigned cWords = 0; | ||
297 | unsigned cLetters; | ||
298 | int i; | ||
299 | volatile char bitmask = 0; | ||
300 | |||
301 | len = 0; | ||
302 | _Pragma( "loopbound min 2279 max 2279" ) | ||
303 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { | ||
304 | unsigned strlen = 0; | ||
305 | _Pragma( "loopbound min 1 max 5" ) | ||
306 | while ( anagram_dictionary[ i ][ strlen ] != 0 ) | ||
307 | strlen ++; | ||
308 | len += strlen + 2; | ||
309 | } | ||
310 | |||
311 | pchBase = anagram_pchDictionary = ( char * )anagram_malloc( len ); | ||
312 | |||
313 | _Pragma( "loopbound min 2279 max 2279" ) | ||
314 | for ( i = 0; i < anagram_DICTWORDS; i ++ ) { | ||
315 | int index = 0; | ||
316 | pch = pchBase + 2; /* reserve for length */ | ||
317 | cLetters = 0; | ||
318 | |||
319 | _Pragma( "loopbound min 1 max 5" ) | ||
320 | while ( anagram_dictionary[ i ][ index ] != '\0' ) { | ||
321 | if ( anagram_isalpha( anagram_dictionary[ i ][ index ] ) ) | ||
322 | cLetters ++; | ||
323 | *pch ++ = anagram_dictionary[ i ][ index ]; | ||
324 | index ++; | ||
325 | *( pch - 1 ) ^= bitmask; | ||
326 | } | ||
327 | *pch ++ = '\0'; | ||
328 | *pchBase = ( char )( pch - pchBase ); | ||
329 | pchBase[ 1 ] = ( char )cLetters; | ||
330 | pchBase = pch; | ||
331 | cWords ++; | ||
332 | } | ||
333 | |||
334 | *pchBase ++ = 0; | ||
335 | } | ||
336 | |||
337 | |||
338 | void anagram_init( void ) | ||
339 | { | ||
340 | anagram_ReadDict(); | ||
341 | } | ||
342 | |||
343 | |||
344 | int anagram_return( void ) | ||
345 | { | ||
346 | int i; | ||
347 | char const *answer = "duke rip amy"; | ||
348 | |||
349 | for ( i = 0; i < 12; i++ ) | ||
350 | if ( answer[ i ] != anagram_buffer[ i ] ) | ||
351 | return 1; | ||
352 | |||
353 | return 0; | ||
354 | } | ||
355 | |||
356 | |||
357 | /* | ||
358 | Core benchmark functions | ||
359 | */ | ||
360 | |||
361 | /* convert letter to index */ | ||
362 | int anagram_ch2i( int ch ) | ||
363 | { | ||
364 | return ch - 'a'; | ||
365 | } | ||
366 | |||
367 | |||
368 | int anagram_CompareFrequency( char *pch1, char *pch2 ) | ||
369 | { | ||
370 | return anagram_auGlobalFrequency[ ( (int) *pch1 ) ] < | ||
371 | anagram_auGlobalFrequency[ ( (int) *pch2 ) ] | ||
372 | ? -1 : | ||
373 | anagram_auGlobalFrequency[ ( (int) *pch1 ) ] == | ||
374 | anagram_auGlobalFrequency[ ( (int) *pch2 ) ] | ||
375 | ? 0 : 1; | ||
376 | } | ||
377 | |||
378 | |||
379 | void anagram_Reset( void ) | ||
380 | { | ||
381 | anagram_bzero( ( char * )anagram_alPhrase, | ||
382 | sizeof( anagram_Letter ) * anagram_ALPHABET ); | ||
383 | anagram_bzero( ( char * )anagram_aqMainMask, | ||
384 | sizeof( anagram_Quad ) * anagram_MAX_QUADS ); | ||
385 | anagram_bzero( ( char * )anagram_aqMainSign, | ||
386 | sizeof( anagram_Quad ) * anagram_MAX_QUADS ); | ||
387 | anagram_bzero( ( char * )anagram_auGlobalFrequency, | ||
388 | sizeof( unsigned ) * anagram_ALPHABET ); | ||
389 | anagram_bzero( ( char * )anagram_achByFrequency, | ||
390 | sizeof( int ) * anagram_ALPHABET ); | ||
391 | anagram_bzero( ( char * )anagram_apwCand, | ||
392 | sizeof( anagram_PWord ) * anagram_MAXCAND ); | ||
393 | anagram_cchPhraseLength = 0; | ||
394 | anagram_cpwCand = 0; | ||
395 | } | ||
396 | |||
397 | |||
398 | void anagram_BuildMask( char const *pchPhrase ) | ||
399 | { | ||
400 | int i; | ||
401 | int ch; | ||
402 | unsigned iq; /* which Quad? */ | ||
403 | unsigned int cbtUsed; /* bits used in the current Quad */ | ||
404 | unsigned int cbtNeed; /* bits needed for current letter */ | ||
405 | anagram_Quad qNeed; /* used to build the mask */ | ||
406 | |||
407 | /* Tabulate letter frequencies in the phrase */ | ||
408 | anagram_cchPhraseLength = 0; | ||
409 | _Pragma( "loopbound min 11 max 12" ) | ||
410 | while ( ( ch = *pchPhrase ++ ) != '\0' ) { | ||
411 | if ( anagram_isalpha( ch ) ) { | ||
412 | ch = anagram_tolower( ch ); | ||
413 | anagram_alPhrase[ anagram_ch2i( ch ) ].uFrequency ++; | ||
414 | anagram_cchPhraseLength ++; | ||
415 | } | ||
416 | } | ||
417 | |||
418 | /* Build masks */ | ||
419 | iq = 0; /* which quad being used */ | ||
420 | cbtUsed = 0; /* bits used so far */ | ||
421 | |||
422 | _Pragma( "loopbound min 26 max 26" ) | ||
423 | for ( i = 0; i < anagram_ALPHABET; i ++ ) { | ||
424 | if ( anagram_alPhrase[ i ].uFrequency == 0 ) { | ||
425 | anagram_auGlobalFrequency[ i ] = ~0u; /* to make it sort last */ | ||
426 | } else { | ||
427 | anagram_auGlobalFrequency[ i ] = 0u; | ||
428 | _Pragma( "loopbound min 1 max 2" ) | ||
429 | for ( cbtNeed = 1, qNeed = 1; | ||
430 | anagram_alPhrase[ i ].uFrequency >= qNeed; | ||
431 | cbtNeed ++, qNeed <<= 1 ) | ||
432 | ; | ||
433 | if ( cbtUsed + cbtNeed > anagram_MASK_BITS ) | ||
434 | cbtUsed = 0; | ||
435 | anagram_alPhrase[ i ].uBits = qNeed - 1; | ||
436 | if ( cbtUsed ) | ||
437 | qNeed <<= cbtUsed; | ||
438 | anagram_aqMainSign[ iq ] |= qNeed; | ||
439 | anagram_aqMainMask[ iq ] |= | ||
440 | ( anagram_Quad )anagram_alPhrase[ i ].uFrequency << cbtUsed; | ||
441 | anagram_alPhrase[ i ].uShift = cbtUsed; | ||
442 | anagram_alPhrase[ i ].iq = iq; | ||
443 | cbtUsed += cbtNeed; | ||
444 | } | ||
445 | } | ||
446 | } | ||
447 | |||
448 | |||
449 | anagram_PWord anagram_NewWord( void ) | ||
450 | { | ||
451 | anagram_PWord pw; | ||
452 | |||
453 | pw = ( anagram_Word * )anagram_malloc( sizeof( anagram_Word ) ); | ||
454 | return pw; | ||
455 | } | ||
456 | |||
457 | |||
458 | /* NextWord -- get another candidate entry, creating if necessary */ | ||
459 | anagram_PWord anagram_NextWord( void ) | ||
460 | { | ||
461 | anagram_PWord pw; | ||
462 | pw = anagram_apwCand[ anagram_cpwCand ++ ]; | ||
463 | if ( pw != 0 ) | ||
464 | return pw; | ||
465 | anagram_apwCand[ anagram_cpwCand - 1 ] = anagram_NewWord(); | ||
466 | return anagram_apwCand[ anagram_cpwCand - 1 ]; | ||
467 | } | ||
468 | |||
469 | |||
470 | /* BuildWord -- build a Word structure from an ASCII word | ||
471 | If the word does not fit, then do nothing. */ | ||
472 | void anagram_BuildWord( char *pchWord ) | ||
473 | { | ||
474 | unsigned char cchFrequency[ anagram_ALPHABET ]; | ||
475 | int i; | ||
476 | char *pch = pchWord; | ||
477 | anagram_PWord pw; | ||
478 | unsigned int cchLength = 0; | ||
479 | |||
480 | anagram_bzero( ( char * )cchFrequency, | ||
481 | sizeof( unsigned char ) * anagram_ALPHABET ); | ||
482 | |||
483 | /* Build frequency table */ | ||
484 | _Pragma( "loopbound min 3 max 636" ) | ||
485 | while ( ( i = *pch ++ ) != '\0' ) { | ||
486 | if ( !anagram_isalpha( i ) ) | ||
487 | continue; | ||
488 | i = anagram_ch2i( anagram_tolower( i ) ); | ||
489 | if ( ++ cchFrequency[ i ] > anagram_alPhrase[ i ].uFrequency ) | ||
490 | return ; | ||
491 | ++ cchLength; | ||
492 | } | ||
493 | |||
494 | /* Update global count */ | ||
495 | _Pragma( "loopbound min 26 max 26" ) | ||
496 | for ( i = 0; i < anagram_ALPHABET; i ++ ) | ||
497 | anagram_auGlobalFrequency[ i ] += cchFrequency[ i ]; | ||
498 | |||
499 | /* Create a Word structure and fill it in, including building the | ||
500 | bitfield of frequencies. */ | ||
501 | pw = anagram_NextWord(); | ||
502 | anagram_bzero( ( char * )( pw->aqMask ), | ||
503 | sizeof( anagram_Quad ) * anagram_MAX_QUADS ); | ||
504 | |||
505 | pw->pchWord = pchWord; | ||
506 | pw->cchLength = cchLength; | ||
507 | _Pragma( "loopbound min 26 max 26" ) | ||
508 | for ( i = 0; i < anagram_ALPHABET; i ++ ) { | ||
509 | pw->aqMask[ anagram_alPhrase[i].iq ] |= | ||
510 | ( anagram_Quad )cchFrequency[ i ] << anagram_alPhrase[ i ].uShift; | ||
511 | } | ||
512 | } | ||
513 | |||
514 | |||
515 | /* AddWords -- build the list of candidates */ | ||
516 | void anagram_AddWords( void ) | ||
517 | { | ||
518 | char *pch = anagram_pchDictionary; /* walk through the dictionary */ | ||
519 | |||
520 | anagram_cpwCand = 0; | ||
521 | |||
522 | _Pragma( "loopbound min 1967 max 1967" ) | ||
523 | while ( *pch ) { | ||
524 | if ( ( pch[ 1 ] >= anagram_cchMinLength && | ||
525 | pch[ 1 ] + anagram_cchMinLength <= anagram_cchPhraseLength ) | ||
526 | || pch[ 1 ] == anagram_cchPhraseLength ) | ||
527 | anagram_BuildWord( pch + 2 ); | ||
528 | pch += *pch; | ||
529 | } | ||
530 | } | ||
531 | |||
532 | |||
533 | void anagram_DumpWords( void ) | ||
534 | { | ||
535 | int i, j; | ||
536 | int offset = 0; | ||
537 | _Pragma( "loopbound min 3 max 3" ) | ||
538 | for ( i = 0; i < anagram_cpwLast; i ++ ) { | ||
539 | _Pragma( "loopbound min 3 max 5" ) | ||
540 | for ( j = 0; anagram_apwSol[ i ]->pchWord[ j ] != '\0'; j ++ ) | ||
541 | anagram_buffer[ offset + j ] = anagram_apwSol[ i ]->pchWord[ j ]; | ||
542 | offset += j; | ||
543 | |||
544 | anagram_buffer[ offset ++ ] = ' '; | ||
545 | } | ||
546 | anagram_buffer[ offset ++ ] = '\0'; | ||
547 | } | ||
548 | |||
549 | |||
550 | void anagram_FindAnagram( anagram_Quad *pqMask, anagram_PPWord ppwStart, | ||
551 | int iLetter ) | ||
552 | { | ||
553 | anagram_Quad aqNext[ anagram_MAX_QUADS ]; | ||
554 | register anagram_PWord pw; | ||
555 | anagram_Quad qMask; | ||
556 | unsigned iq; | ||
557 | anagram_PPWord ppwEnd = &anagram_apwCand[ 0 ]; | ||
558 | ppwEnd += anagram_cpwCand; | ||
559 | |||
560 | _Pragma( "loopbound min 1 max 7" ) | ||
561 | while ( 1 ) { | ||
562 | iq = anagram_alPhrase[ anagram_achByFrequency[iLetter] ].iq; | ||
563 | qMask = anagram_alPhrase[ anagram_achByFrequency[iLetter] ].uBits << | ||
564 | anagram_alPhrase[ anagram_achByFrequency[iLetter] ].uShift; | ||
565 | if ( pqMask[ iq ] & qMask ) | ||
566 | break; | ||
567 | iLetter ++; | ||
568 | } | ||
569 | |||
570 | _Pragma( "loopbound min 0 max 114" ) | ||
571 | while ( ppwStart < ppwEnd ) { | ||
572 | pw = *ppwStart; | ||
573 | |||
574 | #if anagram_MAX_QUADS > 0 | ||
575 | anagram_OneStep( 0 ); | ||
576 | #endif | ||
577 | |||
578 | #if anagram_MAX_QUADS > 1 | ||
579 | anagram_OneStep( 1 ); | ||
580 | #endif | ||
581 | |||
582 | #if anagram_MAX_QUADS > 2 | ||
583 | anagram_OneStep( 2 ); | ||
584 | #endif | ||
585 | |||
586 | #if anagram_MAX_QUADS > 3 | ||
587 | anagram_OneStep( 3 ); | ||
588 | #endif | ||
589 | |||
590 | #if anagram_MAX_QUADS > 4 | ||
591 | @@"Add more unrolling steps here, please."@@ | ||
592 | #endif | ||
593 | |||
594 | /* If the pivot letter isn't present, defer this word until later */ | ||
595 | if ( ( pw->aqMask[ iq ] & qMask ) == 0 ) { | ||
596 | *ppwStart = *( -- ppwEnd ); | ||
597 | *ppwEnd = pw; | ||
598 | continue; | ||
599 | } | ||
600 | |||
601 | /* If we get here, this means the word fits. */ | ||
602 | anagram_apwSol[ anagram_cpwLast ++ ] = pw; | ||
603 | if ( anagram_cchPhraseLength -= pw->cchLength ) { /* recurse */ | ||
604 | /* The recursive call scrambles the tail, so we have to be | ||
605 | pessimistic. */ | ||
606 | ppwEnd = &anagram_apwCand[ 0 ]; | ||
607 | ppwEnd += anagram_cpwCand; | ||
608 | anagram_FindAnagram( &aqNext[ 0 ], ppwStart, iLetter ); | ||
609 | } else { /* found one */ | ||
610 | anagram_DumpWords(); | ||
611 | } | ||
612 | anagram_cchPhraseLength += pw->cchLength; | ||
613 | -- anagram_cpwLast; | ||
614 | ppwStart ++; | ||
615 | continue; | ||
616 | } | ||
617 | } | ||
618 | |||
619 | |||
620 | void anagram_SortCandidates( void ) | ||
621 | { | ||
622 | int i; | ||
623 | |||
624 | /* Sort the letters by frequency */ | ||
625 | _Pragma( "loopbound min 26 max 26" ) | ||
626 | for ( i = 0; i < anagram_ALPHABET; i ++ ) | ||
627 | anagram_achByFrequency[ i ] = i; | ||
628 | anagram_qsort( anagram_achByFrequency, anagram_ALPHABET, sizeof( int ) ); | ||
629 | } | ||
630 | |||
631 | |||
632 | void _Pragma( "entrypoint" ) anagram_main( void ) | ||
633 | { | ||
634 | int i; | ||
635 | |||
636 | _Pragma( "loopbound min 3 max 3" ) | ||
637 | for ( i = 0; i < 3; i ++ ) { | ||
638 | anagram_Reset(); | ||
639 | anagram_BuildMask( anagram_achPhrase[ i ] ); | ||
640 | anagram_AddWords(); | ||
641 | if ( anagram_cpwCand == 0 || anagram_cchPhraseLength == 0 ) | ||
642 | continue; | ||
643 | |||
644 | anagram_cpwLast = 0; | ||
645 | anagram_SortCandidates(); | ||
646 | _Pragma( "marker call_find" ) | ||
647 | anagram_FindAnagram( anagram_aqMainMask, anagram_apwCand, 0 ); | ||
648 | _Pragma( "flowrestriction 1*anagram_FindAnagram <= 51*call_find" ) | ||
649 | } | ||
650 | } | ||
651 | |||
652 | |||
653 | /* | ||
654 | Main function | ||
655 | */ | ||
656 | |||
657 | int main(int argc, char **argv) | ||
658 | { | ||
659 | SET_UP | ||
660 | //int jobsComplete; | ||
661 | //int maxJobs=100; | ||
662 | //for(jobsComplete=-1; jobsComplete<maxJobs; jobsComplete++){ | ||
663 | START_LOOP | ||
664 | anagram_init(); | ||
665 | anagram_main(); | ||
666 | STOP_LOOP | ||
667 | //} | ||
668 | WRITE_TO_FILE | ||
669 | return anagram_return(); | ||
670 | } | ||
diff --git a/all_pairs/source/anagram/anagramTest.txt b/all_pairs/source/anagram/anagramTest.txt new file mode 100644 index 0000000..21d58d8 --- /dev/null +++ b/all_pairs/source/anagram/anagramTest.txt | |||
@@ -0,0 +1,100 @@ | |||
1 | anagram none 7 none 100 992260 anagramTest 0 none | ||
2 | anagram none 7 none 100 32657649 anagramTest 1 none | ||
3 | anagram none 7 none 100 50 anagramTest 2 none | ||
4 | anagram none 7 none 100 140726366772064 anagramTest 3 none | ||
5 | anagram none 7 none 100 140332637564920 anagramTest 4 none | ||
6 | anagram none 7 none 100 140332637511040 anagramTest 5 none | ||
7 | anagram none 7 none 100 140726366771844 anagramTest 6 none | ||
8 | anagram none 7 none 100 140726366772048 anagramTest 7 none | ||
9 | anagram none 7 none 100 140332643575048 anagramTest 8 none | ||
10 | anagram none 7 none 100 140724603453440 anagramTest 9 none | ||
11 | anagram none 7 none 100 3 anagramTest 10 none | ||
12 | anagram none 7 none 100 140724603453440 anagramTest 11 none | ||
13 | anagram none 7 none 100 3 anagramTest 12 none | ||
14 | anagram none 7 none 100 0 anagramTest 13 none | ||
15 | anagram none 7 none 100 0 anagramTest 14 none | ||
16 | anagram none 7 none 100 140332643726528 anagramTest 15 none | ||
17 | anagram none 7 none 100 140726366772208 anagramTest 16 none | ||
18 | anagram none 7 none 100 140332643575120 anagramTest 17 none | ||
19 | anagram none 7 none 100 0 anagramTest 18 none | ||
20 | anagram none 7 none 100 140332643725672 anagramTest 19 none | ||
21 | anagram none 7 none 100 140726366772248 anagramTest 20 none | ||
22 | anagram none 7 none 100 140332641512223 anagramTest 21 none | ||
23 | anagram none 7 none 100 1 anagramTest 22 none | ||
24 | anagram none 7 none 100 140332643575120 anagramTest 23 none | ||
25 | anagram none 7 none 100 1 anagramTest 24 none | ||
26 | anagram none 7 none 100 0 anagramTest 25 none | ||
27 | anagram none 7 none 100 1 anagramTest 26 none | ||
28 | anagram none 7 none 100 140332643725672 anagramTest 27 none | ||
29 | anagram none 7 none 100 1 anagramTest 28 none | ||
30 | anagram none 7 none 100 140332643723736 anagramTest 29 none | ||
31 | anagram none 7 none 100 0 anagramTest 30 none | ||
32 | anagram none 7 none 100 0 anagramTest 31 none | ||
33 | anagram none 7 none 100 140332643726528 anagramTest 32 none | ||
34 | anagram none 7 none 100 140726366772064 anagramTest 33 none | ||
35 | anagram none 7 none 100 7472231616 anagramTest 34 none | ||
36 | anagram none 7 none 100 140726366772048 anagramTest 35 none | ||
37 | anagram none 7 none 100 2090089586 anagramTest 36 none | ||
38 | anagram none 7 none 100 4195443 anagramTest 37 none | ||
39 | anagram none 7 none 100 4294967295 anagramTest 38 none | ||
40 | anagram none 7 none 100 140332641470296 anagramTest 39 none | ||
41 | anagram none 7 none 100 140332637550808 anagramTest 40 none | ||
42 | anagram none 7 none 100 140332643573760 anagramTest 41 none | ||
43 | anagram none 7 none 100 140332637522848 anagramTest 42 none | ||
44 | anagram none 7 none 100 2118 anagramTest 43 none | ||
45 | anagram none 7 none 100 140332643573760 anagramTest 44 none | ||
46 | anagram none 7 none 100 140332637511040 anagramTest 45 none | ||
47 | anagram none 7 none 100 140332637564920 anagramTest 46 none | ||
48 | anagram none 7 none 100 140332641510987 anagramTest 47 none | ||
49 | anagram none 7 none 100 2118 anagramTest 48 none | ||
50 | anagram none 7 none 100 140332637564920 anagramTest 49 none | ||
51 | anagram none 7 none 100 140332643573760 anagramTest 50 none | ||
52 | anagram none 7 none 100 140726366772312 anagramTest 51 none | ||
53 | anagram none 7 none 100 140726366772308 anagramTest 52 none | ||
54 | anagram none 7 none 100 6316152 anagramTest 53 none | ||
55 | anagram none 7 none 100 4196240 anagramTest 54 none | ||
56 | anagram none 7 none 100 140726366773040 anagramTest 55 none | ||
57 | anagram none 7 none 100 0 anagramTest 56 none | ||
58 | anagram none 7 none 100 0 anagramTest 57 none | ||
59 | anagram none 7 none 100 140726366772816 anagramTest 58 none | ||
60 | anagram none 7 none 100 140332641532614 anagramTest 59 none | ||
61 | anagram none 7 none 100 1 anagramTest 60 none | ||
62 | anagram none 7 none 100 0 anagramTest 61 none | ||
63 | anagram none 7 none 100 140332637564920 anagramTest 62 none | ||
64 | anagram none 7 none 100 140332637550808 anagramTest 63 none | ||
65 | anagram none 7 none 100 140726366772528 anagramTest 64 none | ||
66 | anagram none 7 none 100 140332641566447 anagramTest 65 none | ||
67 | anagram none 7 none 100 65280 anagramTest 66 none | ||
68 | anagram none 7 none 100 0 anagramTest 67 none | ||
69 | anagram none 7 none 100 3399988123389603631 anagramTest 68 none | ||
70 | anagram none 7 none 100 3399988123389603631 anagramTest 69 none | ||
71 | anagram none 7 none 100 0 anagramTest 70 none | ||
72 | anagram none 7 none 100 0 anagramTest 71 none | ||
73 | anagram none 7 none 100 -72057594037927936 anagramTest 72 none | ||
74 | anagram none 7 none 100 -72057594037927936 anagramTest 73 none | ||
75 | anagram none 7 none 100 6872211992017990772 anagramTest 74 none | ||
76 | anagram none 7 none 100 8387223540636804214 anagramTest 75 none | ||
77 | anagram none 7 none 100 0 anagramTest 76 none | ||
78 | anagram none 7 none 100 0 anagramTest 77 none | ||
79 | anagram none 7 none 100 0 anagramTest 78 none | ||
80 | anagram none 7 none 100 0 anagramTest 79 none | ||
81 | anagram none 7 none 100 0 anagramTest 80 none | ||
82 | anagram none 7 none 100 0 anagramTest 81 none | ||
83 | anagram none 7 none 100 1 anagramTest 82 none | ||
84 | anagram none 7 none 100 0 anagramTest 83 none | ||
85 | anagram none 7 none 100 1 anagramTest 84 none | ||
86 | anagram none 7 none 100 140332643725672 anagramTest 85 none | ||
87 | anagram none 7 none 100 0 anagramTest 86 none | ||
88 | anagram none 7 none 100 140332643727104 anagramTest 87 none | ||
89 | anagram none 7 none 100 10 anagramTest 88 none | ||
90 | anagram none 7 none 100 -1 anagramTest 89 none | ||
91 | anagram none 7 none 100 85603611 anagramTest 90 none | ||
92 | anagram none 7 none 100 140726366778684 anagramTest 91 none | ||
93 | anagram none 7 none 100 140726366773128 anagramTest 92 none | ||
94 | anagram none 7 none 100 140726366772560 anagramTest 93 none | ||
95 | anagram none 7 none 100 140726366772816 anagramTest 94 none | ||
96 | anagram none 7 none 100 4196240 anagramTest 95 none | ||
97 | anagram none 7 none 100 140726366773040 anagramTest 96 none | ||
98 | anagram none 7 none 100 0 anagramTest 97 none | ||
99 | anagram none 7 none 100 0 anagramTest 98 none | ||
100 | anagram none 7 none 100 140332637720208 anagramTest 99 none | ||
diff --git a/all_pairs/source/anagram/anagram_compare.h b/all_pairs/source/anagram/anagram_compare.h new file mode 100644 index 0000000..31e869a --- /dev/null +++ b/all_pairs/source/anagram/anagram_compare.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | |||
3 | This header is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_compare.h | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This header contains the comparison functions used by anagram. | ||
11 | |||
12 | Source: unknown | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #ifndef ANAGRAM_COMPARE_H | ||
23 | #define ANAGRAM_COMPARE_H | ||
24 | |||
25 | int anagram_CompareFrequency( char *pch1, char *pch2 ); | ||
26 | |||
27 | #endif | ||
diff --git a/all_pairs/source/anagram/anagram_ctype.h b/all_pairs/source/anagram/anagram_ctype.h new file mode 100644 index 0000000..ebb8232 --- /dev/null +++ b/all_pairs/source/anagram/anagram_ctype.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | |||
3 | This header is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_ctype.h | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This header contains some C library functions used by anagram. | ||
11 | |||
12 | Source: unknown | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #ifndef ANAGRAM_CTYPE_H | ||
23 | #define ANAGRAM_CTYPE_H | ||
24 | |||
25 | int anagram_islower( int c ) | ||
26 | { | ||
27 | return 'a' <= c && c <= 'z'; | ||
28 | } | ||
29 | |||
30 | int anagram_isupper( int c ) | ||
31 | { | ||
32 | return 'A' <= c && c <= 'Z'; | ||
33 | } | ||
34 | |||
35 | int anagram_isalpha( int c ) | ||
36 | { | ||
37 | return anagram_isupper( c ) || anagram_islower( c ); | ||
38 | } | ||
39 | |||
40 | int anagram_tolower( int c ) | ||
41 | { | ||
42 | return anagram_isupper( c ) ? c + ( 'a' - 'A' ) : c; | ||
43 | } | ||
44 | |||
45 | #endif | ||
diff --git a/all_pairs/source/anagram/anagram_input.c b/all_pairs/source/anagram/anagram_input.c new file mode 100644 index 0000000..e3d5f71 --- /dev/null +++ b/all_pairs/source/anagram/anagram_input.c | |||
@@ -0,0 +1,2317 @@ | |||
1 | /* | ||
2 | |||
3 | This file is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_input.c | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This file contains the input data used by anagram. | ||
11 | |||
12 | Source: anagram | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | /* | ||
23 | Forward declaration of global variables | ||
24 | */ | ||
25 | |||
26 | extern char const *anagram_achPhrase[ 3 ]; | ||
27 | extern char const *anagram_dictionary[ 2279 ]; | ||
28 | |||
29 | |||
30 | /* | ||
31 | Definition of global variables | ||
32 | */ | ||
33 | char const *anagram_achPhrase[ 3 ] = { "todd austin", | ||
34 | "john alledy", | ||
35 | "mary updike" | ||
36 | }; | ||
37 | |||
38 | char const *anagram_dictionary[ 2279 ] = { "2nd", | ||
39 | "4th", | ||
40 | "8th", | ||
41 | "a", | ||
42 | "ABA", | ||
43 | "aback", | ||
44 | "abash", | ||
45 | "abbas", | ||
46 | "abbey", | ||
47 | "abed", | ||
48 | "abet", | ||
49 | "abort", | ||
50 | "abut", | ||
51 | "Accra", | ||
52 | "ACM", | ||
53 | "acorn", | ||
54 | "Acts", | ||
55 | "Ada", | ||
56 | "adapt", | ||
57 | "added", | ||
58 | "addle", | ||
59 | "Adele", | ||
60 | "Aden", | ||
61 | "admix", | ||
62 | "adore", | ||
63 | "adult", | ||
64 | "affix", | ||
65 | "afire", | ||
66 | "aft", | ||
67 | "agate", | ||
68 | "agave", | ||
69 | "Agee", | ||
70 | "agent", | ||
71 | "agile", | ||
72 | "Agnew", | ||
73 | "agone", | ||
74 | "ahoy", | ||
75 | "Aida", | ||
76 | "aim", | ||
77 | "Ainu", | ||
78 | "airy", | ||
79 | "Ajax", | ||
80 | "Alamo", | ||
81 | "alarm", | ||
82 | "alb", | ||
83 | "Alcoa", | ||
84 | "alder", | ||
85 | "Aleck", | ||
86 | "alert", | ||
87 | "algae", | ||
88 | "alia", | ||
89 | "alike", | ||
90 | "alive", | ||
91 | "allay", | ||
92 | "alley", | ||
93 | "Allis", | ||
94 | "allow", | ||
95 | "ally", | ||
96 | "Allyn", | ||
97 | "aloe", | ||
98 | "aloha", | ||
99 | "along", | ||
100 | "aloud", | ||
101 | "also", | ||
102 | "alter", | ||
103 | "Alton", | ||
104 | "Alva", | ||
105 | "amaze", | ||
106 | "amber", | ||
107 | "ami", | ||
108 | "amigo", | ||
109 | "amiss", | ||
110 | "Amman", | ||
111 | "Amoco", | ||
112 | "amok", | ||
113 | "Amos", | ||
114 | "ample", | ||
115 | "amra", | ||
116 | "amy", | ||
117 | "Andes", | ||
118 | "angel", | ||
119 | "Angie", | ||
120 | "angry", | ||
121 | "Angus", | ||
122 | "Anne", | ||
123 | "annex", | ||
124 | "annoy", | ||
125 | "annul", | ||
126 | "ante", | ||
127 | "any", | ||
128 | "apex", | ||
129 | "apple", | ||
130 | "apron", | ||
131 | "apt", | ||
132 | "arch", | ||
133 | "argue", | ||
134 | "Aries", | ||
135 | "arm", | ||
136 | "army", | ||
137 | "aroma", | ||
138 | "array", | ||
139 | "arrow", | ||
140 | "Artie", | ||
141 | "arty", | ||
142 | "arum", | ||
143 | "a's", | ||
144 | "ash", | ||
145 | "ashen", | ||
146 | "ashy", | ||
147 | "askew", | ||
148 | "assai", | ||
149 | "Assam", | ||
150 | "Astor", | ||
151 | "ate", | ||
152 | "atlas", | ||
153 | "atone", | ||
154 | "audit", | ||
155 | "Aug", | ||
156 | "augur", | ||
157 | "auk", | ||
158 | "aural", | ||
159 | "avid", | ||
160 | "avoid", | ||
161 | "avow", | ||
162 | "awash", | ||
163 | "awe", | ||
164 | "awn", | ||
165 | "awry", | ||
166 | "axe", | ||
167 | "axial", | ||
168 | "axis", | ||
169 | "axon", | ||
170 | "Ayers", | ||
171 | "Aztec", | ||
172 | "b", | ||
173 | "babe", | ||
174 | "Bach", | ||
175 | "bad", | ||
176 | "bait", | ||
177 | "baldy", | ||
178 | "balm", | ||
179 | "balsa", | ||
180 | "bam", | ||
181 | "ban", | ||
182 | "bane", | ||
183 | "banjo", | ||
184 | "barb", | ||
185 | "barn", | ||
186 | "baron", | ||
187 | "basal", | ||
188 | "Basel", | ||
189 | "basil", | ||
190 | "bassi", | ||
191 | "baste", | ||
192 | "batch", | ||
193 | "Bates", | ||
194 | "batik", | ||
195 | "Bator", | ||
196 | "bawd", | ||
197 | "bay", | ||
198 | "bayed", | ||
199 | "bayou", | ||
200 | "be", | ||
201 | "beak", | ||
202 | "bean", | ||
203 | "beard", | ||
204 | "beat", | ||
205 | "beck", | ||
206 | "Becky", | ||
207 | "bed", | ||
208 | "bedim", | ||
209 | "bee", | ||
210 | "beech", | ||
211 | "beep", | ||
212 | "beet", | ||
213 | "befit", | ||
214 | "beg", | ||
215 | "begin", | ||
216 | "beige", | ||
217 | "Bela", | ||
218 | "belch", | ||
219 | "belt", | ||
220 | "beman", | ||
221 | "bench", | ||
222 | "Benny", | ||
223 | "bent", | ||
224 | "Benz", | ||
225 | "berth", | ||
226 | "beset", | ||
227 | "bet", | ||
228 | "betel", | ||
229 | "Bette", | ||
230 | "bevy", | ||
231 | "Bible", | ||
232 | "bide", | ||
233 | "big", | ||
234 | "bile", | ||
235 | "bilk", | ||
236 | "binge", | ||
237 | "bit", | ||
238 | "bite", | ||
239 | "black", | ||
240 | "blanc", | ||
241 | "bland", | ||
242 | "blare", | ||
243 | "blat", | ||
244 | "blaze", | ||
245 | "bled", | ||
246 | "blest", | ||
247 | "blind", | ||
248 | "Blinn", | ||
249 | "bliss", | ||
250 | "blitz", | ||
251 | "blob", | ||
252 | "blond", | ||
253 | "blood", | ||
254 | "bloom", | ||
255 | "blot", | ||
256 | "blown", | ||
257 | "blue", | ||
258 | "bluff", | ||
259 | "Blum", | ||
260 | "blur", | ||
261 | "board", | ||
262 | "boat", | ||
263 | "bock", | ||
264 | "bog", | ||
265 | "bogy", | ||
266 | "boil", | ||
267 | "Boise", | ||
268 | "bomb", | ||
269 | "bon", | ||
270 | "bong", | ||
271 | "bonus", | ||
272 | "bonze", | ||
273 | "booby", | ||
274 | "book", | ||
275 | "booky", | ||
276 | "boon", | ||
277 | "booze", | ||
278 | "bore", | ||
279 | "Boris", | ||
280 | "boron", | ||
281 | "Bosch", | ||
282 | "bosom", | ||
283 | "bound", | ||
284 | "bourn", | ||
285 | "bowel", | ||
286 | "boy", | ||
287 | "Boyce", | ||
288 | "bract", | ||
289 | "Brady", | ||
290 | "brag", | ||
291 | "brake", | ||
292 | "brant", | ||
293 | "brass", | ||
294 | "Braun", | ||
295 | "bravo", | ||
296 | "bread", | ||
297 | "bream", | ||
298 | "breve", | ||
299 | "brew", | ||
300 | "briar", | ||
301 | "Brice", | ||
302 | "brief", | ||
303 | "bring", | ||
304 | "briny", | ||
305 | "broad", | ||
306 | "broth", | ||
307 | "brunt", | ||
308 | "BSTJ", | ||
309 | "bub", | ||
310 | "buck", | ||
311 | "Budd", | ||
312 | "buddy", | ||
313 | "Buick", | ||
314 | "built", | ||
315 | "bulge", | ||
316 | "bulky", | ||
317 | "bum", | ||
318 | "bump", | ||
319 | "bunch", | ||
320 | "bundy", | ||
321 | "bunk", | ||
322 | "Burch", | ||
323 | "burg", | ||
324 | "burl", | ||
325 | "Burma", | ||
326 | "burnt", | ||
327 | "Burr", | ||
328 | "bury", | ||
329 | "bush", | ||
330 | "bushy", | ||
331 | "bust", | ||
332 | "busy", | ||
333 | "butte", | ||
334 | "butyl", | ||
335 | "buyer", | ||
336 | "by", | ||
337 | "bylaw", | ||
338 | "Byrd", | ||
339 | "byte", | ||
340 | "cab", | ||
341 | "cable", | ||
342 | "cacao", | ||
343 | "cacti", | ||
344 | "Cairo", | ||
345 | "Caleb", | ||
346 | "call", | ||
347 | "calm", | ||
348 | "canal", | ||
349 | "canoe", | ||
350 | "canon", | ||
351 | "can't", | ||
352 | "cap", | ||
353 | "caper", | ||
354 | "capo", | ||
355 | "card", | ||
356 | "Carey", | ||
357 | "Carib", | ||
358 | "Carla", | ||
359 | "carol", | ||
360 | "carve", | ||
361 | "cash", | ||
362 | "caste", | ||
363 | "catch", | ||
364 | "cater", | ||
365 | "caulk", | ||
366 | "cause", | ||
367 | "CBS", | ||
368 | "cedar", | ||
369 | "cent", | ||
370 | "Cetus", | ||
371 | "Chad", | ||
372 | "chaff", | ||
373 | "chair", | ||
374 | "champ", | ||
375 | "char", | ||
376 | "chasm", | ||
377 | "chaw", | ||
378 | "cheat", | ||
379 | "cheer", | ||
380 | "chef", | ||
381 | "Chen", | ||
382 | "chew", | ||
383 | "chick", | ||
384 | "chief", | ||
385 | "Chile", | ||
386 | "chill", | ||
387 | "chine", | ||
388 | "chip", | ||
389 | "chock", | ||
390 | "choir", | ||
391 | "chomp", | ||
392 | "chose", | ||
393 | "Chris", | ||
394 | "chuff", | ||
395 | "chum", | ||
396 | "chump", | ||
397 | "CIA", | ||
398 | "cinch", | ||
399 | "cite", | ||
400 | "city", | ||
401 | "clad", | ||
402 | "clan", | ||
403 | "clank", | ||
404 | "Clara", | ||
405 | "Claus", | ||
406 | "claw", | ||
407 | "clean", | ||
408 | "cleat", | ||
409 | "clerk", | ||
410 | "clime", | ||
411 | "cling", | ||
412 | "clink", | ||
413 | "Clio", | ||
414 | "clod", | ||
415 | "clomp", | ||
416 | "cloth", | ||
417 | "clove", | ||
418 | "cluck", | ||
419 | "clump", | ||
420 | "clung", | ||
421 | "Clyde", | ||
422 | "cobra", | ||
423 | "coco", | ||
424 | "coda", | ||
425 | "Cody", | ||
426 | "Cohn", | ||
427 | "coin", | ||
428 | "col", | ||
429 | "Colby", | ||
430 | "coney", | ||
431 | "Congo", | ||
432 | "cony", | ||
433 | "cool", | ||
434 | "coon", | ||
435 | "copra", | ||
436 | "copy", | ||
437 | "Corey", | ||
438 | "corn", | ||
439 | "corps", | ||
440 | "cos", | ||
441 | "cosy", | ||
442 | "couch", | ||
443 | "cough", | ||
444 | "count", | ||
445 | "coup", | ||
446 | "cove", | ||
447 | "cowry", | ||
448 | "coy", | ||
449 | "CPA", | ||
450 | "crack", | ||
451 | "craft", | ||
452 | "Craig", | ||
453 | "crank", | ||
454 | "crash", | ||
455 | "crate", | ||
456 | "crawl", | ||
457 | "craze", | ||
458 | "creak", | ||
459 | "cream", | ||
460 | "credo", | ||
461 | "creek", | ||
462 | "Creon", | ||
463 | "crept", | ||
464 | "crest", | ||
465 | "crew", | ||
466 | "crib", | ||
467 | "crime", | ||
468 | "crimp", | ||
469 | "crisp", | ||
470 | "crock", | ||
471 | "croft", | ||
472 | "crone", | ||
473 | "crook", | ||
474 | "crowd", | ||
475 | "CRT", | ||
476 | "crumb", | ||
477 | "crump", | ||
478 | "crush", | ||
479 | "crux", | ||
480 | "cub", | ||
481 | "cube", | ||
482 | "cuff", | ||
483 | "cup", | ||
484 | "Cupid", | ||
485 | "cur", | ||
486 | "curb", | ||
487 | "curie", | ||
488 | "cusp", | ||
489 | "cute", | ||
490 | "cycad", | ||
491 | "cynic", | ||
492 | "d", | ||
493 | "daffy", | ||
494 | "dairy", | ||
495 | "daisy", | ||
496 | "dally", | ||
497 | "dame", | ||
498 | "Damon", | ||
499 | "Dan", | ||
500 | "dance", | ||
501 | "Dane", | ||
502 | "dank", | ||
503 | "Dante", | ||
504 | "Dar", | ||
505 | "darn", | ||
506 | "dart", | ||
507 | "dash", | ||
508 | "davit", | ||
509 | "day", | ||
510 | "De", | ||
511 | "deaf", | ||
512 | "deal", | ||
513 | "death", | ||
514 | "debit", | ||
515 | "Dec", | ||
516 | "decal", | ||
517 | "Dee", | ||
518 | "Deere", | ||
519 | "deify", | ||
520 | "deity", | ||
521 | "Della", | ||
522 | "delta", | ||
523 | "demur", | ||
524 | "den", | ||
525 | "Denny", | ||
526 | "dense", | ||
527 | "deny", | ||
528 | "depth", | ||
529 | "desk", | ||
530 | "deus", | ||
531 | "devil", | ||
532 | "dewar", | ||
533 | "Dhabi", | ||
534 | "diary", | ||
535 | "dick", | ||
536 | "dicta", | ||
537 | "did", | ||
538 | "die", | ||
539 | "Diego", | ||
540 | "diety", | ||
541 | "dill", | ||
542 | "din", | ||
543 | "dine", | ||
544 | "dirty", | ||
545 | "disc", | ||
546 | "ditch", | ||
547 | "dive", | ||
548 | "DNA", | ||
549 | "dock", | ||
550 | "Dodd", | ||
551 | "doff", | ||
552 | "dogma", | ||
553 | "dolce", | ||
554 | "doll", | ||
555 | "dolly", | ||
556 | "done", | ||
557 | "door", | ||
558 | "dope", | ||
559 | "Doric", | ||
560 | "dose", | ||
561 | "dote", | ||
562 | "doubt", | ||
563 | "Doug", | ||
564 | "dove", | ||
565 | "dowel", | ||
566 | "doze", | ||
567 | "Dr", | ||
568 | "Draco", | ||
569 | "drama", | ||
570 | "drape", | ||
571 | "drawl", | ||
572 | "dread", | ||
573 | "dreg", | ||
574 | "dress", | ||
575 | "drew", | ||
576 | "drib", | ||
577 | "drier", | ||
578 | "drill", | ||
579 | "drip", | ||
580 | "dross", | ||
581 | "drown", | ||
582 | "druid", | ||
583 | "drunk", | ||
584 | "dry", | ||
585 | "du", | ||
586 | "Duane", | ||
587 | "ducat", | ||
588 | "duct", | ||
589 | "duel", | ||
590 | "duff", | ||
591 | "Duffy", | ||
592 | "Dugan", | ||
593 | "duke", | ||
594 | "dull", | ||
595 | "dulse", | ||
596 | "duly", | ||
597 | "dump", | ||
598 | "dumpy", | ||
599 | "dunce", | ||
600 | "dunk", | ||
601 | "dupe", | ||
602 | "dusky", | ||
603 | "dwarf", | ||
604 | "dwelt", | ||
605 | "Dwyer", | ||
606 | "dyer", | ||
607 | "Dyke", | ||
608 | "dyne", | ||
609 | "each", | ||
610 | "eager", | ||
611 | "ear", | ||
612 | "earn", | ||
613 | "ease", | ||
614 | "eat", | ||
615 | "eater", | ||
616 | "Eben", | ||
617 | "Ecole", | ||
618 | "Eden", | ||
619 | "edge", | ||
620 | "edgy", | ||
621 | "edict", | ||
622 | "Edith", | ||
623 | "EDT", | ||
624 | "eel", | ||
625 | "eft", | ||
626 | "egg", | ||
627 | "Egypt", | ||
628 | "eject", | ||
629 | "el", | ||
630 | "elan", | ||
631 | "elate", | ||
632 | "elect", | ||
633 | "elfin", | ||
634 | "elide", | ||
635 | "elk", | ||
636 | "Ella", | ||
637 | "Ellis", | ||
638 | "Elmer", | ||
639 | "else", | ||
640 | "Elton", | ||
641 | "elude", | ||
642 | "elves", | ||
643 | "ember", | ||
644 | "Emile", | ||
645 | "Emory", | ||
646 | "Eng", | ||
647 | "Engle", | ||
648 | "Enid", | ||
649 | "Enos", | ||
650 | "enter", | ||
651 | "envoy", | ||
652 | "epoxy", | ||
653 | "equal", | ||
654 | "erase", | ||
655 | "ere", | ||
656 | "erg", | ||
657 | "Erich", | ||
658 | "Ernst", | ||
659 | "Eros", | ||
660 | "err", | ||
661 | "Errol", | ||
662 | "Ervin", | ||
663 | "e's", | ||
664 | "essay", | ||
665 | "ester", | ||
666 | "Ethan", | ||
667 | "Ethel", | ||
668 | "ethic", | ||
669 | "ethos", | ||
670 | "etude", | ||
671 | "Eva", | ||
672 | "Evans", | ||
673 | "event", | ||
674 | "evict", | ||
675 | "exact", | ||
676 | "exam", | ||
677 | "excel", | ||
678 | "exit", | ||
679 | "eye", | ||
680 | "f", | ||
681 | "Faber", | ||
682 | "fable", | ||
683 | "facet", | ||
684 | "fad", | ||
685 | "faery", | ||
686 | "fag", | ||
687 | "fail", | ||
688 | "faint", | ||
689 | "fairy", | ||
690 | "fake", | ||
691 | "fang", | ||
692 | "fare", | ||
693 | "faro", | ||
694 | "fatal", | ||
695 | "fatty", | ||
696 | "fault", | ||
697 | "faun", | ||
698 | "Faust", | ||
699 | "fay", | ||
700 | "FBI", | ||
701 | "fee", | ||
702 | "feed", | ||
703 | "feign", | ||
704 | "Felix", | ||
705 | "Fermi", | ||
706 | "ferry", | ||
707 | "fest", | ||
708 | "fetch", | ||
709 | "fetus", | ||
710 | "few", | ||
711 | "fiend", | ||
712 | "fiery", | ||
713 | "fifth", | ||
714 | "fig", | ||
715 | "fight", | ||
716 | "filet", | ||
717 | "film", | ||
718 | "finch", | ||
719 | "fine", | ||
720 | "finny", | ||
721 | "fire", | ||
722 | "first", | ||
723 | "fish", | ||
724 | "Fisk", | ||
725 | "fist", | ||
726 | "Fitch", | ||
727 | "flack", | ||
728 | "flak", | ||
729 | "flaky", | ||
730 | "flame", | ||
731 | "flank", | ||
732 | "flare", | ||
733 | "flat", | ||
734 | "flax", | ||
735 | "flea", | ||
736 | "fled", | ||
737 | "flee", | ||
738 | "fleet", | ||
739 | "flint", | ||
740 | "flit", | ||
741 | "flock", | ||
742 | "flog", | ||
743 | "flow", | ||
744 | "Floyd", | ||
745 | "flub", | ||
746 | "fluke", | ||
747 | "flute", | ||
748 | "Flynn", | ||
749 | "FM", | ||
750 | "foal", | ||
751 | "focal", | ||
752 | "Foley", | ||
753 | "folk", | ||
754 | "fond", | ||
755 | "food", | ||
756 | "foot", | ||
757 | "fop", | ||
758 | "fore", | ||
759 | "forge", | ||
760 | "form", | ||
761 | "fort", | ||
762 | "forth", | ||
763 | "forty", | ||
764 | "Foss", | ||
765 | "foul", | ||
766 | "fowl", | ||
767 | "FPC", | ||
768 | "frame", | ||
769 | "Franz", | ||
770 | "Frau", | ||
771 | "fray", | ||
772 | "freed", | ||
773 | "fresh", | ||
774 | "friar", | ||
775 | "fro", | ||
776 | "frog", | ||
777 | "from", | ||
778 | "frost", | ||
779 | "frown", | ||
780 | "fry", | ||
781 | "fuel", | ||
782 | "full", | ||
783 | "fun", | ||
784 | "fur", | ||
785 | "furry", | ||
786 | "fussy", | ||
787 | "g", | ||
788 | "gaff", | ||
789 | "gag", | ||
790 | "Gail", | ||
791 | "Galen", | ||
792 | "gall", | ||
793 | "game", | ||
794 | "gamma", | ||
795 | "gap", | ||
796 | "gar", | ||
797 | "garb", | ||
798 | "gas", | ||
799 | "gasp", | ||
800 | "gate", | ||
801 | "gauge", | ||
802 | "gaur", | ||
803 | "gavel", | ||
804 | "gawk", | ||
805 | "gay", | ||
806 | "gecko", | ||
807 | "gel", | ||
808 | "gem", | ||
809 | "Gemma", | ||
810 | "gene", | ||
811 | "genie", | ||
812 | "genre", | ||
813 | "genus", | ||
814 | "germ", | ||
815 | "Gerry", | ||
816 | "get", | ||
817 | "giant", | ||
818 | "gibby", | ||
819 | "gig", | ||
820 | "gild", | ||
821 | "gilt", | ||
822 | "gin", | ||
823 | "Gino", | ||
824 | "given", | ||
825 | "glare", | ||
826 | "gleam", | ||
827 | "glee", | ||
828 | "glib", | ||
829 | "glint", | ||
830 | "gloat", | ||
831 | "glow", | ||
832 | "glut", | ||
833 | "GMT", | ||
834 | "gnaw", | ||
835 | "gnome", | ||
836 | "GNP", | ||
837 | "god", | ||
838 | "Goff", | ||
839 | "gogo", | ||
840 | "golf", | ||
841 | "Goode", | ||
842 | "goof", | ||
843 | "goose", | ||
844 | "gore", | ||
845 | "gory", | ||
846 | "got", | ||
847 | "gourd", | ||
848 | "GPO", | ||
849 | "grace", | ||
850 | "Graff", | ||
851 | "grape", | ||
852 | "grasp", | ||
853 | "grate", | ||
854 | "gravy", | ||
855 | "graze", | ||
856 | "grebe", | ||
857 | "greed", | ||
858 | "Greek", | ||
859 | "Gregg", | ||
860 | "grew", | ||
861 | "grid", | ||
862 | "grime", | ||
863 | "Grimm", | ||
864 | "gripe", | ||
865 | "grit", | ||
866 | "groan", | ||
867 | "gross", | ||
868 | "grout", | ||
869 | "grow", | ||
870 | "grown", | ||
871 | "grub", | ||
872 | "grunt", | ||
873 | "GSA", | ||
874 | "guano", | ||
875 | "guess", | ||
876 | "guide", | ||
877 | "guile", | ||
878 | "guise", | ||
879 | "gules", | ||
880 | "gull", | ||
881 | "gulp", | ||
882 | "gumbo", | ||
883 | "gun", | ||
884 | "gunky", | ||
885 | "guru", | ||
886 | "gush", | ||
887 | "gust", | ||
888 | "gusto", | ||
889 | "guy", | ||
890 | "Gwyn", | ||
891 | "gyp", | ||
892 | "gyro", | ||
893 | "Habib", | ||
894 | "hack", | ||
895 | "had", | ||
896 | "Hades", | ||
897 | "Hagen", | ||
898 | "Hahn", | ||
899 | "haiku", | ||
900 | "hale", | ||
901 | "halma", | ||
902 | "ham", | ||
903 | "Haney", | ||
904 | "Hans", | ||
905 | "hard", | ||
906 | "hare", | ||
907 | "hark", | ||
908 | "harm", | ||
909 | "harsh", | ||
910 | "haste", | ||
911 | "hasty", | ||
912 | "hatch", | ||
913 | "hater", | ||
914 | "hawk", | ||
915 | "Haydn", | ||
916 | "hazel", | ||
917 | "he", | ||
918 | "Healy", | ||
919 | "hear", | ||
920 | "heart", | ||
921 | "heave", | ||
922 | "heavy", | ||
923 | "hedge", | ||
924 | "heel", | ||
925 | "hefty", | ||
926 | "Heinz", | ||
927 | "held", | ||
928 | "he'll", | ||
929 | "hemp", | ||
930 | "hertz", | ||
931 | "hew", | ||
932 | "hex", | ||
933 | "hi", | ||
934 | "hick", | ||
935 | "Hicks", | ||
936 | "hike", | ||
937 | "hilum", | ||
938 | "hind", | ||
939 | "hip", | ||
940 | "hippy", | ||
941 | "hire", | ||
942 | "his", | ||
943 | "hive", | ||
944 | "hobby", | ||
945 | "hoc", | ||
946 | "Hoff", | ||
947 | "hogan", | ||
948 | "Hokan", | ||
949 | "hole", | ||
950 | "Holm", | ||
951 | "holt", | ||
952 | "home", | ||
953 | "homo", | ||
954 | "hondo", | ||
955 | "hood", | ||
956 | "hook", | ||
957 | "hoop", | ||
958 | "hoot", | ||
959 | "hope", | ||
960 | "horn", | ||
961 | "hose", | ||
962 | "hot", | ||
963 | "hound", | ||
964 | "hovel", | ||
965 | "how", | ||
966 | "howdy", | ||
967 | "hub", | ||
968 | "hubby", | ||
969 | "hue", | ||
970 | "huff", | ||
971 | "huge", | ||
972 | "huh", | ||
973 | "hull", | ||
974 | "human", | ||
975 | "Hun", | ||
976 | "hung", | ||
977 | "hunk", | ||
978 | "hurt", | ||
979 | "hurty", | ||
980 | "hutch", | ||
981 | "hydra", | ||
982 | "hyena", | ||
983 | "hymen", | ||
984 | "i", | ||
985 | "ibid", | ||
986 | "IBM", | ||
987 | "icon", | ||
988 | "I'd", | ||
989 | "Idaho", | ||
990 | "ideal", | ||
991 | "idiot", | ||
992 | "idol", | ||
993 | "IEEE", | ||
994 | "iffy", | ||
995 | "igloo", | ||
996 | "iii", | ||
997 | "ileum", | ||
998 | "Iliad", | ||
999 | "ill", | ||
1000 | "Ilona", | ||
1001 | "image", | ||
1002 | "in", | ||
1003 | "inapt", | ||
1004 | "Inca", | ||
1005 | "incur", | ||
1006 | "India", | ||
1007 | "inert", | ||
1008 | "infer", | ||
1009 | "infra", | ||
1010 | "Inman", | ||
1011 | "inn", | ||
1012 | "input", | ||
1013 | "ionic", | ||
1014 | "Iowa", | ||
1015 | "ipso", | ||
1016 | "IR", | ||
1017 | "Iran", | ||
1018 | "irate", | ||
1019 | "Irene", | ||
1020 | "Irish", | ||
1021 | "Irma", | ||
1022 | "is", | ||
1023 | "Ising", | ||
1024 | "Islam", | ||
1025 | "isle", | ||
1026 | "Italy", | ||
1027 | "it'd", | ||
1028 | "Ito", | ||
1029 | "iv", | ||
1030 | "ivy", | ||
1031 | "j", | ||
1032 | "JACM", | ||
1033 | "jag", | ||
1034 | "James", | ||
1035 | "Jane", | ||
1036 | "Janos", | ||
1037 | "Japan", | ||
1038 | "Jason", | ||
1039 | "jaw", | ||
1040 | "jean", | ||
1041 | "jeep", | ||
1042 | "Jeres", | ||
1043 | "jerky", | ||
1044 | "jess", | ||
1045 | "jet", | ||
1046 | "jewel", | ||
1047 | "jig", | ||
1048 | "jilt", | ||
1049 | "Jo", | ||
1050 | "job", | ||
1051 | "jog", | ||
1052 | "join", | ||
1053 | "joke", | ||
1054 | "jolt", | ||
1055 | "Jonas", | ||
1056 | "joule", | ||
1057 | "joust", | ||
1058 | "joy", | ||
1059 | "Juan", | ||
1060 | "judge", | ||
1061 | "judo", | ||
1062 | "Judy", | ||
1063 | "juju", | ||
1064 | "juke", | ||
1065 | "julep", | ||
1066 | "jump", | ||
1067 | "junco", | ||
1068 | "junky", | ||
1069 | "junta", | ||
1070 | "jure", | ||
1071 | "jut", | ||
1072 | "Kafka", | ||
1073 | "kapok", | ||
1074 | "Karp", | ||
1075 | "Kathy", | ||
1076 | "Kay", | ||
1077 | "Keats", | ||
1078 | "keel", | ||
1079 | "keg", | ||
1080 | "kelly", | ||
1081 | "Kemp", | ||
1082 | "Kent", | ||
1083 | "Kenya", | ||
1084 | "kerry", | ||
1085 | "Kevin", | ||
1086 | "keyed", | ||
1087 | "khaki", | ||
1088 | "Khmer", | ||
1089 | "kick", | ||
1090 | "Kiev", | ||
1091 | "kin", | ||
1092 | "Kiowa", | ||
1093 | "kirk", | ||
1094 | "kiss", | ||
1095 | "kite", | ||
1096 | "kiva", | ||
1097 | "Klan", | ||
1098 | "Kline", | ||
1099 | "knee", | ||
1100 | "Knott", | ||
1101 | "Knox", | ||
1102 | "koala", | ||
1103 | "Kong", | ||
1104 | "Korea", | ||
1105 | "kraft", | ||
1106 | "kraut", | ||
1107 | "Kuhn", | ||
1108 | "Kurd", | ||
1109 | "lac", | ||
1110 | "lack", | ||
1111 | "lad", | ||
1112 | "ladle", | ||
1113 | "lag", | ||
1114 | "lain", | ||
1115 | "laity", | ||
1116 | "lam", | ||
1117 | "lame", | ||
1118 | "lamp", | ||
1119 | "lance", | ||
1120 | "lane", | ||
1121 | "Lange", | ||
1122 | "Laos", | ||
1123 | "lapel", | ||
1124 | "lard", | ||
1125 | "Lares", | ||
1126 | "Lars", | ||
1127 | "last", | ||
1128 | "late", | ||
1129 | "Latin", | ||
1130 | "latus", | ||
1131 | "law", | ||
1132 | "lay", | ||
1133 | "layup", | ||
1134 | "lazy", | ||
1135 | "leach", | ||
1136 | "leafy", | ||
1137 | "leak", | ||
1138 | "leapt", | ||
1139 | "learn", | ||
1140 | "leash", | ||
1141 | "leave", | ||
1142 | "ledge", | ||
1143 | "leech", | ||
1144 | "left", | ||
1145 | "leg", | ||
1146 | "leggy", | ||
1147 | "Leila", | ||
1148 | "lemma", | ||
1149 | "Lena", | ||
1150 | "lens", | ||
1151 | "Leo", | ||
1152 | "Leona", | ||
1153 | "lest", | ||
1154 | "level", | ||
1155 | "levy", | ||
1156 | "lewd", | ||
1157 | "liar", | ||
1158 | "lice", | ||
1159 | "lick", | ||
1160 | "lie", | ||
1161 | "lien", | ||
1162 | "life", | ||
1163 | "lift", | ||
1164 | "liken", | ||
1165 | "lilac", | ||
1166 | "Lilly", | ||
1167 | "lily", | ||
1168 | "limb", | ||
1169 | "limit", | ||
1170 | "line", | ||
1171 | "lingo", | ||
1172 | "link", | ||
1173 | "Linus", | ||
1174 | "Lise", | ||
1175 | "lisp", | ||
1176 | "live", | ||
1177 | "livre", | ||
1178 | "load", | ||
1179 | "loam", | ||
1180 | "loan", | ||
1181 | "lob", | ||
1182 | "lobby", | ||
1183 | "local", | ||
1184 | "lock", | ||
1185 | "Loeb", | ||
1186 | "Logan", | ||
1187 | "logic", | ||
1188 | "loin", | ||
1189 | "Loki", | ||
1190 | "loll", | ||
1191 | "Lomb", | ||
1192 | "long", | ||
1193 | "loon", | ||
1194 | "loose", | ||
1195 | "loot", | ||
1196 | "lope", | ||
1197 | "lord", | ||
1198 | "Loren", | ||
1199 | "lose", | ||
1200 | "lossy", | ||
1201 | "Lotte", | ||
1202 | "loud", | ||
1203 | "lousy", | ||
1204 | "low", | ||
1205 | "Lowe", | ||
1206 | "loy", | ||
1207 | "l's", | ||
1208 | "LTV", | ||
1209 | "Lucas", | ||
1210 | "lucky", | ||
1211 | "luge", | ||
1212 | "Luis", | ||
1213 | "lumen", | ||
1214 | "lumpy", | ||
1215 | "lunar", | ||
1216 | "Lund", | ||
1217 | "Lura", | ||
1218 | "lure", | ||
1219 | "lurk", | ||
1220 | "lusty", | ||
1221 | "Lydia", | ||
1222 | "lying", | ||
1223 | "Lynn", | ||
1224 | "Lyon", | ||
1225 | "Lyra", | ||
1226 | "m", | ||
1227 | "Mabel", | ||
1228 | "mace", | ||
1229 | "macho", | ||
1230 | "macro", | ||
1231 | "madam", | ||
1232 | "magi", | ||
1233 | "magna", | ||
1234 | "mail", | ||
1235 | "main", | ||
1236 | "make", | ||
1237 | "Malay", | ||
1238 | "male", | ||
1239 | "mall", | ||
1240 | "malt", | ||
1241 | "mamma", | ||
1242 | "mane", | ||
1243 | "mania", | ||
1244 | "manic", | ||
1245 | "manna", | ||
1246 | "Mans", | ||
1247 | "Mao", | ||
1248 | "map", | ||
1249 | "mar", | ||
1250 | "Mardi", | ||
1251 | "maria", | ||
1252 | "Marin", | ||
1253 | "Mario", | ||
1254 | "Mars", | ||
1255 | "Mary", | ||
1256 | "mask", | ||
1257 | "mast", | ||
1258 | "mat", | ||
1259 | "mate", | ||
1260 | "mater", | ||
1261 | "matte", | ||
1262 | "maul", | ||
1263 | "Mavis", | ||
1264 | "maxim", | ||
1265 | "Maya", | ||
1266 | "Mayer", | ||
1267 | "Mayo", | ||
1268 | "mayst", | ||
1269 | "maze", | ||
1270 | "me", | ||
1271 | "meal", | ||
1272 | "meaty", | ||
1273 | "media", | ||
1274 | "meet", | ||
1275 | "meld", | ||
1276 | "melt", | ||
1277 | "men", | ||
1278 | "Menlo", | ||
1279 | "merge", | ||
1280 | "Merle", | ||
1281 | "merry", | ||
1282 | "mesh", | ||
1283 | "messy", | ||
1284 | "metro", | ||
1285 | "mew", | ||
1286 | "Meyer", | ||
1287 | "mezzo", | ||
1288 | "mica", | ||
1289 | "midst", | ||
1290 | "mien", | ||
1291 | "mig", | ||
1292 | "mila", | ||
1293 | "milk", | ||
1294 | "Mills", | ||
1295 | "milt", | ||
1296 | "Mimi", | ||
1297 | "mince", | ||
1298 | "mine", | ||
1299 | "mini", | ||
1300 | "mink", | ||
1301 | "minor", | ||
1302 | "minot", | ||
1303 | "minus", | ||
1304 | "Mira", | ||
1305 | "mire", | ||
1306 | "mirth", | ||
1307 | "Missy", | ||
1308 | "misty", | ||
1309 | "mite", | ||
1310 | "mitre", | ||
1311 | "mixup", | ||
1312 | "mob", | ||
1313 | "Mobil", | ||
1314 | "mock", | ||
1315 | "model", | ||
1316 | "Moen", | ||
1317 | "Mohr", | ||
1318 | "moist", | ||
1319 | "molar", | ||
1320 | "mole", | ||
1321 | "month", | ||
1322 | "moody", | ||
1323 | "Moore", | ||
1324 | "moral", | ||
1325 | "Moran", | ||
1326 | "morn", | ||
1327 | "Moser", | ||
1328 | "moss", | ||
1329 | "most", | ||
1330 | "motel", | ||
1331 | "moth", | ||
1332 | "motif", | ||
1333 | "motor", | ||
1334 | "motto", | ||
1335 | "mousy", | ||
1336 | "Moyer", | ||
1337 | "Mrs", | ||
1338 | "m's", | ||
1339 | "mud", | ||
1340 | "muggy", | ||
1341 | "Muir", | ||
1342 | "mulch", | ||
1343 | "mule", | ||
1344 | "mull", | ||
1345 | "mum", | ||
1346 | "mummy", | ||
1347 | "muon", | ||
1348 | "mural", | ||
1349 | "murre", | ||
1350 | "mushy", | ||
1351 | "musk", | ||
1352 | "must", | ||
1353 | "Muzo", | ||
1354 | "my", | ||
1355 | "Myers", | ||
1356 | "mynah", | ||
1357 | "Myra", | ||
1358 | "NAACP", | ||
1359 | "Nagy", | ||
1360 | "naive", | ||
1361 | "name", | ||
1362 | "Nancy", | ||
1363 | "nap", | ||
1364 | "nary", | ||
1365 | "nasal", | ||
1366 | "natal", | ||
1367 | "NATO", | ||
1368 | "navy", | ||
1369 | "Nazi", | ||
1370 | "NBC", | ||
1371 | "NCR", | ||
1372 | "ne", | ||
1373 | "near", | ||
1374 | "neath", | ||
1375 | "Ned", | ||
1376 | "need", | ||
1377 | "needy", | ||
1378 | "Nehru", | ||
1379 | "Nell", | ||
1380 | "neon", | ||
1381 | "Nero", | ||
1382 | "net", | ||
1383 | "Neva", | ||
1384 | "neve", | ||
1385 | "new", | ||
1386 | "nice", | ||
1387 | "niche", | ||
1388 | "Niger", | ||
1389 | "night", | ||
1390 | "Nikko", | ||
1391 | "Nile", | ||
1392 | "Niobe", | ||
1393 | "nitty", | ||
1394 | "NJ", | ||
1395 | "no", | ||
1396 | "Noah", | ||
1397 | "Nobel", | ||
1398 | "nodal", | ||
1399 | "noise", | ||
1400 | "Nolan", | ||
1401 | "nolo", | ||
1402 | "noon", | ||
1403 | "nor", | ||
1404 | "nose", | ||
1405 | "notch", | ||
1406 | "Nov", | ||
1407 | "now", | ||
1408 | "n's", | ||
1409 | "NTIS", | ||
1410 | "nude", | ||
1411 | "numb", | ||
1412 | "nurse", | ||
1413 | "NY", | ||
1414 | "oaf", | ||
1415 | "oaken", | ||
1416 | "oar", | ||
1417 | "oasis", | ||
1418 | "oath", | ||
1419 | "obey", | ||
1420 | "objet", | ||
1421 | "ocean", | ||
1422 | "Oct", | ||
1423 | "ode", | ||
1424 | "o'er", | ||
1425 | "off", | ||
1426 | "often", | ||
1427 | "ogle", | ||
1428 | "Okay", | ||
1429 | "old", | ||
1430 | "oldy", | ||
1431 | "olive", | ||
1432 | "Olson", | ||
1433 | "omit", | ||
1434 | "once", | ||
1435 | "only", | ||
1436 | "onset", | ||
1437 | "onus", | ||
1438 | "onyx", | ||
1439 | "ooze", | ||
1440 | "opera", | ||
1441 | "opium", | ||
1442 | "opt", | ||
1443 | "opus", | ||
1444 | "orb", | ||
1445 | "Orin", | ||
1446 | "Orion", | ||
1447 | "osier", | ||
1448 | "ought", | ||
1449 | "our", | ||
1450 | "out", | ||
1451 | "ovate", | ||
1452 | "over", | ||
1453 | "Ovid", | ||
1454 | "owing", | ||
1455 | "ox", | ||
1456 | "oxeye", | ||
1457 | "oxide", | ||
1458 | "Ozark", | ||
1459 | "p", | ||
1460 | "Pablo", | ||
1461 | "pace", | ||
1462 | "pack", | ||
1463 | "pact", | ||
1464 | "padre", | ||
1465 | "pagan", | ||
1466 | "Paine", | ||
1467 | "pale", | ||
1468 | "palm", | ||
1469 | "pane", | ||
1470 | "pansy", | ||
1471 | "Paoli", | ||
1472 | "papa", | ||
1473 | "papaw", | ||
1474 | "pappy", | ||
1475 | "parch", | ||
1476 | "pare", | ||
1477 | "Paris", | ||
1478 | "park", | ||
1479 | "Parks", | ||
1480 | "parse", | ||
1481 | "Paso", | ||
1482 | "passe", | ||
1483 | "past", | ||
1484 | "path", | ||
1485 | "Patsy", | ||
1486 | "Paul", | ||
1487 | "Pauli", | ||
1488 | "pax", | ||
1489 | "PBS", | ||
1490 | "peace", | ||
1491 | "peak", | ||
1492 | "Pease", | ||
1493 | "peck", | ||
1494 | "pedal", | ||
1495 | "pee", | ||
1496 | "peek", | ||
1497 | "peep", | ||
1498 | "pen", | ||
1499 | "penny", | ||
1500 | "pep", | ||
1501 | "Pepsi", | ||
1502 | "Perez", | ||
1503 | "perk", | ||
1504 | "Perle", | ||
1505 | "Perth", | ||
1506 | "peste", | ||
1507 | "Pete", | ||
1508 | "petri", | ||
1509 | "petty", | ||
1510 | "pewee", | ||
1511 | "PhD", | ||
1512 | "phi", | ||
1513 | "phon", | ||
1514 | "phony", | ||
1515 | "phyla", | ||
1516 | "piano", | ||
1517 | "piece", | ||
1518 | "pilot", | ||
1519 | "pinch", | ||
1520 | "ping", | ||
1521 | "pink", | ||
1522 | "pinto", | ||
1523 | "pious", | ||
1524 | "pipe", | ||
1525 | "pique", | ||
1526 | "piss", | ||
1527 | "pithy", | ||
1528 | "pity", | ||
1529 | "pixy", | ||
1530 | "place", | ||
1531 | "plain", | ||
1532 | "plane", | ||
1533 | "plate", | ||
1534 | "Plato", | ||
1535 | "play", | ||
1536 | "plaza", | ||
1537 | "plead", | ||
1538 | "pluck", | ||
1539 | "plug", | ||
1540 | "plump", | ||
1541 | "plunk", | ||
1542 | "plus", | ||
1543 | "pod", | ||
1544 | "podia", | ||
1545 | "Poe", | ||
1546 | "poesy", | ||
1547 | "pogo", | ||
1548 | "poi", | ||
1549 | "poise", | ||
1550 | "poke", | ||
1551 | "polis", | ||
1552 | "Polk", | ||
1553 | "poll", | ||
1554 | "polo", | ||
1555 | "Ponce", | ||
1556 | "pond", | ||
1557 | "pool", | ||
1558 | "poop", | ||
1559 | "pop", | ||
1560 | "porch", | ||
1561 | "pork", | ||
1562 | "Porte", | ||
1563 | "Porto", | ||
1564 | "posh", | ||
1565 | "posse", | ||
1566 | "post", | ||
1567 | "pour", | ||
1568 | "pow", | ||
1569 | "Prado", | ||
1570 | "Pratt", | ||
1571 | "pray", | ||
1572 | "press", | ||
1573 | "prey", | ||
1574 | "price", | ||
1575 | "pride", | ||
1576 | "prig", | ||
1577 | "prime", | ||
1578 | "prior", | ||
1579 | "probe", | ||
1580 | "Prof", | ||
1581 | "prone", | ||
1582 | "p's", | ||
1583 | "psych", | ||
1584 | "pub", | ||
1585 | "puck", | ||
1586 | "puffy", | ||
1587 | "Pugh", | ||
1588 | "pull", | ||
1589 | "puma", | ||
1590 | "pun", | ||
1591 | "punky", | ||
1592 | "puny", | ||
1593 | "pupal", | ||
1594 | "puppy", | ||
1595 | "pure", | ||
1596 | "purl", | ||
1597 | "pus", | ||
1598 | "PVC", | ||
1599 | "Pyle", | ||
1600 | "Pyrex", | ||
1601 | "Qatar", | ||
1602 | "quack", | ||
1603 | "quaff", | ||
1604 | "quash", | ||
1605 | "queen", | ||
1606 | "quell", | ||
1607 | "query", | ||
1608 | "queue", | ||
1609 | "quick", | ||
1610 | "quill", | ||
1611 | "quint", | ||
1612 | "quirt", | ||
1613 | "quo", | ||
1614 | "quote", | ||
1615 | "rabat", | ||
1616 | "rabbi", | ||
1617 | "radar", | ||
1618 | "radio", | ||
1619 | "radix", | ||
1620 | "Rae", | ||
1621 | "rag", | ||
1622 | "rail", | ||
1623 | "rajah", | ||
1624 | "Ralph", | ||
1625 | "Ramo", | ||
1626 | "ran", | ||
1627 | "Rand", | ||
1628 | "randy", | ||
1629 | "Raoul", | ||
1630 | "rape", | ||
1631 | "rare", | ||
1632 | "rasp", | ||
1633 | "rata", | ||
1634 | "rater", | ||
1635 | "rave", | ||
1636 | "raven", | ||
1637 | "razor", | ||
1638 | "R&D", | ||
1639 | "reach", | ||
1640 | "ready", | ||
1641 | "real", | ||
1642 | "reb", | ||
1643 | "reck", | ||
1644 | "reedy", | ||
1645 | "reek", | ||
1646 | "Reese", | ||
1647 | "regal", | ||
1648 | "Reid", | ||
1649 | "relax", | ||
1650 | "reman", | ||
1651 | "Rena", | ||
1652 | "rend", | ||
1653 | "ret", | ||
1654 | "retch", | ||
1655 | "Rhea", | ||
1656 | "rheum", | ||
1657 | "rhino", | ||
1658 | "Rhoda", | ||
1659 | "rib", | ||
1660 | "rice", | ||
1661 | "rick", | ||
1662 | "rid", | ||
1663 | "rifle", | ||
1664 | "rig", | ||
1665 | "rigid", | ||
1666 | "rill", | ||
1667 | "rim", | ||
1668 | "rimy", | ||
1669 | "rink", | ||
1670 | "Rio", | ||
1671 | "rip", | ||
1672 | "ripen", | ||
1673 | "rise", | ||
1674 | "risk", | ||
1675 | "rite", | ||
1676 | "rival", | ||
1677 | "river", | ||
1678 | "road", | ||
1679 | "roar", | ||
1680 | "rob", | ||
1681 | "robe", | ||
1682 | "robin", | ||
1683 | "rodeo", | ||
1684 | "roe", | ||
1685 | "roil", | ||
1686 | "role", | ||
1687 | "Roman", | ||
1688 | "Rome", | ||
1689 | "romp", | ||
1690 | "roof", | ||
1691 | "room", | ||
1692 | "roost", | ||
1693 | "Rosen", | ||
1694 | "rot", | ||
1695 | "rouge", | ||
1696 | "round", | ||
1697 | "rout", | ||
1698 | "rove", | ||
1699 | "Roy", | ||
1700 | "Royce", | ||
1701 | "r's", | ||
1702 | "Ruben", | ||
1703 | "ruby", | ||
1704 | "rude", | ||
1705 | "Rudy", | ||
1706 | "rug", | ||
1707 | "rule", | ||
1708 | "rummy", | ||
1709 | "run", | ||
1710 | "rung", | ||
1711 | "runt", | ||
1712 | "rupee", | ||
1713 | "ruse", | ||
1714 | "rusk", | ||
1715 | "Russo", | ||
1716 | "rusty", | ||
1717 | "Ruth", | ||
1718 | "rutty", | ||
1719 | "Ryan", | ||
1720 | "rye", | ||
1721 | "sa", | ||
1722 | "sabra", | ||
1723 | "sad", | ||
1724 | "sag", | ||
1725 | "sage", | ||
1726 | "sake", | ||
1727 | "sale", | ||
1728 | "Salk", | ||
1729 | "salty", | ||
1730 | "salve", | ||
1731 | "Sam", | ||
1732 | "same", | ||
1733 | "Samoa", | ||
1734 | "sane", | ||
1735 | "sank", | ||
1736 | "Santa", | ||
1737 | "Sao", | ||
1738 | "sappy", | ||
1739 | "Sarah", | ||
1740 | "sari", | ||
1741 | "satyr", | ||
1742 | "Saudi", | ||
1743 | "Sault", | ||
1744 | "save", | ||
1745 | "savvy", | ||
1746 | "SC", | ||
1747 | "scald", | ||
1748 | "scalp", | ||
1749 | "scarf", | ||
1750 | "scat", | ||
1751 | "SCM", | ||
1752 | "scold", | ||
1753 | "scoot", | ||
1754 | "Scot", | ||
1755 | "scram", | ||
1756 | "scrub", | ||
1757 | "scud", | ||
1758 | "scull", | ||
1759 | "scum", | ||
1760 | "SD", | ||
1761 | "seal", | ||
1762 | "seamy", | ||
1763 | "sect", | ||
1764 | "sedge", | ||
1765 | "seedy", | ||
1766 | "seen", | ||
1767 | "seize", | ||
1768 | "semi", | ||
1769 | "sepal", | ||
1770 | "Sepoy", | ||
1771 | "septa", | ||
1772 | "serge", | ||
1773 | "serif", | ||
1774 | "servo", | ||
1775 | "set", | ||
1776 | "Seton", | ||
1777 | "setup", | ||
1778 | "sewn", | ||
1779 | "shad", | ||
1780 | "shag", | ||
1781 | "shah", | ||
1782 | "shaky", | ||
1783 | "shall", | ||
1784 | "shank", | ||
1785 | "shard", | ||
1786 | "Shari", | ||
1787 | "shaw", | ||
1788 | "Shea", | ||
1789 | "shed", | ||
1790 | "sheer", | ||
1791 | "shied", | ||
1792 | "shift", | ||
1793 | "shill", | ||
1794 | "shin", | ||
1795 | "shirk", | ||
1796 | "shish", | ||
1797 | "shoo", | ||
1798 | "shore", | ||
1799 | "shout", | ||
1800 | "shrew", | ||
1801 | "shrub", | ||
1802 | "shunt", | ||
1803 | "SIAM", | ||
1804 | "sib", | ||
1805 | "sibyl", | ||
1806 | "side", | ||
1807 | "sigh", | ||
1808 | "sigma", | ||
1809 | "silk", | ||
1810 | "silly", | ||
1811 | "silt", | ||
1812 | "Simon", | ||
1813 | "since", | ||
1814 | "sinew", | ||
1815 | "singe", | ||
1816 | "sinh", | ||
1817 | "Sioux", | ||
1818 | "sir", | ||
1819 | "siva", | ||
1820 | "sixty", | ||
1821 | "skeet", | ||
1822 | "skew", | ||
1823 | "skid", | ||
1824 | "skimp", | ||
1825 | "skulk", | ||
1826 | "Skye", | ||
1827 | "slab", | ||
1828 | "slag", | ||
1829 | "slake", | ||
1830 | "slap", | ||
1831 | "slay", | ||
1832 | "sleep", | ||
1833 | "sleet", | ||
1834 | "slick", | ||
1835 | "slim", | ||
1836 | "slimy", | ||
1837 | "slog", | ||
1838 | "slosh", | ||
1839 | "sloth", | ||
1840 | "slow", | ||
1841 | "slug", | ||
1842 | "slum", | ||
1843 | "slung", | ||
1844 | "slurp", | ||
1845 | "sly", | ||
1846 | "small", | ||
1847 | "smile", | ||
1848 | "smith", | ||
1849 | "smog", | ||
1850 | "smoky", | ||
1851 | "snack", | ||
1852 | "snark", | ||
1853 | "sneer", | ||
1854 | "snell", | ||
1855 | "snip", | ||
1856 | "snoop", | ||
1857 | "snore", | ||
1858 | "snow", | ||
1859 | "snub", | ||
1860 | "snug", | ||
1861 | "so", | ||
1862 | "soap", | ||
1863 | "soar", | ||
1864 | "soft", | ||
1865 | "soggy", | ||
1866 | "sold", | ||
1867 | "sole", | ||
1868 | "solid", | ||
1869 | "Solon", | ||
1870 | "solve", | ||
1871 | "some", | ||
1872 | "son", | ||
1873 | "sonny", | ||
1874 | "soon", | ||
1875 | "sorb", | ||
1876 | "sore", | ||
1877 | "sort", | ||
1878 | "south", | ||
1879 | "sow", | ||
1880 | "spa", | ||
1881 | "spade", | ||
1882 | "spare", | ||
1883 | "spark", | ||
1884 | "spasm", | ||
1885 | "spate", | ||
1886 | "spawn", | ||
1887 | "spear", | ||
1888 | "speed", | ||
1889 | "spell", | ||
1890 | "Spica", | ||
1891 | "spicy", | ||
1892 | "spiky", | ||
1893 | "spire", | ||
1894 | "Spiro", | ||
1895 | "splay", | ||
1896 | "spoil", | ||
1897 | "spook", | ||
1898 | "spool", | ||
1899 | "spore", | ||
1900 | "spout", | ||
1901 | "spree", | ||
1902 | "sprue", | ||
1903 | "spur", | ||
1904 | "spy", | ||
1905 | "squaw", | ||
1906 | "s's", | ||
1907 | "St", | ||
1908 | "stag", | ||
1909 | "staid", | ||
1910 | "stair", | ||
1911 | "stale", | ||
1912 | "stall", | ||
1913 | "stamp", | ||
1914 | "stand", | ||
1915 | "stark", | ||
1916 | "stash", | ||
1917 | "state", | ||
1918 | "stay", | ||
1919 | "stead", | ||
1920 | "steak", | ||
1921 | "steam", | ||
1922 | "steed", | ||
1923 | "Steen", | ||
1924 | "steer", | ||
1925 | "stern", | ||
1926 | "stew", | ||
1927 | "stile", | ||
1928 | "stilt", | ||
1929 | "stock", | ||
1930 | "stole", | ||
1931 | "stone", | ||
1932 | "stood", | ||
1933 | "stool", | ||
1934 | "stop", | ||
1935 | "storm", | ||
1936 | "story", | ||
1937 | "stove", | ||
1938 | "strap", | ||
1939 | "straw", | ||
1940 | "strip", | ||
1941 | "strum", | ||
1942 | "stud", | ||
1943 | "study", | ||
1944 | "stung", | ||
1945 | "stunt", | ||
1946 | "Sturm", | ||
1947 | "styli", | ||
1948 | "suave", | ||
1949 | "such", | ||
1950 | "sud", | ||
1951 | "sue", | ||
1952 | "Suez", | ||
1953 | "suit", | ||
1954 | "sulky", | ||
1955 | "sung", | ||
1956 | "sunny", | ||
1957 | "sup", | ||
1958 | "supra", | ||
1959 | "surge", | ||
1960 | "Sus", | ||
1961 | "sushi", | ||
1962 | "swank", | ||
1963 | "swap", | ||
1964 | "swear", | ||
1965 | "swelt", | ||
1966 | "swig", | ||
1967 | "swine", | ||
1968 | "swish", | ||
1969 | "swiss", | ||
1970 | "sword", | ||
1971 | "swung", | ||
1972 | "Syria", | ||
1973 | "syrup", | ||
1974 | "tab", | ||
1975 | "tabu", | ||
1976 | "tacit", | ||
1977 | "taffy", | ||
1978 | "Tahoe", | ||
1979 | "take", | ||
1980 | "tale", | ||
1981 | "talk", | ||
1982 | "tamp", | ||
1983 | "tang", | ||
1984 | "tango", | ||
1985 | "tanh", | ||
1986 | "Tanya", | ||
1987 | "tap", | ||
1988 | "tape", | ||
1989 | "tapir", | ||
1990 | "tappa", | ||
1991 | "tar", | ||
1992 | "tardy", | ||
1993 | "tarry", | ||
1994 | "task", | ||
1995 | "tasty", | ||
1996 | "tate", | ||
1997 | "tawny", | ||
1998 | "taxi", | ||
1999 | "teach", | ||
2000 | "tease", | ||
2001 | "tecum", | ||
2002 | "Telex", | ||
2003 | "tempt", | ||
2004 | "tenon", | ||
2005 | "tense", | ||
2006 | "tepid", | ||
2007 | "terry", | ||
2008 | "Tess", | ||
2009 | "Texas", | ||
2010 | "Thai", | ||
2011 | "than", | ||
2012 | "that", | ||
2013 | "Thea", | ||
2014 | "thee", | ||
2015 | "them", | ||
2016 | "then", | ||
2017 | "theta", | ||
2018 | "they", | ||
2019 | "thick", | ||
2020 | "thigh", | ||
2021 | "thin", | ||
2022 | "thing", | ||
2023 | "third", | ||
2024 | "three", | ||
2025 | "threw", | ||
2026 | "thug", | ||
2027 | "thus", | ||
2028 | "ti", | ||
2029 | "tibet", | ||
2030 | "tic", | ||
2031 | "tid", | ||
2032 | "tidy", | ||
2033 | "tied", | ||
2034 | "tift", | ||
2035 | "til", | ||
2036 | "tile", | ||
2037 | "tilt", | ||
2038 | "Timex", | ||
2039 | "Timon", | ||
2040 | "tinge", | ||
2041 | "tipsy", | ||
2042 | "tire", | ||
2043 | "tit", | ||
2044 | "tithe", | ||
2045 | "title", | ||
2046 | "TNT", | ||
2047 | "toad", | ||
2048 | "today", | ||
2049 | "tog", | ||
2050 | "Togo", | ||
2051 | "toil", | ||
2052 | "token", | ||
2053 | "told", | ||
2054 | "tome", | ||
2055 | "tommy", | ||
2056 | "tonal", | ||
2057 | "tong", | ||
2058 | "Toni", | ||
2059 | "tonk", | ||
2060 | "tony", | ||
2061 | "tool", | ||
2062 | "tooth", | ||
2063 | "top", | ||
2064 | "tor", | ||
2065 | "torch", | ||
2066 | "tori", | ||
2067 | "torr", | ||
2068 | "torso", | ||
2069 | "torus", | ||
2070 | "total", | ||
2071 | "totem", | ||
2072 | "tout", | ||
2073 | "tower", | ||
2074 | "town", | ||
2075 | "toxin", | ||
2076 | "track", | ||
2077 | "Tracy", | ||
2078 | "trag", | ||
2079 | "trail", | ||
2080 | "trait", | ||
2081 | "tramp", | ||
2082 | "trap", | ||
2083 | "tread", | ||
2084 | "tree", | ||
2085 | "trend", | ||
2086 | "tress", | ||
2087 | "trial", | ||
2088 | "tribe", | ||
2089 | "trill", | ||
2090 | "tripe", | ||
2091 | "troll", | ||
2092 | "troop", | ||
2093 | "trout", | ||
2094 | "truck", | ||
2095 | "Trudy", | ||
2096 | "trunk", | ||
2097 | "trust", | ||
2098 | "TRW", | ||
2099 | "t's", | ||
2100 | "TTL", | ||
2101 | "tub", | ||
2102 | "tube", | ||
2103 | "tuck", | ||
2104 | "Tudor", | ||
2105 | "tuft", | ||
2106 | "tulle", | ||
2107 | "tum", | ||
2108 | "tuna", | ||
2109 | "tune", | ||
2110 | "tunic", | ||
2111 | "Turin", | ||
2112 | "turk", | ||
2113 | "turn", | ||
2114 | "tusk", | ||
2115 | "tutu", | ||
2116 | "tweak", | ||
2117 | "twice", | ||
2118 | "twill", | ||
2119 | "twine", | ||
2120 | "twirl", | ||
2121 | "twit", | ||
2122 | "two", | ||
2123 | "tying", | ||
2124 | "ugly", | ||
2125 | "ultra", | ||
2126 | "umbra", | ||
2127 | "uncle", | ||
2128 | "union", | ||
2129 | "unite", | ||
2130 | "upend", | ||
2131 | "upper", | ||
2132 | "upset", | ||
2133 | "Upton", | ||
2134 | "urban", | ||
2135 | "urine", | ||
2136 | "us", | ||
2137 | "usage", | ||
2138 | "use", | ||
2139 | "USGS", | ||
2140 | "USIA", | ||
2141 | "usual", | ||
2142 | "usurp", | ||
2143 | "Utah", | ||
2144 | "utile", | ||
2145 | "v", | ||
2146 | "vade", | ||
2147 | "vague", | ||
2148 | "vain", | ||
2149 | "valid", | ||
2150 | "valve", | ||
2151 | "van", | ||
2152 | "vase", | ||
2153 | "vast", | ||
2154 | "Veda", | ||
2155 | "veer", | ||
2156 | "vein", | ||
2157 | "Vella", | ||
2158 | "venom", | ||
2159 | "Venus", | ||
2160 | "verb", | ||
2161 | "Verde", | ||
2162 | "versa", | ||
2163 | "vest", | ||
2164 | "vetch", | ||
2165 | "vex", | ||
2166 | "via", | ||
2167 | "vicar", | ||
2168 | "Vichy", | ||
2169 | "Vida", | ||
2170 | "vie", | ||
2171 | "Viet", | ||
2172 | "vigil", | ||
2173 | "viii", | ||
2174 | "villa", | ||
2175 | "vise", | ||
2176 | "visor", | ||
2177 | "vitae", | ||
2178 | "Vito", | ||
2179 | "viva", | ||
2180 | "vixen", | ||
2181 | "vocal", | ||
2182 | "voice", | ||
2183 | "Volta", | ||
2184 | "vowel", | ||
2185 | "v's", | ||
2186 | "w", | ||
2187 | "wack", | ||
2188 | "wacky", | ||
2189 | "wad", | ||
2190 | "wade", | ||
2191 | "wafer", | ||
2192 | "wag", | ||
2193 | "wah", | ||
2194 | "wail", | ||
2195 | "wait", | ||
2196 | "waive", | ||
2197 | "waken", | ||
2198 | "wale", | ||
2199 | "wally", | ||
2200 | "wan", | ||
2201 | "war", | ||
2202 | "ward", | ||
2203 | "ware", | ||
2204 | "warm", | ||
2205 | "warp", | ||
2206 | "warty", | ||
2207 | "was", | ||
2208 | "washy", | ||
2209 | "water", | ||
2210 | "watt", | ||
2211 | "Watts", | ||
2212 | "way", | ||
2213 | "Wayne", | ||
2214 | "weal", | ||
2215 | "wean", | ||
2216 | "wear", | ||
2217 | "web", | ||
2218 | "weber", | ||
2219 | "we'd", | ||
2220 | "wedge", | ||
2221 | "weed", | ||
2222 | "week", | ||
2223 | "Wei", | ||
2224 | "weird", | ||
2225 | "Welch", | ||
2226 | "well", | ||
2227 | "welsh", | ||
2228 | "wept", | ||
2229 | "were", | ||
2230 | "west", | ||
2231 | "wet", | ||
2232 | "wharf", | ||
2233 | "whee", | ||
2234 | "whelm", | ||
2235 | "when", | ||
2236 | "which", | ||
2237 | "whim", | ||
2238 | "whir", | ||
2239 | "whisk", | ||
2240 | "white", | ||
2241 | "whiz", | ||
2242 | "whoa", | ||
2243 | "whole", | ||
2244 | "whoop", | ||
2245 | "whop", | ||
2246 | "whose", | ||
2247 | "why", | ||
2248 | "widen", | ||
2249 | "widow", | ||
2250 | "wield", | ||
2251 | "Wier", | ||
2252 | "wile", | ||
2253 | "will", | ||
2254 | "Wilma", | ||
2255 | "wilt", | ||
2256 | "win", | ||
2257 | "winch", | ||
2258 | "wino", | ||
2259 | "wipe", | ||
2260 | "wise", | ||
2261 | "wispy", | ||
2262 | "witch", | ||
2263 | "withy", | ||
2264 | "witty", | ||
2265 | "woe", | ||
2266 | "wok", | ||
2267 | "wolve", | ||
2268 | "womb", | ||
2269 | "Wong", | ||
2270 | "Woods", | ||
2271 | "wool", | ||
2272 | "wop", | ||
2273 | "wordy", | ||
2274 | "work", | ||
2275 | "worm", | ||
2276 | "worse", | ||
2277 | "worst", | ||
2278 | "wove", | ||
2279 | "wow", | ||
2280 | "wreck", | ||
2281 | "wrest", | ||
2282 | "wrist", | ||
2283 | "Wu", | ||
2284 | "Wyatt", | ||
2285 | "Wylie", | ||
2286 | "Wyner", | ||
2287 | "x", | ||
2288 | "xenon", | ||
2289 | "x's", | ||
2290 | "yacht", | ||
2291 | "Yale", | ||
2292 | "yam", | ||
2293 | "yang", | ||
2294 | "yarn", | ||
2295 | "Yates", | ||
2296 | "year", | ||
2297 | "yeast", | ||
2298 | "Yeats", | ||
2299 | "Yemen", | ||
2300 | "yield", | ||
2301 | "yip", | ||
2302 | "yodel", | ||
2303 | "yoga", | ||
2304 | "yoke", | ||
2305 | "yore", | ||
2306 | "you'd", | ||
2307 | "y's", | ||
2308 | "Yves", | ||
2309 | "YWCA", | ||
2310 | "Zeiss", | ||
2311 | "zest", | ||
2312 | "zig", | ||
2313 | "zing", | ||
2314 | "zip", | ||
2315 | "Zoe", | ||
2316 | "zoo" | ||
2317 | }; | ||
diff --git a/all_pairs/source/anagram/anagram_stdlib.c b/all_pairs/source/anagram/anagram_stdlib.c new file mode 100644 index 0000000..994350b --- /dev/null +++ b/all_pairs/source/anagram/anagram_stdlib.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /* | ||
2 | |||
3 | This file is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_stdlib.c | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This file contains the C standard library functions used by anagram. | ||
11 | |||
12 | Source: anagram | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #include "anagram_stdlib.h" | ||
23 | #include "anagram_strings.h" | ||
24 | |||
25 | /* Includes anagram_CompareFrequency */ | ||
26 | /* This function is included here because the WCC does not */ | ||
27 | /* support function pointers */ | ||
28 | #include "anagram_compare.h" | ||
29 | |||
30 | |||
31 | void anagram_swapi( char *ii, char *ij, unsigned long es ) | ||
32 | { | ||
33 | char *i, *j, c; | ||
34 | |||
35 | i = ( char * )ii; | ||
36 | j = ( char * )ij; | ||
37 | _Pragma( "loopbound min 1 max 1" ) | ||
38 | do { | ||
39 | c = *i; | ||
40 | *i ++ = *j; | ||
41 | *j ++ = c; | ||
42 | es -= sizeof( char ); | ||
43 | } while ( es != 0 ); | ||
44 | } | ||
45 | |||
46 | char *anagram_pivot( char *a, unsigned long n, unsigned long es ) | ||
47 | { | ||
48 | unsigned long j; | ||
49 | char *pi, *pj, *pk; | ||
50 | |||
51 | j = n / 6 * es; | ||
52 | pi = a + j; /* 1/6 */ | ||
53 | j += j; | ||
54 | pj = pi + j; /* 1/2 */ | ||
55 | pk = pj + j; /* 5/6 */ | ||
56 | if ( anagram_CompareFrequency( pi, pj ) < 0 ) { | ||
57 | if ( anagram_CompareFrequency( pi, pk ) < 0 ) { | ||
58 | if ( anagram_CompareFrequency( pj, pk ) < 0 ) | ||
59 | return pj; | ||
60 | return pk; | ||
61 | } | ||
62 | return pi; | ||
63 | } | ||
64 | if ( anagram_CompareFrequency( pj, pk ) < 0 ) { | ||
65 | if ( anagram_CompareFrequency( pi, pk ) < 0 ) | ||
66 | return pi; | ||
67 | return pk; | ||
68 | } | ||
69 | return pj; | ||
70 | } | ||
71 | |||
72 | void anagram_qsorts( char *a, unsigned long n, unsigned long es ) | ||
73 | { | ||
74 | unsigned long j; | ||
75 | char *pi, *pj, *pn; | ||
76 | volatile unsigned int flowfactdummy = 0; | ||
77 | |||
78 | _Pragma( "loopbound min 0 max 6" ) | ||
79 | while ( n > 1 ) { | ||
80 | if ( n > 10 ) | ||
81 | pi = anagram_pivot( a, n, es ); | ||
82 | else | ||
83 | pi = a + ( n >> 1 ) * es; | ||
84 | |||
85 | anagram_swapi( a, pi, es ); | ||
86 | pi = a; | ||
87 | pn = a + n * es; | ||
88 | pj = pn; | ||
89 | _Pragma( "loopbound min 1 max 11" ) | ||
90 | while ( 1 ) { | ||
91 | /* wcc note: this assignment expression was added to avoid assignment of | ||
92 | multiple loop bound annotations to same loop (cf. Ticket #0002323). */ | ||
93 | flowfactdummy ++; | ||
94 | _Pragma( "loopbound min 1 max 5" ) | ||
95 | do { | ||
96 | pi += es; | ||
97 | } while ( pi < pn && anagram_CompareFrequency( pi, a ) < 0 ); | ||
98 | _Pragma( "loopbound min 1 max 4" ) | ||
99 | do { | ||
100 | pj -= es; | ||
101 | } while ( pj > a && anagram_CompareFrequency( pj, a ) > 0 ); | ||
102 | if ( pj < pi ) | ||
103 | break; | ||
104 | anagram_swapi( pi, pj, es ); | ||
105 | } | ||
106 | anagram_swapi( a, pj, es ); | ||
107 | j = ( unsigned long )( pj - a ) / es; | ||
108 | |||
109 | n = n - j - 1; | ||
110 | if ( j >= n ) { | ||
111 | anagram_qsorts( a, j, es ); | ||
112 | a += ( j + 1 ) * es; | ||
113 | } else { | ||
114 | anagram_qsorts( a + ( j + 1 )*es, n, es ); | ||
115 | n = j; | ||
116 | } | ||
117 | } | ||
118 | } | ||
119 | |||
120 | void anagram_qsort( void *va, unsigned long n, unsigned long es ) | ||
121 | { | ||
122 | _Pragma( "marker call_qsorts" ) | ||
123 | anagram_qsorts( ( char * )va, n, es ); | ||
124 | _Pragma( "flowrestriction 1*anagram_qsorts <= 17*call_qsorts" ) | ||
125 | } | ||
126 | |||
127 | |||
128 | /* This must be redefined for each new benchmark */ | ||
129 | #define ANAGRAM_HEAP_SIZE 18000 | ||
130 | |||
131 | static char anagram_simulated_heap[ANAGRAM_HEAP_SIZE]; | ||
132 | static unsigned int anagram_freeHeapPos; | ||
133 | |||
134 | void *anagram_malloc( unsigned int numberOfBytes ) | ||
135 | { | ||
136 | void *currentPos = ( void * )&anagram_simulated_heap[ anagram_freeHeapPos ]; | ||
137 | /* Get a 4-byte address for alignment purposes */ | ||
138 | //anagram_freeHeapPos += ( ( numberOfBytes + 4 ) & ( unsigned int )0xfffffffc ); | ||
139 | unsigned int rem = (numberOfBytes & ( unsigned int )0x3 ); | ||
140 | unsigned int adjustment = rem ? 4 - rem : 0; | ||
141 | anagram_freeHeapPos += numberOfBytes + adjustment; | ||
142 | return currentPos; | ||
143 | } | ||
144 | |||
145 | void anagram_bzero( char *p, unsigned long len ) | ||
146 | { | ||
147 | unsigned long i; | ||
148 | |||
149 | _Pragma( "loopbound min 8 max 416" ) | ||
150 | for ( i = 0; i < len; ++ i ) | ||
151 | *p ++ = '\0'; | ||
152 | } | ||
153 | |||
diff --git a/all_pairs/source/anagram/anagram_stdlib.h b/all_pairs/source/anagram/anagram_stdlib.h new file mode 100644 index 0000000..0e745d5 --- /dev/null +++ b/all_pairs/source/anagram/anagram_stdlib.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* | ||
2 | |||
3 | This header is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_stdlib.h | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This header contains some C standard library functions used by anagram. | ||
11 | |||
12 | Source: unknown | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #ifndef ANAGRAM_STDLIB_H | ||
23 | #define ANAGRAM_STDLIB_H | ||
24 | |||
25 | void *anagram_malloc( unsigned int numberOfBytes ); | ||
26 | |||
27 | void anagram_qsort( void *va, unsigned long n, unsigned long es ); | ||
28 | |||
29 | #endif | ||
diff --git a/all_pairs/source/anagram/anagram_strings.h b/all_pairs/source/anagram/anagram_strings.h new file mode 100644 index 0000000..1e023fc --- /dev/null +++ b/all_pairs/source/anagram/anagram_strings.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | |||
3 | This header is part of the TACLeBench benchmark suite. | ||
4 | Version 2.0 | ||
5 | |||
6 | Name: anagram_strings.h | ||
7 | |||
8 | Author: Raymond Chen | ||
9 | |||
10 | Function: This header contains some C standard library functions used by anagram. | ||
11 | |||
12 | Source: unknown | ||
13 | |||
14 | Original name: anagram | ||
15 | |||
16 | Changes: See ChangeLog.txt | ||
17 | |||
18 | License: See anagram.c | ||
19 | |||
20 | */ | ||
21 | |||
22 | #ifndef ANAGRAM_STRINGS_H | ||
23 | #define ANAGRAM_STRINGS_H | ||
24 | |||
25 | void anagram_bzero( char *p, unsigned long len ); | ||
26 | |||
27 | #endif | ||