diff --git a/fx_project/Makefile b/fx_project/Makefile index bbb8ea8ea8adac6d822d25968e57c855132ec5ab..784a7f4158727c695b059a7ee56b7cf127e7d573 100644 --- a/fx_project/Makefile +++ b/fx_project/Makefile @@ -4,7 +4,7 @@ CC = gcc CFLAGS = -Wall fx_test: $(OBJS) - $(CC) -o $@ $^ + $(CC) -o $@ $^ -lm test.o: test.c $(CC) $(CFLAGS) -c $^ diff --git a/fx_project/div_result.txt b/fx_project/div_result.txt new file mode 100644 index 0000000000000000000000000000000000000000..faa24f53b7be01176c8f042d050e8d4282f58f19 --- /dev/null +++ b/fx_project/div_result.txt @@ -0,0 +1,186 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls ns/call ns/call name + 28.28 1.10 1.10 __udivmoddi4 + 25.96 2.11 1.01 __divsi3 + 15.94 2.73 0.62 main + 12.08 3.20 0.47 10000001 47.00 59.00 fx_s1516_double_div + 4.37 3.37 0.17 10000001 17.00 17.00 fx_s1516_longlong_div0 + 4.11 3.53 0.16 10000001 16.00 16.00 fx_s1516_longlong_div1 + 3.08 3.65 0.12 10000001 12.00 12.00 double_to_fx + 3.08 3.77 0.12 10000001 12.00 12.00 fx_s1516_longlong_div2 + 3.08 3.89 0.12 __aeabi_ldivmod + 0.00 3.89 0.00 2 0.00 0.00 fx_to_double + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) for 0.26% of 3.89 seconds + +index % time self children called name + <spontaneous> +[1] 42.7 0.62 1.04 main [1] + 0.47 0.12 10000001/10000001 fx_s1516_double_div [4] + 0.17 0.00 10000001/10000001 fx_s1516_longlong_div0 [5] + 0.16 0.00 10000001/10000001 fx_s1516_longlong_div1 [6] + 0.12 0.00 10000001/10000001 fx_s1516_longlong_div2 [8] + 0.00 0.00 2/2 fx_to_double [10] +----------------------------------------------- + <spontaneous> +[2] 28.3 1.10 0.00 __udivmoddi4 [2] +----------------------------------------------- + <spontaneous> +[3] 26.0 1.01 0.00 __divsi3 [3] +----------------------------------------------- + 0.47 0.12 10000001/10000001 main [1] +[4] 15.2 0.47 0.12 10000001 fx_s1516_double_div [4] + 0.12 0.00 10000001/10000001 double_to_fx [7] +----------------------------------------------- + 0.17 0.00 10000001/10000001 main [1] +[5] 4.4 0.17 0.00 10000001 fx_s1516_longlong_div0 [5] +----------------------------------------------- + 0.16 0.00 10000001/10000001 main [1] +[6] 4.1 0.16 0.00 10000001 fx_s1516_longlong_div1 [6] +----------------------------------------------- + 0.12 0.00 10000001/10000001 fx_s1516_double_div [4] +[7] 3.1 0.12 0.00 10000001 double_to_fx [7] +----------------------------------------------- + 0.12 0.00 10000001/10000001 main [1] +[8] 3.1 0.12 0.00 10000001 fx_s1516_longlong_div2 [8] +----------------------------------------------- + <spontaneous> +[9] 3.1 0.12 0.00 __aeabi_ldivmod [9] +----------------------------------------------- + 0.00 0.00 2/2 main [1] +[10] 0.0 0.00 0.00 2 fx_to_double [10] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `<spontaneous>' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [9] __aeabi_ldivmod [4] fx_s1516_double_div [10] fx_to_double + [3] __divsi3 [5] fx_s1516_longlong_div0 [1] main + [2] __udivmoddi4 [6] fx_s1516_longlong_div1 + [7] double_to_fx [8] fx_s1516_longlong_div2 diff --git a/fx_project/fx_s1516_double.h b/fx_project/fx_s1516_double.h index 2b69dd9fd6513b3fd252f4d488aa149296438d9a..7dc96719004c92cca2783fb8b7befa583921a88f 100644 --- a/fx_project/fx_s1516_double.h +++ b/fx_project/fx_s1516_double.h @@ -3,11 +3,11 @@ typedef int fx_s1516; -#include <stdio.h> #define _USE_MATH_DEFINES #include <math.h> +#include <stdio.h> #define P2_16 65536 -#define fP2_16 65536.0f +#define fP2_16 65536.0 #define e M_E #define fx_s1516_PI M_PI #define fx_s1516_INVERSE_PI 1/M_PI @@ -23,4 +23,4 @@ extern double fx_s1516_double_sqrt(double a); extern double fx_s1516_double_pow(double a, double b); extern double fx_s1516_double_log(double a, double b); extern double degree_to_radian(double a); -extern double fx_s1516_double_sin(double a); \ No newline at end of file +extern double fx_s1516_double_sin(double a); diff --git a/fx_project/gmon.out b/fx_project/gmon.out new file mode 100644 index 0000000000000000000000000000000000000000..7adc55fbe4cbb98be3745b78db77ec432943e56d Binary files /dev/null and b/fx_project/gmon.out differ diff --git a/fx_project/mul_result.txt b/fx_project/mul_result.txt new file mode 100644 index 0000000000000000000000000000000000000000..90f4f7143b1ee00cee1ce384ae68d15af05ed155 --- /dev/null +++ b/fx_project/mul_result.txt @@ -0,0 +1,183 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls ns/call ns/call name + 47.21 1.10 1.10 main + 11.59 1.37 0.27 10000001 27.00 27.00 fx_s1516_longlong_mul4 + 10.73 1.62 0.25 10000001 25.00 40.00 fx_s1516_double_mul + 10.30 1.86 0.24 10000001 24.00 24.00 fx_s1516_longlong_mul0 + 6.44 2.01 0.15 10000001 15.00 15.00 double_to_fx + 5.15 2.13 0.12 10000001 12.00 12.00 fx_s1516_longlong_mul3 + 4.29 2.23 0.10 10000001 10.00 10.00 fx_s1516_longlong_mul1 + 4.29 2.33 0.10 10000001 10.00 10.00 fx_s1516_longlong_mul2 + 0.00 2.33 0.00 2 0.00 0.00 fx_to_double + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) for 0.43% of 2.33 seconds + +index % time self children called name + <spontaneous> +[1] 100.0 1.10 1.23 main [1] + 0.25 0.15 10000001/10000001 fx_s1516_double_mul [2] + 0.27 0.00 10000001/10000001 fx_s1516_longlong_mul4 [3] + 0.24 0.00 10000001/10000001 fx_s1516_longlong_mul0 [4] + 0.12 0.00 10000001/10000001 fx_s1516_longlong_mul3 [6] + 0.10 0.00 10000001/10000001 fx_s1516_longlong_mul1 [7] + 0.10 0.00 10000001/10000001 fx_s1516_longlong_mul2 [8] + 0.00 0.00 2/2 fx_to_double [9] +----------------------------------------------- + 0.25 0.15 10000001/10000001 main [1] +[2] 17.2 0.25 0.15 10000001 fx_s1516_double_mul [2] + 0.15 0.00 10000001/10000001 double_to_fx [5] +----------------------------------------------- + 0.27 0.00 10000001/10000001 main [1] +[3] 11.6 0.27 0.00 10000001 fx_s1516_longlong_mul4 [3] +----------------------------------------------- + 0.24 0.00 10000001/10000001 main [1] +[4] 10.3 0.24 0.00 10000001 fx_s1516_longlong_mul0 [4] +----------------------------------------------- + 0.15 0.00 10000001/10000001 fx_s1516_double_mul [2] +[5] 6.4 0.15 0.00 10000001 double_to_fx [5] +----------------------------------------------- + 0.12 0.00 10000001/10000001 main [1] +[6] 5.2 0.12 0.00 10000001 fx_s1516_longlong_mul3 [6] +----------------------------------------------- + 0.10 0.00 10000001/10000001 main [1] +[7] 4.3 0.10 0.00 10000001 fx_s1516_longlong_mul1 [7] +----------------------------------------------- + 0.10 0.00 10000001/10000001 main [1] +[8] 4.3 0.10 0.00 10000001 fx_s1516_longlong_mul2 [8] +----------------------------------------------- + 0.00 0.00 2/2 main [1] +[9] 0.0 0.00 0.00 2 fx_to_double [9] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `<spontaneous>' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [5] double_to_fx [7] fx_s1516_longlong_mul1 [3] fx_s1516_longlong_mul4 + [2] fx_s1516_double_mul [8] fx_s1516_longlong_mul2 [9] fx_to_double + [4] fx_s1516_longlong_mul0 [6] fx_s1516_longlong_mul3 [1] main diff --git a/fx_project/sin_result.txt b/fx_project/sin_result.txt new file mode 100644 index 0000000000000000000000000000000000000000..fe0886d442873adeef63c309ffe56672568183d8 --- /dev/null +++ b/fx_project/sin_result.txt @@ -0,0 +1,167 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls ns/call ns/call name + 28.64 0.59 0.59 main + 26.21 1.13 0.54 10000001 54.00 54.00 fx_s1516_longlong_sin + 18.93 1.52 0.39 10000001 39.00 58.00 fx_s1516_double_sin + 16.99 1.87 0.35 10000001 35.00 35.00 degree_to_radian + 9.22 2.06 0.19 10000001 19.00 19.00 double_to_fx + 0.00 2.06 0.00 1 0.00 0.00 fx_to_double + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) for 0.49% of 2.06 seconds + +index % time self children called name + <spontaneous> +[1] 100.0 0.59 1.47 main [1] + 0.39 0.19 10000001/10000001 fx_s1516_double_sin [2] + 0.54 0.00 10000001/10000001 fx_s1516_longlong_sin [3] + 0.35 0.00 10000001/10000001 degree_to_radian [4] + 0.00 0.00 1/1 fx_to_double [6] +----------------------------------------------- + 0.39 0.19 10000001/10000001 main [1] +[2] 28.2 0.39 0.19 10000001 fx_s1516_double_sin [2] + 0.19 0.00 10000001/10000001 double_to_fx [5] +----------------------------------------------- + 0.54 0.00 10000001/10000001 main [1] +[3] 26.2 0.54 0.00 10000001 fx_s1516_longlong_sin [3] +----------------------------------------------- + 0.35 0.00 10000001/10000001 main [1] +[4] 17.0 0.35 0.00 10000001 degree_to_radian [4] +----------------------------------------------- + 0.19 0.00 10000001/10000001 fx_s1516_double_sin [2] +[5] 9.2 0.19 0.00 10000001 double_to_fx [5] +----------------------------------------------- + 0.00 0.00 1/1 main [1] +[6] 0.0 0.00 0.00 1 fx_to_double [6] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `<spontaneous>' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [4] degree_to_radian [2] fx_s1516_double_sin [6] fx_to_double + [5] double_to_fx [3] fx_s1516_longlong_sin [1] main diff --git a/fx_project/sqrt_result.txt b/fx_project/sqrt_result.txt new file mode 100644 index 0000000000000000000000000000000000000000..cce5a1755e5377b663c6eb3280a25b869c480529 --- /dev/null +++ b/fx_project/sqrt_result.txt @@ -0,0 +1,162 @@ +Flat profile: + +Each sample counts as 0.01 seconds. + % cumulative self self total + time seconds seconds calls ns/call ns/call name + 47.83 0.55 0.55 main + 28.70 0.88 0.33 10000001 33.00 43.00 fx_s1516_double_sqrt + 14.78 1.05 0.17 10000001 17.00 17.00 fx_s1516_longlong_sqrt + 8.70 1.15 0.10 10000001 10.00 10.00 double_to_fx + 0.00 1.15 0.00 1 0.00 0.00 fx_to_double + + % the percentage of the total running time of the +time program used by this function. + +cumulative a running sum of the number of seconds accounted + seconds for by this function and those listed above it. + + self the number of seconds accounted for by this +seconds function alone. This is the major sort for this + listing. + +calls the number of times this function was invoked, if + this function is profiled, else blank. + + self the average number of milliseconds spent in this +ms/call function per call, if this function is profiled, + else blank. + + total the average number of milliseconds spent in this +ms/call function and its descendents per call, if this + function is profiled, else blank. + +name the name of the function. This is the minor sort + for this listing. The index shows the location of + the function in the gprof listing. If the index is + in parenthesis it shows where it would appear in + the gprof listing if it were to be printed. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + + Call graph (explanation follows) + + +granularity: each sample hit covers 4 byte(s) for 0.87% of 1.15 seconds + +index % time self children called name + <spontaneous> +[1] 100.0 0.55 0.60 main [1] + 0.33 0.10 10000001/10000001 fx_s1516_double_sqrt [2] + 0.17 0.00 10000001/10000001 fx_s1516_longlong_sqrt [3] + 0.00 0.00 1/1 fx_to_double [5] +----------------------------------------------- + 0.33 0.10 10000001/10000001 main [1] +[2] 37.4 0.33 0.10 10000001 fx_s1516_double_sqrt [2] + 0.10 0.00 10000001/10000001 double_to_fx [4] +----------------------------------------------- + 0.17 0.00 10000001/10000001 main [1] +[3] 14.8 0.17 0.00 10000001 fx_s1516_longlong_sqrt [3] +----------------------------------------------- + 0.10 0.00 10000001/10000001 fx_s1516_double_sqrt [2] +[4] 8.7 0.10 0.00 10000001 double_to_fx [4] +----------------------------------------------- + 0.00 0.00 1/1 main [1] +[5] 0.0 0.00 0.00 1 fx_to_double [5] +----------------------------------------------- + + This table describes the call tree of the program, and was sorted by + the total amount of time spent in each function and its children. + + Each entry in this table consists of several lines. The line with the + index number at the left hand margin lists the current function. + The lines above it list the functions that called this function, + and the lines below it list the functions this one called. + This line lists: + index A unique number given to each element of the table. + Index numbers are sorted numerically. + The index number is printed next to every function name so + it is easier to look up where the function is in the table. + + % time This is the percentage of the `total' time that was spent + in this function and its children. Note that due to + different viewpoints, functions excluded by options, etc, + these numbers will NOT add up to 100%. + + self This is the total amount of time spent in this function. + + children This is the total amount of time propagated into this + function by its children. + + called This is the number of times the function was called. + If the function called itself recursively, the number + only includes non-recursive calls, and is followed by + a `+' and the number of recursive calls. + + name The name of the current function. The index number is + printed after it. If the function is a member of a + cycle, the cycle number is printed between the + function's name and the index number. + + + For the function's parents, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the function into this parent. + + children This is the amount of time that was propagated from + the function's children into this parent. + + called This is the number of times this parent called the + function `/' the total number of times the function + was called. Recursive calls to the function are not + included in the number after the `/'. + + name This is the name of the parent. The parent's index + number is printed after it. If the parent is a + member of a cycle, the cycle number is printed between + the name and the index number. + + If the parents of the function cannot be determined, the word + `<spontaneous>' is printed in the `name' field, and all the other + fields are blank. + + For the function's children, the fields have the following meanings: + + self This is the amount of time that was propagated directly + from the child into the function. + + children This is the amount of time that was propagated from the + child's children to the function. + + called This is the number of times the function called + this child `/' the total number of times the child + was called. Recursive calls by the child are not + listed in the number after the `/'. + + name This is the name of the child. The child's index + number is printed after it. If the child is a + member of a cycle, the cycle number is printed + between the name and the index number. + + If there are any cycles (circles) in the call graph, there is an + entry for the cycle-as-a-whole. This entry shows who called the + cycle (as parents) and the members of the cycle (as children.) + The `+' recursive calls entry shows the number of function calls that + were internal to the cycle, and the calls entry for each member shows, + for that member, how many times it was called from other members of + the cycle. + +Copyright (C) 2012-2017 Free Software Foundation, Inc. + +Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. + +Index by function name + + [4] double_to_fx [3] fx_s1516_longlong_sqrt [1] main + [2] fx_s1516_double_sqrt [5] fx_to_double diff --git a/fx_project/test.c b/fx_project/test.c index c38dc944002450ad9579444df4f67a357aa518ee..ad78a8832bb6ccb88dd461a71c20a68ad7b93347 100644 --- a/fx_project/test.c +++ b/fx_project/test.c @@ -6,7 +6,7 @@ int main() double sum = 0; int i; -#ifdef mul +#ifdef fx_mul fx_s1516 a = 30000; fx_s1516 b = 50000; @@ -20,33 +20,33 @@ int main() printf("%d\n", fx_s1516_longlong_mul3(a, b)); printf("%d\n", fx_s1516_longlong_mul4(a, b)); - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_double_mul(fa, fb); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_mul0(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_mul1(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_mul2(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_mul3(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_mul4(a, b); } #endif -#ifdef div +#ifdef fx_div fx_s1516 a = 1000000; fx_s1516 b = 500000; @@ -58,25 +58,25 @@ int main() printf("%d\n", fx_s1516_longlong_div1(a, b)); printf("%d\n", fx_s1516_longlong_div2(a, b)); - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_double_div(fa, fb); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_div0(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_div1(a, b); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_longlong_div2(a, b); } #endif -#ifdef sin +#ifdef fx_sin fx_s1516 a = 30; double fa = fx_to_double(a); @@ -84,17 +84,17 @@ int main() printf("%lf\n", fx_s1516_double_sin(degree_to_radian(fa))); printf("%lf\n", fx_s1516_longlong_sin(a * P2_16) / fP2_16); - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_double_sin(degree_to_radian(fa)); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += (fx_s1516_longlong_sin(a * P2_16) / fP2_16); } #endif -#ifdef sqrt +#ifdef fx_sqrt fx_s1516 a = 123; double fa = fx_to_double(a); @@ -102,11 +102,11 @@ int main() printf("%lf\n", fx_s1516_double_sqrt(fa)); printf("%lf\n", fx_s1516_longlong_sqrt(a) / 256.0); - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += fx_s1516_double_sqrt(fa); } - for (i = 0; i < 1000000; i++) + for (i = 0; i < 10000000; i++) { sum += (fx_s1516_longlong_sqrt(a) / 256.0); } @@ -115,4 +115,4 @@ int main() printf("%lf", sum); return 0; -} \ No newline at end of file +}