Keil Logo

C166 Version 5 Operation Timings
XC16x Devices — Small Model

The following benchmarks provide a baseline for the execution speed of code generated by the Keil C166 Compiler. Automated test scripts were used to calculate the minimum, average, and maximum time required for each operation.

Each benchmark lists the number of states and the number of seconds required to perform the operation. The state time represents the actual number of instruction cycles. You may specify the oscillator frequency and the clock divisor (for the instruction clock) to obtain execution times in seconds.

Enter MCU Speed Details
(Default XTAL Frequency: 20MHz)
 
XTAL Frequency: MHz
Instruction Clock Divisor:
 

Unsigned Character Operations

Operation Min Avg Max
unsigned char + 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
unsigned char - 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
unsigned char * 7
.35 µSecs
7
.35 µSecs
7
.35 µSecs
unsigned char / 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
unsigned char % 9
.45 µSecs
9
.45 µSecs
9
.45 µSecs
unsigned char >> 6
.30 µSecs
6
.30 µSecs
6
.30 µSecs
unsigned char << 5
.25 µSecs
5
.25 µSecs
5
.25 µSecs

Signed Character Operations

Operation Min Avg Max
signed char + 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
signed char - 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
signed char * 7
.35 µSecs
7
.35 µSecs
7
.35 µSecs
signed char / 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
signed char % 9
.45 µSecs
9
.45 µSecs
9
.45 µSecs
signed char >> 6
.30 µSecs
6
.30 µSecs
6
.30 µSecs
signed char << 5
.25 µSecs
5
.25 µSecs
5
.25 µSecs

Unsigned Integer Operations

Operation Min Avg Max
unsigned int + 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
unsigned int - 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
unsigned int * 5
.25 µSecs
5
.25 µSecs
5
.25 µSecs
unsigned int / 6
.30 µSecs
6
.30 µSecs
6
.30 µSecs
unsigned int % 7
.35 µSecs
7
.35 µSecs
7
.35 µSecs
unsigned int >> 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
unsigned int << 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs

Signed Integer Operations

Operation Min Avg Max
signed int + 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
signed int - 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
signed int * 5
.25 µSecs
5
.25 µSecs
5
.25 µSecs
signed int / 6
.30 µSecs
6
.30 µSecs
6
.30 µSecs
signed int % 7
.35 µSecs
7
.35 µSecs
7
.35 µSecs
signed int >> 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
signed int << 4
.20 µSecs
4
.20 µSecs
4
.20 µSecs
abs () 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs

Unsigned Long Operations

Operation Min Avg Max
unsigned long + 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
unsigned long - 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
unsigned long * 15
.75 µSecs
15
.75 µSecs
15
.75 µSecs
unsigned long / 39
1.95 µSecs
39
1.95 µSecs
43
2.15 µSecs
unsigned long % 39
1.95 µSecs
39
1.95 µSecs
43
2.15 µSecs
unsigned long >> 8
.40 µSecs
13
.65 µSecs
16
.80 µSecs
unsigned long << 8
.40 µSecs
13
.65 µSecs
16
.80 µSecs

Signed Long Operations

Operation Min Avg Max
signed long + 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
signed long - 8
.40 µSecs
8
.40 µSecs
8
.40 µSecs
signed long * 15
.75 µSecs
15
.75 µSecs
15
.75 µSecs
signed long / 46
2.30 µSecs
53
2.65 µSecs
61
3.05 µSecs
signed long % 46
2.30 µSecs
53
2.65 µSecs
61
3.05 µSecs
signed long >> 8
.40 µSecs
13
.65 µSecs
16
.80 µSecs
signed long << 8
.40 µSecs
13
.65 µSecs
16
.80 µSecs
labs () 14
.70 µSecs
15
.75 µSecs
16
.80 µSecs

Floating-Point Operations

Operation Min Avg Max
float + 58
2.90 µSecs
74
3.70 µSecs
132
6.60 µSecs
float - 47
2.35 µSecs
75
3.75 µSecs
133
6.65 µSecs
float * 64
3.20 µSecs
67
3.35 µSecs
71
3.55 µSecs
float / 81
4.05 µSecs
84
4.20 µSecs
88
4.40 µSecs
fmod () 220
11.00 µSecs
299
14.95 µSecs
411
20.55 µSecs
modf () 169
8.45 µSecs
284
14.20 µSecs
310
15.50 µSecs
fabs () 51
2.55 µSecs
51
2.55 µSecs
53
2.65 µSecs
ceil () 289
14.45 µSecs
369
18.45 µSecs
392
19.60 µSecs
floor () 289
14.45 µSecs
369
18.45 µSecs
391
19.55 µSecs
pow () 177
8.85 µSecs
1,099
54.95 µSecs
3,716
185.80 µSecs
sqrt () 13
.65 µSecs
43
2.15 µSecs
77
3.85 µSecs
exp () 84
4.20 µSecs
96
4.80 µSecs
1,622
81.10 µSecs
log () 12
.60 µSecs
637
31.85 µSecs
1,526
76.30 µSecs
log10 () 47
2.35 µSecs
686
34.30 µSecs
1,591
79.55 µSecs
sin () 432
21.60 µSecs
1,091
54.55 µSecs
1,501
75.05 µSecs
cos () 402
20.10 µSecs
1,092
54.60 µSecs
1,508
75.40 µSecs
tan () 1,392
69.60 µSecs
1,521
76.05 µSecs
1,955
97.75 µSecs
asin () 178
8.90 µSecs
1,470
73.50 µSecs
1,925
96.25 µSecs
acos () 519
25.95 µSecs
1,578
78.90 µSecs
1,921
96.05 µSecs
atan () 686
34.30 µSecs
1,222
61.10 µSecs
1,645
82.25 µSecs
atan2 () 617
30.85 µSecs
1,359
67.95 µSecs
1,777
88.85 µSecs
sinh () 1,623
81.15 µSecs
3,546
177.30 µSecs
4,534
226.70 µSecs
cosh () 1,678
83.90 µSecs
3,543
177.15 µSecs
4,530
226.50 µSecs
tanh () 3,190
159.50 µSecs
3,467
173.35 µSecs
4,496
224.80 µSecs

Buffer Operations

Operation Min Avg Max
memset (10) 47
2.35 µSecs
47
2.35 µSecs
47
2.35 µSecs
memset (100) 407
20.35 µSecs
407
20.35 µSecs
407
20.35 µSecs
memset (1000) 4,007
200.35 µSecs
4,007
200.35 µSecs
4,007
200.35 µSecs
memcpy (10) 46
2.30 µSecs
46
2.30 µSecs
46
2.30 µSecs
memcpy (100) 406
20.30 µSecs
406
20.30 µSecs
406
20.30 µSecs
memcpy (1000) 4,006
200.30 µSecs
4,006
200.30 µSecs
4,006
200.30 µSecs
memmove
(10 with overlap)
100
5.00 µSecs
100
5.00 µSecs
100
5.00 µSecs
memmove
(100 with overlap)
820
41.00 µSecs
820
41.00 µSecs
820
41.00 µSecs
memmove
(1000 with overlap)
8,020
401.00 µSecs
8,020
401.00 µSecs
8,020
401.00 µSecs

Memory Allocation Operations

Operation Min Avg Max
malloc (),
99.5% successful
36
1.80 µSecs
148
7.40 µSecs
390
19.50 µSecs
free () 43
2.15 µSecs
176
8.80 µSecs
379
18.95 µSecs

Notes Note

  • These tests were performed and measured using the µVision Debugger. Test code was compiled with the C166 Version 5.03 C Compiler using the Small Memory Model and Optimization Level 7-SPEED.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.