Commit ff4c6e4b authored by Gaurav Kukreja's avatar Gaurav Kukreja

match_cfg.py working for adpcm and sieve perfectly

Signed-off-by: Gaurav Kukreja's avatarGaurav Kukreja <gaurav@gauravk.in>
parent 1201ec2e
...@@ -2,8 +2,9 @@ include ../Makefile.macros ...@@ -2,8 +2,9 @@ include ../Makefile.macros
include Makefile.macros include Makefile.macros
#EXAMPLES = sieve crc32 adpcm sha basicmath #EXAMPLES = sieve crc32 adpcm sha basicmath
EXAMPLES = crc32 basicmath
#EXAMPLES = sha sieve #EXAMPLES = sha sieve
EXAMPLES = adpcm #EXAMPLES = sha
STARTADR = 0x10000214 STARTADR = 0x10000214
# Space separated list of all C files in APPDIR # Space separated list of all C files in APPDIR
......
...@@ -7,7 +7,7 @@ include ../../Makefile.macros ...@@ -7,7 +7,7 @@ include ../../Makefile.macros
APP1 = my_ctop APP1 = my_ctop
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
IRDUMP = 1 #defined - dump IR files, undefined - don't. IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
...@@ -11,7 +11,7 @@ APP1 = my_ctop_IR ...@@ -11,7 +11,7 @@ APP1 = my_ctop_IR
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc #PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -g -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -g -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
#IRDUMP = 1 #defined - dump IR files, undefined - don't. #IRDUMP = 1 #defined - dump IR files, undefined - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
This diff is collapsed.
...@@ -33,14 +33,14 @@ struct adpcm_state coder_1_state; ...@@ -33,14 +33,14 @@ struct adpcm_state coder_1_state;
int main() { int main() {
long unsigned int end_62; long unsigned int end_46;
long unsigned int end_61; int i_45;
long unsigned int end_60; long unsigned int end_44;
int i_59; long unsigned int end_43;
long unsigned int start_56; long unsigned int start_40;
uintptr_t ivtmp_50; uintptr_t ivtmp_34;
int D_2245; int D_2229;
uintptr_t ivtmp_44; uintptr_t ivtmp_28;
long unsigned int count; long unsigned int count;
long unsigned int end; long unsigned int end;
long unsigned int start; long unsigned int start;
...@@ -53,21 +53,21 @@ mainbb_2: ...@@ -53,21 +53,21 @@ mainbb_2:
ARR_SIZE_0 = ARR_SIZE; ARR_SIZE_0 = ARR_SIZE;
j = ARR_SIZE_0 / 10240; j = ARR_SIZE_0 / 10240;
if (j != 0) if (j != 0)
goto mainbb_13; goto mainbb_14;
else else
goto mainbb_7; goto mainbb_7;
// # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec) // # SUCC: 14 [91.0%] (true,exec) 7 [9.0%] (false,exec)
mainbb_13: mainbb_14:
// # PRED: 2 [91.0%] (true,exec) // # PRED: 2 [91.0%] (true,exec)
end_61 = 0; end_43 = 0;
count = 0; count = 0;
// # SUCC: 3 [100.0%] (fallthru) // # SUCC: 3 [100.0%] (fallthru)
mainbb_3: mainbb_3:
// # PRED: 13 [100.0%] (fallthru) 14 [100.0%] (fallthru) // # PRED: 13 [100.0%] (fallthru) 14 [100.0%] (fallthru)
end_62 = end_61 + 10240; end_46 = end_43 + 10240;
if (end_61 < end_62) if (end_43 < end_46)
goto mainbb_4; goto mainbb_4;
else else
goto mainbb_6; goto mainbb_6;
...@@ -75,36 +75,36 @@ mainbb_3: ...@@ -75,36 +75,36 @@ mainbb_3:
mainbb_4: mainbb_4:
// # PRED: 3 [99.0%] (true,exec) // # PRED: 3 [99.0%] (true,exec)
i_59 = (int) end_61; i_45 = (int) end_43;
ivtmp_50 = (uintptr_t)&in_Data[i_59]; ivtmp_34 = (uintptr_t)&in_Data[i_45];
end_60 = end_61; end_44 = end_43;
// # SUCC: 5 [100.0%] (fallthru,exec) // # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_5: mainbb_5:
// # PRED: 5 [99.0%] (dfs_back,true,exec) 4 [100.0%] (fallthru,exec) // # PRED: 5 [99.0%] (true,exec) 4 [100.0%] (fallthru,exec)
pcmdata[end_60 - end_61] = *(short int*)((uintptr_t)ivtmp_50); pcmdata[end_44 - end_43] = *(short int*)((uintptr_t)ivtmp_34);
i_59 = i_59 + 1; i_45 = i_45 + 1;
end_60 = (long unsigned int) i_59; end_44 = (long unsigned int) i_45;
ivtmp_50 = ivtmp_50 + 2; ivtmp_34 = ivtmp_34 + 2;
if (end_60 < end_62) if (end_44 < end_46)
goto mainbb_5; goto mainbb_5;
else else
goto mainbb_6; goto mainbb_6;
// # SUCC: 5 [99.0%] (dfs_back,true,exec) 6 [1.0%] (false,exec) // # SUCC: 5 [99.0%] (true,exec) 6 [1.0%] (false,exec)
mainbb_6: mainbb_6:
// # PRED: 5 [1.0%] (false,exec) 3 [1.0%] (false,exec) // # PRED: 5 [1.0%] (false,exec) 3 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, 10240, &coder_1_state); adpcm_coder (&pcmdata, &adpcmdata, 10240, &coder_1_state);
count = count + 1; count = count + 1;
if (j > count) if (j > count)
goto mainbb_14; goto mainbb_13;
else else
goto mainbb_7; goto mainbb_7;
// # SUCC: 14 [91.0%] (dfs_back,true,exec) 7 [9.0%] (false,exec) // # SUCC: 13 [91.0%] (true,exec) 7 [9.0%] (false,exec)
mainbb_14: mainbb_13:
// # PRED: 6 [91.0%] (dfs_back,true,exec) // # PRED: 6 [91.0%] (true,exec)
end_61 = end_62; end_43 = end_46;
goto mainbb_3; goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru) // # SUCC: 3 [100.0%] (fallthru)
...@@ -118,9 +118,9 @@ mainbb_7: ...@@ -118,9 +118,9 @@ mainbb_7:
mainbb_8: mainbb_8:
// # PRED: 7 [61.0%] (true,exec) // # PRED: 7 [61.0%] (true,exec)
start = j * 10240; start_40 = j * 10240;
end = ARR_SIZE; end = ARR_SIZE;
if (start < end) if (start_40 < end)
goto mainbb_9; goto mainbb_9;
else else
goto mainbb_11; goto mainbb_11;
...@@ -128,27 +128,27 @@ mainbb_8: ...@@ -128,27 +128,27 @@ mainbb_8:
mainbb_9: mainbb_9:
// # PRED: 8 [99.0%] (true,exec) // # PRED: 8 [99.0%] (true,exec)
i = (int) start; i = (int) start_40;
ivtmp_44 = (uintptr_t)&in_Data[i]; ivtmp_28 = (uintptr_t)&in_Data[i];
D_2245 = (int) end; D_2229 = (int) end;
start_56 = start; start = start_40;
// # SUCC: 10 [100.0%] (fallthru,exec) // # SUCC: 10 [100.0%] (fallthru,exec)
mainbb_10: mainbb_10:
// # PRED: 10 [99.0%] (dfs_back,true,exec) 9 [100.0%] (fallthru,exec) // # PRED: 10 [99.0%] (true,exec) 9 [100.0%] (fallthru,exec)
pcmdata[start_56 - start] = *(short int*)((uintptr_t)ivtmp_44); pcmdata[start - start_40] = *(short int*)((uintptr_t)ivtmp_28);
i = i + 1; i = i + 1;
start_56 = (long unsigned int) i; start = (long unsigned int) i;
ivtmp_44 = ivtmp_44 + 2; ivtmp_28 = ivtmp_28 + 2;
if (i != D_2245) if (i != D_2229)
goto mainbb_10; goto mainbb_10;
else else
goto mainbb_11; goto mainbb_11;
// # SUCC: 10 [99.0%] (dfs_back,true,exec) 11 [1.0%] (false,exec) // # SUCC: 10 [99.0%] (true,exec) 11 [1.0%] (false,exec)
mainbb_11: mainbb_11:
// # PRED: 10 [1.0%] (false,exec) 8 [1.0%] (false,exec) // # PRED: 10 [1.0%] (false,exec) 8 [1.0%] (false,exec)
adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start), &coder_1_state); adpcm_coder (&pcmdata, &adpcmdata, (int) (end - start_40), &coder_1_state);
// # SUCC: 12 [100.0%] (fallthru,exec) // # SUCC: 12 [100.0%] (fallthru,exec)
mainbb_12: mainbb_12:
......
...@@ -10,7 +10,7 @@ TRUNCAPP1 = basicmath_small_truncated3 ...@@ -10,7 +10,7 @@ TRUNCAPP1 = basicmath_small_truncated3
MATH = my_math #when libsource, COPTS is as per lib source compilation. Uncomment paths, VPATH in that case MATH = my_math #when libsource, COPTS is as per lib source compilation. Uncomment paths, VPATH in that case
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
ifdef PHASE ifdef PHASE
......
...@@ -10,7 +10,7 @@ TRUNCAPP1 = basicmath_small_truncated3_IR ...@@ -10,7 +10,7 @@ TRUNCAPP1 = basicmath_small_truncated3_IR
MATH = my_math #when libsource, COPTS is as per lib source compilation. Uncomment paths, VPATH in that case MATH = my_math #when libsource, COPTS is as per lib source compilation. Uncomment paths, VPATH in that case
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
ifdef PHASE ifdef PHASE
...@@ -48,7 +48,7 @@ OFILE2 = ${APP2}.${OEXT} ...@@ -48,7 +48,7 @@ OFILE2 = ${APP2}.${OEXT}
DEBUGFILE1 = ${DEBUGAPP}.c rad2deg.c cubic_debug.c isqrt.c DEBUGFILE1 = ${DEBUGAPP}.c rad2deg.c cubic_debug.c isqrt.c
DEBUGOFILE1 = ${DEBUGAPP}.${OEXT} DEBUGOFILE1 = ${DEBUGAPP}.${OEXT}
OBJDIR = ./objdir OBJDIR = .
#### mathlib source paths and names #### mathlib source paths and names
#MY_MPATH1=/home/local/grimlock/suhas/libm_some_sources/math #MY_MPATH1=/home/local/grimlock/suhas/libm_some_sources/math
...@@ -63,7 +63,7 @@ MATHFILES1 = w_acos.c s_cos.c w_pow.c w_sqrt.c ...@@ -63,7 +63,7 @@ MATHFILES1 = w_acos.c s_cos.c w_pow.c w_sqrt.c
MATHFILES2 = e_acos.c e_pow.c e_sqrt.c k_cos.c k_sin.c e_rem_pio2.c k_rem_pio2.c MATHFILES2 = e_acos.c e_pow.c e_sqrt.c k_cos.c k_sin.c e_rem_pio2.c k_rem_pio2.c
MATHFILES3 = s_scalbn.c s_floor.c s_copysign.c s_fabs.c s_nan.c MATHFILES3 = s_scalbn.c s_floor.c s_copysign.c s_fabs.c s_nan.c
all: basicmath_small_my_math_trunc all: basicmath_small_my_math_trunc objdump_small_my_math_trunc
test: test:
./$(TRUNCOFILE1MYMATH) ./$(TRUNCOFILE1MYMATH)
......
...@@ -23,17 +23,23 @@ double Xangle[2]; ...@@ -23,17 +23,23 @@ double Xangle[2];
int main(void) { int main(void) {
double X_68; double X_62;
uintptr_t ivtmp_64; uintptr_t ivtmp_58;
uintptr_t ivtmp_55; uintptr_t ivtmp_54;
uintptr_t ivtmp_50; uintptr_t ivtmp_50;
double Xangle_I_lsm_42; uintptr_t ivtmp_46;
double Xangle_I_lsm_41; uintptr_t ivtmp_37;
uintptr_t ivtmp_32;
double Xangle_I_lsm_24;
double Xangle_I_lsm_23;
struct int_sqrt q; struct int_sqrt q;
int i; int i;
int solutions; int solutions;
double X; double X;
double x[3]; double x[3];
double d1;
double c1;
double b1;
double a1; double a1;
mainbb_2: mainbb_2:
...@@ -42,107 +48,129 @@ mainbb_2: ...@@ -42,107 +48,129 @@ mainbb_2:
SolveCubic (1.0e+0, -4.5e+0, 1.7e+1, -3.0e+1, &solutions, &x); SolveCubic (1.0e+0, -4.5e+0, 1.7e+1, -3.0e+1, &solutions, &x);
SolveCubic (1.0e+0, -3.5e+0, 2.2e+1, -3.1e+1, &solutions, &x); SolveCubic (1.0e+0, -3.5e+0, 2.2e+1, -3.1e+1, &solutions, &x);
SolveCubic (1.0e+0, -1.36999999999999992894572642398998141288757324219e+1, 1.0e+0, -3.5e+1, &solutions, &x); SolveCubic (1.0e+0, -1.36999999999999992894572642398998141288757324219e+1, 1.0e+0, -3.5e+1, &solutions, &x);
ivtmp_64 = 0; ivtmp_58 = 0;
a1 = 3.0e+0; a1 = 3.0e+0;
// # SUCC: 3 [100.0%] (fallthru,exec) goto mainbb_9;
// # SUCC: 9 [100.0%] (fallthru,exec)
mainbb_3: mainbb_3:
// # PRED: 3 [75.0%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru,exec)
SolveCubic (a1, 1.0e+1, 5.0e+0, -1.0e+0, &solutions, &x); SolveCubic (a1, b1, c1, d1, &solutions, &x);
SolveCubic (a1, 1.0e+1, 5.0e+0, -2.0e+0, &solutions, &x); d1 = d1 - 1.0e+0;
SolveCubic (a1, 1.0e+1, 5.0e+0, -3.0e+0, &solutions, &x); ivtmp_46 = ivtmp_46 + 1;
SolveCubic (a1, 1.0e+1, 5.0e+0, -4.0e+0, &solutions, &x); if (ivtmp_46 != 4)
SolveCubic (a1, 1.0e+1, 5.5e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 5.5e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 5.5e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 5.5e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.0e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.0e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.0e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.0e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.5e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.5e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.5e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 1.0e+1, 6.5e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.0e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.0e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.0e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.0e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.5e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.5e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.5e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 5.5e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.0e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.0e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.0e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.0e+0, -4.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.5e+0, -1.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.5e+0, -2.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.5e+0, -3.0e+0, &solutions, &x);
SolveCubic (a1, 9.0e+0, 6.5e+0, -4.0e+0, &solutions, &x);
a1 = a1 + 1.0e+0;
ivtmp_64 = ivtmp_64 + 1;
if (ivtmp_64 != 3)
goto mainbb_3; goto mainbb_3;
else else
goto mainbb_10; goto mainbb_4;
// # SUCC: 3 [75.0%] (dfs_back,true,exec) 10 [25.0%] (false,exec) // # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
mainbb_10: mainbb_4:
// # PRED: 3 [25.0%] (false,exec) // # PRED: 3 [9.0%] (false,exec)
c1 = c1 + 5.0e-1;
ivtmp_50 = ivtmp_50 + 1;
if (ivtmp_50 != 4)
goto mainbb_5;
else
goto mainbb_6;
// # SUCC: 5 [91.0%] (true,exec) 6 [9.0%] (false,exec)
mainbb_5:
// # PRED: 4 [91.0%] (true,exec) 7 [100.0%] (fallthru,exec)
ivtmp_46 = 0;
d1 = -1.0e+0;
goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru,exec)
mainbb_6:
// # PRED: 4 [9.0%] (false,exec)
b1 = b1 - 1.0e+0;
ivtmp_54 = ivtmp_54 + 1;
if (ivtmp_54 != 2)
goto mainbb_7;
else
goto mainbb_8;
// # SUCC: 7 [91.0%] (true,exec) 8 [9.0%] (false,exec)
mainbb_7:
// # PRED: 6 [91.0%] (true,exec) 9 [100.0%] (fallthru,exec)
ivtmp_50 = 0;
c1 = 5.0e+0;
goto mainbb_5;
// # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_8:
// # PRED: 6 [9.0%] (false,exec)
a1 = a1 + 1.0e+0;
ivtmp_58 = ivtmp_58 + 1;
if (ivtmp_58 != 3)
goto mainbb_9;
else
goto mainbb_16;
// # SUCC: 9 [75.0%] (true,exec) 16 [25.0%] (false,exec)
mainbb_9:
// # PRED: 8 [75.0%] (true,exec) 2 [100.0%] (fallthru,exec)
ivtmp_54 = 0;
b1 = 1.0e+1;
goto mainbb_7;
// # SUCC: 7 [100.0%] (fallthru,exec)
mainbb_16:
// # PRED: 8 [25.0%] (false,exec)
i = 0; i = 0;
// # SUCC: 4 [100.0%] (fallthru) // # SUCC: 10 [100.0%] (fallthru)
mainbb_4: mainbb_10:
// # PRED: 4 [98.0%] (dfs_back,true,exec) 10 [100.0%] (fallthru) // # PRED: 10 [98.1%] (true,exec) 16 [100.0%] (fallthru)
usqrt ((long unsigned int) i, &q); usqrt ((long unsigned int) i, &q);
i = i + 1; i = i + 1;
if (i != 51) if (i != 51)
goto mainbb_4; goto mainbb_10;
else else
goto mainbb_5; goto mainbb_11;
// # SUCC: 4 [98.0%] (dfs_back,true,exec) 5 [2.0%] (false,exec) // # SUCC: 10 [98.1%] (true,exec) 11 [1.9%] (false,exec)
mainbb_5: mainbb_11:
// # PRED: 4 [2.0%] (false,exec) // # PRED: 10 [1.9%] (false,exec)
//Invalid sum of outgoing probabilities 0.0%
usqrt (1072497001, &q); usqrt (1072497001, &q);
ivtmp_55 = 0; ivtmp_37 = 0;
X = 0.0; X = 0.0;
// # SUCC: 6 [100.0%] (fallthru,exec) // # SUCC: 12 (fallthru,exec)
mainbb_6: mainbb_12:
// # PRED: 6 [99.0%] (dfs_back,true,exec) 5 [100.0%] (fallthru,exec) // # PRED: 12 [99.0%] (true,exec) 11 (fallthru,exec)
Xangle_I_lsm_42 = (X * 3.14159265358979311599796346854418516159057617188e+0) / 1.8e+2; Xangle_I_lsm_24 = (X * 3.14159265358979311599796346854418516159057617188e+0) / 1.8e+2;
X = X + 1.0e+0; X = X + 1.0e+0;
ivtmp_55 = ivtmp_55 + 1; ivtmp_37 = ivtmp_37 + 1;
if (ivtmp_55 != 361) if (ivtmp_37 != 361)
goto mainbb_6; goto mainbb_12;
else else
goto mainbb_7; goto mainbb_13;
// # SUCC: 6 [99.0%] (dfs_back,true,exec) 7 [1.0%] (false,exec) // # SUCC: 12 [99.0%] (true,exec) 13 [1.0%] (false,exec)
mainbb_7: mainbb_13:
// # PRED: 6 [1.0%] (false,exec) // # PRED: 12 [1.0%] (false,exec)
//Invalid sum of outgoing probabilities 0.0% //Invalid sum of outgoing probabilities 0.0%
Xangle[0] = Xangle_I_lsm_42; Xangle[0] = Xangle_I_lsm_24;
ivtmp_50 = 0; ivtmp_32 = 0;
X_68 = 0.0; X_62 = 0.0;
// # SUCC: 8 (fallthru,exec) // # SUCC: 14 (fallthru,exec)
mainbb_8: mainbb_14:
// # PRED: 8 [91.0%] (dfs_back,true,exec) 7 (fallthru,exec) // # PRED: 14 [91.0%] (true,exec) 13 (fallthru,exec)
Xangle_I_lsm_41 = (X_68 * 1.8e+2) / 3.14159265358979311599796346854418516159057617188e+0; Xangle_I_lsm_23 = (X_62 * 1.8e+2) / 3.14159265358979311599796346854418516159057617188e+0;
X_68 = X_68 + 1.74532925199432954743716805978692718781530857086e-2; X_62 = X_62 + 1.74532925199432954743716805978692718781530857086e-2;
ivtmp_50 = ivtmp_50 + 1; ivtmp_32 = ivtmp_32 + 1;
if (ivtmp_50 != 361) if (ivtmp_32 != 361)
goto mainbb_8; goto mainbb_14;
else else
goto mainbb_9; goto mainbb_15;
// # SUCC: 8 [91.0%] (dfs_back,true,exec) 9 [9.0%] (false,exec) // # SUCC: 14 [91.0%] (true,exec) 15 [9.0%] (false,exec)
mainbb_9: mainbb_15:
// # PRED: 8 [9.0%] (false,exec) // # PRED: 14 [9.0%] (false,exec)
Xangle[1] = Xangle_I_lsm_41; Xangle[1] = Xangle_I_lsm_23;
return 0; return 0;
// # SUCC: EXIT [100.0%] // # SUCC: EXIT [100.0%]
......
...@@ -69,7 +69,7 @@ usqrtbb_2: ...@@ -69,7 +69,7 @@ usqrtbb_2:
// # SUCC: 3 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru,exec)
usqrtbb_3: usqrtbb_3:
// # PRED: 5 [96.9%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 5 [97.0%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2427 = r << 2; D_2427 = r << 2;
r = (x >> 30) + D_2427; r = (x >> 30) + D_2427;
x = x << 2; x = x << 2;
...@@ -94,10 +94,10 @@ usqrtbb_5: ...@@ -94,10 +94,10 @@ usqrtbb_5:
goto usqrtbb_3; goto usqrtbb_3;
else else
goto usqrtbb_6; goto usqrtbb_6;
// # SUCC: 3 [96.9%] (dfs_back,true,exec) 6 [3.1%] (false,exec) // # SUCC: 3 [97.0%] (true,exec) 6 [3.0%] (false,exec)
usqrtbb_6: usqrtbb_6:
// # PRED: 5 [3.1%] (false,exec) // # PRED: 5 [3.0%] (false,exec)
*(long unsigned int*) q = a; *(long unsigned int*) q = a;
return; return;
// # SUCC: EXIT [100.0%] // # SUCC: EXIT [100.0%]
......
...@@ -371,20 +371,20 @@ struct Pair1 pow_LkUpTbl[POWCNT] = { ...@@ -371,20 +371,20 @@ struct Pair1 pow_LkUpTbl[POWCNT] = {
long double sqrt(long double in) { long double sqrt(long double in) {
uintptr_t ivtmp_43; uintptr_t ivtmp_32;
long double rValue; long double rValue;
unsigned int i; unsigned int i;
long double D_2171; long double D_2171;
sqrtbb_2: sqrtbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
ivtmp_43 = (uintptr_t)&sQrt_LkUpTbl[0].input; ivtmp_32 = (uintptr_t)&sQrt_LkUpTbl[0].input;
i = 0; i = 0;
// # SUCC: 3 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru,exec)
sqrtbb_3: sqrtbb_3:
// # PRED: 6 [99.0%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 6 [99.0%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2171 = *(long double*)((uintptr_t)ivtmp_43); D_2171 = *(long double*)((uintptr_t)ivtmp_32);
if (D_2171 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0) if (D_2171 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0)
goto sqrtbb_4; goto sqrtbb_4;
else else
...@@ -408,12 +408,12 @@ sqrtbb_5: ...@@ -408,12 +408,12 @@ sqrtbb_5:
sqrtbb_6: sqrtbb_6:
// # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec) // # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec)
i = i + 1; i = i + 1;
ivtmp_43 = ivtmp_43 + 16; ivtmp_32 = ivtmp_32 + 16;
if (i != 163) if (i != 163)
goto sqrtbb_3; goto sqrtbb_3;
else else
goto sqrtbb_8; goto sqrtbb_8;
// # SUCC: 3 [99.0%] (dfs_back,true,exec) 8 [1.0%] (false,exec) // # SUCC: 3 [99.0%] (true,exec) 8 [1.0%] (false,exec)
sqrtbb_8: sqrtbb_8:
// # PRED: 6 [1.0%] (false,exec) // # PRED: 6 [1.0%] (false,exec)
...@@ -430,20 +430,20 @@ sqrtbb_7: ...@@ -430,20 +430,20 @@ sqrtbb_7:
long double acos(long double in) { long double acos(long double in) {
uintptr_t ivtmp_86; uintptr_t ivtmp_64;
long double rValue; long double rValue;
unsigned int i; unsigned int i;
long double D_2190; long double D_2190;
acosbb_2: acosbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
ivtmp_86 = (uintptr_t)&aCos_LkUpTbl[0].input; ivtmp_64 = (uintptr_t)&aCos_LkUpTbl[0].input;
i = 0; i = 0;
// # SUCC: 3 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru,exec)
acosbb_3: acosbb_3:
// # PRED: 6 [95.1%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 6 [95.5%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2190 = *(long double*)((uintptr_t)ivtmp_86); D_2190 = *(long double*)((uintptr_t)ivtmp_64);
if (D_2190 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0) if (D_2190 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0)
goto acosbb_4; goto acosbb_4;
else else
...@@ -467,15 +467,15 @@ acosbb_5: ...@@ -467,15 +467,15 @@ acosbb_5:
acosbb_6: acosbb_6:
// # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec) // # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec)
i = i + 1; i = i + 1;
ivtmp_86 = ivtmp_86 + 16; ivtmp_64 = ivtmp_64 + 16;
if (i != 21) if (i != 21)
goto acosbb_3; goto acosbb_3;
else else
goto acosbb_8; goto acosbb_8;
// # SUCC: 3 [95.1%] (dfs_back,true,exec) 8 [4.9%] (false,exec) // # SUCC: 3 [95.5%] (true,exec) 8 [4.5%] (false,exec)
acosbb_8: acosbb_8:
// # PRED: 6 [4.9%] (false,exec) // # PRED: 6 [4.5%] (false,exec)
rValue = 0.0; rValue = 0.0;
// # SUCC: 7 [100.0%] (fallthru) // # SUCC: 7 [100.0%] (fallthru)
...@@ -489,20 +489,20 @@ acosbb_7: ...@@ -489,20 +489,20 @@ acosbb_7:
long double cos(long double in) { long double cos(long double in) {
uintptr_t ivtmp_128; uintptr_t ivtmp_95;
long double rValue; long double rValue;
unsigned int i; unsigned int i;
long double D_2209; long double D_2209;
cosbb_2: cosbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
ivtmp_128 = (uintptr_t)&cos_LkUpTbl[0].input; ivtmp_95 = (uintptr_t)&cos_LkUpTbl[0].input;
i = 0; i = 0;
// # SUCC: 3 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru,exec)
cosbb_3: cosbb_3:
// # PRED: 6 [98.4%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 6 [98.4%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2209 = *(long double*)((uintptr_t)ivtmp_128); D_2209 = *(long double*)((uintptr_t)ivtmp_95);
if (D_2209 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0) if (D_2209 + 2.00000000000000004163336342344337026588618755341e-3 >= in != 0)
goto cosbb_4; goto cosbb_4;
else else
...@@ -526,12 +526,12 @@ cosbb_5: ...@@ -526,12 +526,12 @@ cosbb_5:
cosbb_6: cosbb_6:
// # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec) // # PRED: 3 [50.0%] (false,exec) 4 [95.5%] (false,exec)
i = i + 1; i = i + 1;
ivtmp_128 = ivtmp_128 + 16; ivtmp_95 = ivtmp_95 + 16;
if (i != 63) if (i != 63)
goto cosbb_3; goto cosbb_3;
else else
goto cosbb_8; goto cosbb_8;
// # SUCC: 3 [98.4%] (dfs_back,true,exec) 8 [1.6%] (false,exec) // # SUCC: 3 [98.4%] (true,exec) 8 [1.6%] (false,exec)
cosbb_8: cosbb_8:
// # PRED: 6 [1.6%] (false,exec) // # PRED: 6 [1.6%] (false,exec)
...@@ -548,7 +548,7 @@ cosbb_7: ...@@ -548,7 +548,7 @@ cosbb_7:
long double pow(long double in1, long double in2) { long double pow(long double in1, long double in2) {
uintptr_t ivtmp_170; uintptr_t ivtmp_126;
long double rValue; long double rValue;
unsigned int i; unsigned int i;
long double D_2238; long double D_2238;
...@@ -556,13 +556,13 @@ long double pow(long double in1, long double in2) { ...@@ -556,13 +556,13 @@ long double pow(long double in1, long double in2) {
powbb_2: powbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
ivtmp_170 = (uintptr_t)&pow_LkUpTbl[0].input1; ivtmp_126 = (uintptr_t)&pow_LkUpTbl[0].input1;
i = 0; i = 0;
// # SUCC: 3 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru,exec)
powbb_3: powbb_3:
// # PRED: 8 [98.7%] (dfs_back,true,exec) 2 [100.0%] (fallthru,exec) // # PRED: 8 [98.8%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2229 = *(long double*)((uintptr_t)ivtmp_170); D_2229 = *(long double*)((uintptr_t)ivtmp_126);
if (D_2229 + 2.00000000000000004163336342344337026588618755341e-3 >= in1 != 0) if (D_2229 + 2.00000000000000004163336342344337026588618755341e-3 >= in1 != 0)
goto powbb_4; goto powbb_4;
else else
...@@ -579,7 +579,7 @@ powbb_4: ...@@ -579,7 +579,7 @@ powbb_4:
powbb_5: powbb_5:
// # PRED: 4 [50.0%] (true,exec) // # PRED: 4 [50.0%] (true,exec)
D_2238 = *(long double*)((uintptr_t)ivtmp_170 + 8); D_2238 = *(long double*)((uintptr_t)ivtmp_126 + 8);
if (D_2238 + 2.00000000000000004163336342344337026588618755341e-3 >= in2 != 0) if (D_2238 + 2.00000000000000004163336342344337026588618755341e-3 >= in2 != 0)
goto powbb_6; goto powbb_6;
else else
...@@ -603,15 +603,15 @@ powbb_7: ...@@ -603,15 +603,15 @@ powbb_7:
powbb_8: powbb_8:
// # PRED: 3 [50.0%] (false,exec) 4 [50.0%] (false,exec) 5 [50.0%] (false,exec) 6 [95.5%] (false,exec) // # PRED: 3 [50.0%] (false,exec) 4 [50.0%] (false,exec) 5 [50.0%] (false,exec) 6 [95.5%] (false,exec)
i = i + 1; i = i + 1;
ivtmp_170 = ivtmp_170 + 24; ivtmp_126 = ivtmp_126 + 24;
if (i != 79) if (i != 79)
goto powbb_3; goto powbb_3;
else else
goto powbb_10; goto powbb_10;
// # SUCC: 3 [98.7%] (dfs_back,true,exec) 10 [1.3%] (false,exec) // # SUCC: 3 [98.8%] (true,exec) 10 [1.2%] (false,exec)
powbb_10: powbb_10:
// # PRED: 8 [1.3%] (false,exec) // # PRED: 8 [1.2%] (false,exec)
rValue = 0.0; rValue = 0.0;
// # SUCC: 9 [100.0%] (fallthru) // # SUCC: 9 [100.0%] (fallthru)
......
...@@ -5,7 +5,7 @@ APP1 = crc_top ...@@ -5,7 +5,7 @@ APP1 = crc_top
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc #PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
IRDUMP = 1 #1 - dump IR files, 0 - don't. IRDUMP = 1 #1 - dump IR files, 0 - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
...@@ -5,7 +5,7 @@ APP1 = crc_top_IR ...@@ -5,7 +5,7 @@ APP1 = crc_top_IR
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc #PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = #-fdump-tree-all-blocks-details TREEDUMP = #-fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
IRDUMP = 1 #1 - dump IR files, 0 - don't. IRDUMP = 1 #1 - dump IR files, 0 - don't.
......
...@@ -143,63 +143,59 @@ updateCRC32bb_2: ...@@ -143,63 +143,59 @@ updateCRC32bb_2:
Boolean_T crc32file(char *name, DWORD *crc, long int *charcnt) { Boolean_T crc32file(char *name, DWORD *crc, long int *charcnt) {
long int D_2122; long unsigned int temp_52;
DWORD prephitmp_67; long unsigned int temp_50;
register DWORD oldcrc32; register DWORD oldcrc32;
unsigned int ARR_SIZE_0;
long unsigned int D_2020; long unsigned int D_2020;
DWORD D_2019; DWORD D_2019;
UNS_32_BITS D_2018; UNS_32_BITS D_2018;
char D_2012; char D_2012;
long int D_2009;
crc32filebb_2: crc32filebb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
*charcnt = 0; *charcnt = 0;
ARR_SIZE_0 = ARR_SIZE; if (ARR_SIZE != 0)
if (ARR_SIZE_0 != 0) goto crc32filebb_6;
goto crc32filebb_3;
else else
goto crc32filebb_7; goto crc32filebb_7;
// # SUCC: 3 [91.0%] (true,exec) 7 [9.0%] (false,exec) // # SUCC: 6 [91.0%] (true,exec) 7 [9.0%] (false,exec)
crc32filebb_7:
// # PRED: 2 [9.0%] (false,exec)
prephitmp_67 = 0;
goto crc32filebb_6;
// # SUCC: 6 [100.0%] (fallthru)
crc32filebb_3: crc32filebb_6:
// # PRED: 2 [91.0%] (true,exec) // # PRED: 2 [91.0%] (true,exec)
D_2122 = (long int) ARR_SIZE_0; temp_50 = 1;
D_2020 = 0; temp_52 = 0;
D_2009 = 0;
oldcrc32 = 4294967295; oldcrc32 = 4294967295;
// # SUCC: 4 [100.0%] (fallthru,exec) // # SUCC: 3 [100.0%] (fallthru)
crc32filebb_4: crc32filebb_3:
// # PRED: 4 [91.0%] (dfs_back,true,exec) 3 [100.0%] (fallthru,exec) // # PRED: 5 [100.0%] (fallthru) 6 [100.0%] (fallthru)
D_2012 = *(char*)((uintptr_t)name + D_2020); D_2012 = *(char*)((uintptr_t)name + temp_52);
D_2009 = D_2009 + 1; *charcnt = (long int) (long int) temp_50;
*charcnt = D_2009;
D_2018 = crc_32_tab[((long unsigned int) D_2012 ^ oldcrc32) & 255]; D_2018 = crc_32_tab[((long unsigned int) D_2012 ^ oldcrc32) & 255];
D_2019 = oldcrc32 >> 8; D_2019 = oldcrc32 >> 8;
oldcrc32 = D_2018 ^ D_2019; oldcrc32 = D_2018 ^ D_2019;
D_2020 = (long unsigned int) D_2009; D_2020 = temp_50 + 1;
if (D_2009 != D_2122) if (ARR_SIZE > temp_50)
goto crc32filebb_4;
else
goto crc32filebb_5; goto crc32filebb_5;
// # SUCC: 4 [91.0%] (dfs_back,true,exec) 5 [9.0%] (false,exec) else
goto crc32filebb_4;
// # SUCC: 5 [91.0%] (true,exec) 4 [9.0%] (false,exec)
crc32filebb_5: crc32filebb_5:
// # PRED: 4 [9.0%] (false,exec) // # PRED: 3 [91.0%] (true,exec)
prephitmp_67 = ~oldcrc32; temp_52 = temp_50;
// # SUCC: 6 [100.0%] (fallthru,exec) temp_50 = D_2020;
goto crc32filebb_3;
// # SUCC: 3 [100.0%] (fallthru)
crc32filebb_6: crc32filebb_7:
// # PRED: 5 [100.0%] (fallthru,exec) 7 [100.0%] (fallthru) // # PRED: 2 [9.0%] (false,exec)
*crc = prephitmp_67; oldcrc32 = 4294967295;
// # SUCC: 4 [100.0%] (fallthru)
crc32filebb_4:
// # PRED: 3 [9.0%] (false,exec) 7 [100.0%] (fallthru)
*crc = oldcrc32 = ~oldcrc32;
return 0; return 0;
// # SUCC: EXIT [100.0%] // # SUCC: EXIT [100.0%]
...@@ -208,8 +204,7 @@ crc32filebb_6: ...@@ -208,8 +204,7 @@ crc32filebb_6:
DWORD crc32buf(char *buf, size_t len) { DWORD crc32buf(char *buf, size_t len) {
uintptr_t ivtmp_120; uintptr_t ivtmp_76;
DWORD prephitmp_109;
register DWORD oldcrc32; register DWORD oldcrc32;
DWORD D_2036; DWORD D_2036;
UNS_32_BITS D_2035; UNS_32_BITS D_2035;
...@@ -217,43 +212,38 @@ DWORD crc32buf(char *buf, size_t len) { ...@@ -217,43 +212,38 @@ DWORD crc32buf(char *buf, size_t len) {
crc32bufbb_2: crc32bufbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
if (len != 0) if (len != 0)
goto crc32bufbb_6; goto crc32bufbb_5;
else else
goto crc32bufbb_7; goto crc32bufbb_6;
// # SUCC: 6 [91.0%] (true,exec) 7 [9.0%] (false,exec) // # SUCC: 5 [91.0%] (true,exec) 6 [9.0%] (false,exec)
crc32bufbb_7: crc32bufbb_6:
// # PRED: 2 [9.0%] (false,exec) // # PRED: 2 [9.0%] (false,exec)
prephitmp_109 = 0; oldcrc32 = 4294967295;
goto crc32bufbb_5; goto crc32bufbb_4;
// # SUCC: 5 [100.0%] (fallthru) // # SUCC: 4 [100.0%] (fallthru)
crc32bufbb_6: crc32bufbb_5:
// # PRED: 2 [91.0%] (true,exec) // # PRED: 2 [91.0%] (true,exec)
ivtmp_120 = 0; ivtmp_76 = 0;
oldcrc32 = 4294967295; oldcrc32 = 4294967295;
// # SUCC: 3 [100.0%] (fallthru) // # SUCC: 3 [100.0%] (fallthru)
crc32bufbb_3: crc32bufbb_3:
// # PRED: 6 [100.0%] (fallthru) 3 [91.0%] (dfs_back,true,exec) // # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru)
D_2035 = crc_32_tab[(oldcrc32 ^ (long unsigned int) *(char *)((uintptr_t)buf + (uintptr_t)ivtmp_120)) & 255]; D_2035 = crc_32_tab[(oldcrc32 ^ (long unsigned int) *(char *)((uintptr_t)buf + (uintptr_t)ivtmp_76)) & 255];
D_2036 = oldcrc32 >> 8; D_2036 = oldcrc32 >> 8;
oldcrc32 = D_2035 ^ D_2036; oldcrc32 = D_2035 ^ D_2036;
ivtmp_120 = ivtmp_120 + 1; ivtmp_76 = ivtmp_76 + 1;
if (len != ivtmp_120) if (ivtmp_76 != len)
goto crc32bufbb_3; goto crc32bufbb_3;
else else
goto crc32bufbb_4; goto crc32bufbb_4;
// # SUCC: 3 [91.0%] (dfs_back,true,exec) 4 [9.0%] (false,exec) // # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
crc32bufbb_4: crc32bufbb_4:
// # PRED: 3 [9.0%] (false,exec) // # PRED: 3 [9.0%] (false,exec) 6 [100.0%] (fallthru)
prephitmp_109 = ~oldcrc32; return ~oldcrc32;
// # SUCC: 5 [100.0%] (fallthru,exec)
crc32bufbb_5:
// # PRED: 4 [100.0%] (fallthru,exec) 7 [100.0%] (fallthru)
return prephitmp_109;
// # SUCC: EXIT [100.0%] // # SUCC: EXIT [100.0%]
} }
......
...@@ -21,7 +21,7 @@ APP2 = sha_driver_create_input_array ...@@ -21,7 +21,7 @@ APP2 = sha_driver_create_input_array
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc #PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = -fdump-tree-all-blocks-details TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
DEBUG = -g DEBUG = -g
IRDUMP = 1 #1 - dump IR files, 0 - don't. IRDUMP = 1 #1 - dump IR files, 0 - don't.
#PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point #PRINT = 1 #if defined and PHASE defined, include soft-float lib. fprintf uses floating point
......
...@@ -20,8 +20,8 @@ APP2 = sha_driver_create_input_array_IR ...@@ -20,8 +20,8 @@ APP2 = sha_driver_create_input_array_IR
#PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc #PHASE = final #when not defined, CC = gcc. otherwise cc = ppc-gcc
TREEDUMP = -fdump-tree-all-blocks-details #TREEDUMP = -fdump-tree-all-blocks-details
OPT = -O2 #is O3 in original MiBench download. Use O3 for final testing OPT = -O1 #is O3 in original MiBench download. Use O3 for final testing
OPT += -fno-optimize-sibling-calls #don't optimise for tail calls, only turn on for ppc OPT += -fno-optimize-sibling-calls #don't optimise for tail calls, only turn on for ppc
DEBUG = -g DEBUG = -g
#IRDUMP = 1 #1 - dump IR files, 0 - don't. #IRDUMP = 1 #1 - dump IR files, 0 - don't.
......
...@@ -22,7 +22,7 @@ Last modified - 17 Nov 2012 ...@@ -22,7 +22,7 @@ Last modified - 17 Nov 2012
void* my_memcpy(void* dest, const void* src, size_t count) { void* my_memcpy(void* dest, const void* src, size_t count) {
uintptr_t ivtmp_33; uintptr_t ivtmp_23;
my_memcpybb_2: my_memcpybb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
...@@ -34,18 +34,18 @@ my_memcpybb_2: ...@@ -34,18 +34,18 @@ my_memcpybb_2:
my_memcpybb_5: my_memcpybb_5:
// # PRED: 2 [91.0%] (true,exec) // # PRED: 2 [91.0%] (true,exec)
ivtmp_33 = 0; ivtmp_23 = 0;
// # SUCC: 3 [100.0%] (fallthru) // # SUCC: 3 [100.0%] (fallthru)
my_memcpybb_3: my_memcpybb_3:
// # PRED: 3 [91.0%] (dfs_back,true,exec) 5 [100.0%] (fallthru) // # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru)
*(char *)((uintptr_t)dest + (uintptr_t)ivtmp_33) = *(char *)((uintptr_t)src + (uintptr_t)ivtmp_33); *(char *)((uintptr_t)dest + (uintptr_t)ivtmp_23) = *(char *)((uintptr_t)src + (uintptr_t)ivtmp_23);
ivtmp_33 = ivtmp_33 + 1; ivtmp_23 = ivtmp_23 + 1;
if (ivtmp_33 != count) if (ivtmp_23 != count)
goto my_memcpybb_3; goto my_memcpybb_3;
else else
goto my_memcpybb_4; goto my_memcpybb_4;
// # SUCC: 3 [91.0%] (dfs_back,true,exec) 4 [9.0%] (false,exec) // # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memcpybb_4: my_memcpybb_4:
// # PRED: 3 [9.0%] (false,exec) 2 [9.0%] (false,exec) // # PRED: 3 [9.0%] (false,exec) 2 [9.0%] (false,exec)
...@@ -57,35 +57,33 @@ my_memcpybb_4: ...@@ -57,35 +57,33 @@ my_memcpybb_4:
void* my_memset(void *s, int c, size_t n) { void* my_memset(void *s, int c, size_t n) {
uintptr_t ivtmp_77; uintptr_t ivtmp_56;
char pretmp_66;
my_memsetbb_2: my_memsetbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec) // # PRED: ENTRY [100.0%] (fallthru,exec)
if (n != 0) if (n != 0)
goto my_memsetbb_3;
else
goto my_memsetbb_5; goto my_memsetbb_5;
// # SUCC: 3 [91.0%] (true,exec) 5 [9.0%] (false,exec) else
goto my_memsetbb_4;
// # SUCC: 5 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memsetbb_3: my_memsetbb_5:
// # PRED: 2 [91.0%] (true,exec) // # PRED: 2 [91.0%] (true,exec)
pretmp_66 = (char) c; ivtmp_56 = 0;
ivtmp_77 = 0; // # SUCC: 3 [100.0%] (fallthru)
// # SUCC: 4 [100.0%] (fallthru,exec)
my_memsetbb_4: my_memsetbb_3:
// # PRED: 4 [91.0%] (dfs_back,true,exec) 3 [100.0%] (fallthru,exec) // # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru)
*(char *)((uintptr_t)s + (uintptr_t)ivtmp_77) = pretmp_66; *(char *)((uintptr_t)s + (uintptr_t)ivtmp_56) = (char) (char) c;
ivtmp_77 = ivtmp_77 + 1; ivtmp_56 = ivtmp_56 + 1;
if (ivtmp_77 != n) if (ivtmp_56 != n)
goto my_memsetbb_4; goto my_memsetbb_3;
else else
goto my_memsetbb_5; goto my_memsetbb_4;
// # SUCC: 4 [91.0%] (dfs_back,true,exec) 5 [9.0%] (false,exec) // # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memsetbb_5: my_memsetbb_4:
// # PRED: 4 [9.0%] (false,exec) 2 [9.0%] (false,exec) // # PRED: 3 [9.0%] (false,exec) 2 [9.0%] (false,exec)
return (uintptr_t)s; return (uintptr_t)s;
// # SUCC: EXIT [100.0%] // # SUCC: EXIT [100.0%]
......
This diff is collapsed.
...@@ -11,7 +11,7 @@ from cfg import * ...@@ -11,7 +11,7 @@ from cfg import *
# if group(2) == "){", single line definition # if group(2) == "){", single line definition
# elif group(2) == $, multi line definition # elif group(2) == $, multi line definition
re_funcDef = re.compile('(?:\w*\s+)*\**(\w+)\s*\([,\s\w&\[\]\*]*($|\)\s*\{)') re_funcDef = re.compile('(?:\w*\s+)*\**(\w+)\s*\([,\s\w&\[\]\*]*($|\)\s*\{)')
re_funcDefArgLine = re.compile('[,\s\w&\[\]\*]*($|\)\s*\{)') re_funcDefArgLine = re.compile('[,\s\w&\[\]\*]*($|\)\s*(?:\{)?)')
re_basicBlockLabel = re.compile('\s*(\w*bb_[0-9]*):') re_basicBlockLabel = re.compile('\s*(\w*bb_[0-9]*):')
re_basicBlockStart = re.compile('\s*//\s*#\s*PRED:./*') re_basicBlockStart = re.compile('\s*//\s*#\s*PRED:./*')
re_basicBlockEnd = re.compile('\s*//\s*#\s*SUCC:./*') re_basicBlockEnd = re.compile('\s*//\s*#\s*SUCC:./*')
...@@ -125,7 +125,7 @@ def parse_isc(fileName): ...@@ -125,7 +125,7 @@ def parse_isc(fileName):
currFuncStartLine = lineNum + 1 currFuncStartLine = lineNum + 1
continue continue
else: else:
raise ParseError("Not found the expected Multi Line Argument List at %s:%d." & (fileName, lineNum)) raise ParseError("Not found the expected Multi Line Argument List at %s:%d." % (fileName, lineNum))
exit(1) exit(1)
# 2. Inside Function Body # 2. Inside Function Body
......
/***********************************************************
Intermediate representation of
basicmath/app_dir/basicmath_small_truncated3.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
//23 Oct 2012 - Truncated the 4 nested loop counts (calling SolveCubic). Total iterations
// reduced to 960 from 18000 in this nest of 4 loops.
// last week of Oct 2012 - Truncated even more, down to 96 iterations in the
// 4 nested for-loops and 51 in the usqrt loops
#include "snipmath.h"
#include <math.h>
/* The printf's may be removed to isolate just the math calculations */
double Xangle[2];
int main(void) {
double X_62;
uintptr_t ivtmp_58;
uintptr_t ivtmp_54;
uintptr_t ivtmp_50;
uintptr_t ivtmp_46;
uintptr_t ivtmp_37;
uintptr_t ivtmp_32;
double Xangle_I_lsm_24;
double Xangle_I_lsm_23;
struct int_sqrt q;
int i;
int solutions;
double X;
double x[3];
double d1;
double c1;
double b1;
double a1;
mainbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
SolveCubic (1.0e+0, -1.05e+1, 3.2e+1, -3.0e+1, &solutions, &x);
SolveCubic (1.0e+0, -4.5e+0, 1.7e+1, -3.0e+1, &solutions, &x);
SolveCubic (1.0e+0, -3.5e+0, 2.2e+1, -3.1e+1, &solutions, &x);
SolveCubic (1.0e+0, -1.36999999999999992894572642398998141288757324219e+1, 1.0e+0, -3.5e+1, &solutions, &x);
ivtmp_58 = 0;
a1 = 3.0e+0;
goto mainbb_9;
// # SUCC: 9 [100.0%] (fallthru,exec)
mainbb_3:
// # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru,exec)
SolveCubic (a1, b1, c1, d1, &solutions, &x);
d1 = d1 - 1.0e+0;
ivtmp_46 = ivtmp_46 + 1;
if (ivtmp_46 != 4)
goto mainbb_3;
else
goto mainbb_4;
// # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
mainbb_4:
// # PRED: 3 [9.0%] (false,exec)
c1 = c1 + 5.0e-1;
ivtmp_50 = ivtmp_50 + 1;
if (ivtmp_50 != 4)
goto mainbb_5;
else
goto mainbb_6;
// # SUCC: 5 [91.0%] (true,exec) 6 [9.0%] (false,exec)
mainbb_5:
// # PRED: 4 [91.0%] (true,exec) 7 [100.0%] (fallthru,exec)
ivtmp_46 = 0;
d1 = -1.0e+0;
goto mainbb_3;
// # SUCC: 3 [100.0%] (fallthru,exec)
mainbb_6:
// # PRED: 4 [9.0%] (false,exec)
b1 = b1 - 1.0e+0;
ivtmp_54 = ivtmp_54 + 1;
if (ivtmp_54 != 2)
goto mainbb_7;
else
goto mainbb_8;
// # SUCC: 7 [91.0%] (true,exec) 8 [9.0%] (false,exec)
mainbb_7:
// # PRED: 6 [91.0%] (true,exec) 9 [100.0%] (fallthru,exec)
ivtmp_50 = 0;
c1 = 5.0e+0;
goto mainbb_5;
// # SUCC: 5 [100.0%] (fallthru,exec)
mainbb_8:
// # PRED: 6 [9.0%] (false,exec)
a1 = a1 + 1.0e+0;
ivtmp_58 = ivtmp_58 + 1;
if (ivtmp_58 != 3)
goto mainbb_9;
else
goto mainbb_16;
// # SUCC: 9 [75.0%] (true,exec) 16 [25.0%] (false,exec)
mainbb_9:
// # PRED: 8 [75.0%] (true,exec) 2 [100.0%] (fallthru,exec)
ivtmp_54 = 0;
b1 = 1.0e+1;
goto mainbb_7;
// # SUCC: 7 [100.0%] (fallthru,exec)
mainbb_16:
// # PRED: 8 [25.0%] (false,exec)
i = 0;
// # SUCC: 10 [100.0%] (fallthru)
mainbb_10:
// # PRED: 10 [98.1%] (true,exec) 16 [100.0%] (fallthru)
usqrt ((long unsigned int) i, &q);
i = i + 1;
if (i != 51)
goto mainbb_10;
else
goto mainbb_11;
// # SUCC: 10 [98.1%] (true,exec) 11 [1.9%] (false,exec)
mainbb_11:
// # PRED: 10 [1.9%] (false,exec)
//Invalid sum of outgoing probabilities 0.0%
usqrt (1072497001, &q);
ivtmp_37 = 0;
X = 0.0;
// # SUCC: 12 (fallthru,exec)
mainbb_12:
// # PRED: 12 [99.0%] (true,exec) 11 (fallthru,exec)
Xangle_I_lsm_24 = (X * 3.14159265358979311599796346854418516159057617188e+0) / 1.8e+2;
X = X + 1.0e+0;
ivtmp_37 = ivtmp_37 + 1;
if (ivtmp_37 != 361)
goto mainbb_12;
else
goto mainbb_13;
// # SUCC: 12 [99.0%] (true,exec) 13 [1.0%] (false,exec)
mainbb_13:
// # PRED: 12 [1.0%] (false,exec)
//Invalid sum of outgoing probabilities 0.0%
Xangle[0] = Xangle_I_lsm_24;
ivtmp_32 = 0;
X_62 = 0.0;
// # SUCC: 14 (fallthru,exec)
mainbb_14:
// # PRED: 14 [91.0%] (true,exec) 13 (fallthru,exec)
Xangle_I_lsm_23 = (X_62 * 1.8e+2) / 3.14159265358979311599796346854418516159057617188e+0;
X_62 = X_62 + 1.74532925199432954743716805978692718781530857086e-2;
ivtmp_32 = ivtmp_32 + 1;
if (ivtmp_32 != 361)
goto mainbb_14;
else
goto mainbb_15;
// # SUCC: 14 [91.0%] (true,exec) 15 [9.0%] (false,exec)
mainbb_15:
// # PRED: 14 [9.0%] (false,exec)
Xangle[1] = Xangle_I_lsm_23;
return 0;
// # SUCC: EXIT [100.0%]
}
/***********************************************************
Intermediate representation of
basicmath/app_dir/cubic.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/* +++Date last modified: 05-Jul-1997 */
/*
** CUBIC.C - Solve a cubic polynomial
** public domain by Ross Cottrell
*/
#include <math.h>
#include <stdlib.h>
#include "snipmath.h"
void SolveCubic(double a,
double b,
double c,
double d,
int *solutions,
double *x)
{
double theta;
double R2_Q3;
long double R;
long double Q;
long double a2;
long double a1;
double iftmp_1;
double D_2478;
double D_2475;
double D_2471;
double D_2467;
double D_2463;
double D_2459;
long double D_2456;
double D_2454;
double D_2451;
double D_2448;
long double D_2444;
SolveCubicbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
a1 = b / a;
a2 = c / a;
Q = (a1 * a1 + a2 * -3.0e+0) / 9.0e+0;
R = ((((a1 * 2.0e+0) * a1) * a1 + (a1 * -9.0e+0) * a2) + (d / a) * 2.7e+1) / 5.4e+1;
D_2444 = (Q * Q) * Q;
R2_Q3 = R * R - D_2444;
if (R2_Q3 <= 0.0 != 0)
goto SolveCubicbb_3;
else
goto SolveCubicbb_4;
// # SUCC: 3 [39.0%] (true,exec) 4 [61.0%] (false,exec)
SolveCubicbb_3:
// # PRED: 2 [39.0%] (true,exec)
*solutions = 3;
D_2448 = sqrt (D_2444);
theta = acos (R / D_2448);
D_2451 = sqrt (Q);
D_2454 = cos (theta / 3.0e+0);
D_2456 = a1 / -3.0e+0;
*x = (D_2451 * -2.0e+0) * D_2454 + D_2456;
D_2459 = sqrt (Q);
D_2463 = cos ((theta + 6.28318530717958623199592693708837032318115234375e+0) / 3.0e+0);
*(double*)((uintptr_t)x + 8) = D_2456 + (D_2459 * -2.0e+0) * D_2463;
D_2467 = sqrt (Q);
D_2471 = cos ((theta + 1.25663706143591724639918538741767406463623046875e+1) / 3.0e+0);
*(double*)((uintptr_t)x + 16) = D_2456 + (D_2467 * -2.0e+0) * D_2471;
goto SolveCubicbb_7;
// # SUCC: 7 [100.0%] (fallthru,exec)
SolveCubicbb_4:
// # PRED: 2 [61.0%] (false,exec)
*solutions = 1;
D_2475 = sqrt (R2_Q3);
D_2478 = pow (D_2475 + fabsl(R), 3.33333333333333314829616256247390992939472198486e-1);
if (R < 0.0 != 0)
goto SolveCubicbb_5;
else
goto SolveCubicbb_8;
// # SUCC: 5 [50.0%] (true,exec) 8 [50.0%] (false,exec)
SolveCubicbb_8:
// # PRED: 4 [50.0%] (false,exec)
iftmp_1 = -1.0e+0;
goto SolveCubicbb_6;
// # SUCC: 6 [100.0%] (fallthru)
SolveCubicbb_5:
// # PRED: 4 [50.0%] (true,exec)
iftmp_1 = 1.0e+0;
// # SUCC: 6 [100.0%] (fallthru,exec)
SolveCubicbb_6:
// # PRED: 5 [100.0%] (fallthru,exec) 8 [100.0%] (fallthru)
*x = iftmp_1 * (D_2478 + Q / D_2478) + a1 / -3.0e+0;
// # SUCC: 7 [100.0%] (fallthru,exec)
SolveCubicbb_7:
// # PRED: 3 [100.0%] (fallthru,exec) 6 [100.0%] (fallthru,exec)
return;
// # SUCC: EXIT [100.0%]
}
/***********************************************************
Intermediate representation of
basicmath/app_dir/isqrt.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/* +++Date last modified: 05-Jul-1997 */
#include <string.h>
#include "snipmath.h"
#define BITSPERLONG 32
#define TOP2BITS(x) ((x & (3L << (BITSPERLONG-2))) >> (BITSPERLONG-2))
/* usqrt:
ENTRY x: unsigned long
EXIT returns floor(sqrt(x) * pow(2, BITSPERLONG/2))
Since the square root never uses more than half the bits
of the input, we use the other half of the bits to contain
extra bits of precision after the binary point.
EXAMPLE
suppose BITSPERLONG = 32
then usqrt(144) = 786432 = 12 * 65536
usqrt(32) = 370727 = 5.66 * 65536
NOTES
(1) change BITSPERLONG to BITSPERLONG/2 if you do not want
the answer scaled. Indeed, if you want n bits of
precision after the binary point, use BITSPERLONG/2+n.
The code assumes that BITSPERLONG is even.
(2) This is really better off being written in assembly.
The line marked below is really a "arithmetic shift left"
on the double-long value with r in the upper half
and x in the lower half. This operation is typically
expressible in only one or two assembly instructions.
(3) Unrolling this loop is probably not a bad idea.
ALGORITHM
The calculations are the base-two analogue of the square
root algorithm we all learned in grammar school. Since we're
in base 2, there is only one nontrivial trial multiplier.
Notice that absolutely no multiplications or divisions are performed.
This means it'll be fast on a wide range of processors.
*/
void usqrt(unsigned long int x, struct int_sqrt *q) {
int i;
long unsigned int e;
long unsigned int r;
long unsigned int a;
long unsigned int D_2427;
usqrtbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
a = 0;
i = 0;
r = 0;
// # SUCC: 3 [100.0%] (fallthru,exec)
usqrtbb_3:
// # PRED: 5 [97.0%] (true,exec) 2 [100.0%] (fallthru,exec)
D_2427 = r << 2;
r = (x >> 30) + D_2427;
x = x << 2;
a = a << 1;
e = (a << 1) + 1;
if (r >= e)
goto usqrtbb_4;
else
goto usqrtbb_5;
// # SUCC: 4 [50.0%] (true,exec) 5 [50.0%] (false,exec)
usqrtbb_4:
// # PRED: 3 [50.0%] (true,exec)
r = r - e;
a = a + 1;
// # SUCC: 5 [100.0%] (fallthru,exec)
usqrtbb_5:
// # PRED: 3 [50.0%] (false,exec) 4 [100.0%] (fallthru,exec)
i = i + 1;
if (i != 32)
goto usqrtbb_3;
else
goto usqrtbb_6;
// # SUCC: 3 [97.0%] (true,exec) 6 [3.0%] (false,exec)
usqrtbb_6:
// # PRED: 5 [3.0%] (false,exec)
*(long unsigned int*) q = a;
return;
// # SUCC: EXIT [100.0%]
}
This diff is collapsed.
/***********************************************************
Intermediate representation of
basicmath/app_dir/rad2deg.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/* +++Date last modified: 05-Jul-1997 */
/*
** RAD2DEG.C - Functions to convert between radians and degrees
*/
#include <math.h>
#include "snipmath.h"
#undef rad2deg /* These are macros defined in PI.H */
#undef deg2rad
double rad2deg(double rad) {
rad2degbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
return (rad * 1.8e+2) / 3.14159265358979311599796346854418516159057617188e+0;
// # SUCC: EXIT [100.0%]
}
double deg2rad(double deg) {
deg2radbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
return (deg * 3.14159265358979311599796346854418516159057617188e+0) / 1.8e+2;
// # SUCC: EXIT [100.0%]
}
This diff is collapsed.
/***********************************************************
Intermediate representation of
crc32/app_dir/crc_top.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
#include "crc.h"
#include <stdio.h>
#include "in_data.h"
//#include "in_large.h"
#include "my_variables.h"
DWORD my_crc;
long int my_charcnt;
int main() {
Boolean_T D_2724;
mainbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
D_2724 = crc32file (&in_Data, &my_crc, &my_charcnt);
return (int) D_2724 != 0;
// # SUCC: EXIT [100.0%]
}
/***********************************************************
Intermediate representation of
sha/app_dir/my_mem.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/*
Author - Suhas Chakravarty
memcpy implementation taken from
www.danielvik.com/2010/02/fast-memcpy-in-c.html
Renamed to my_memcpy
Created - 17 Nov 2012
Last modified - 17 Nov 2012
*/
#include <stdlib.h>
void* my_memcpy(void* dest, const void* src, size_t count) {
uintptr_t ivtmp_23;
my_memcpybb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
if (count != 0)
goto my_memcpybb_5;
else
goto my_memcpybb_4;
// # SUCC: 5 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memcpybb_5:
// # PRED: 2 [91.0%] (true,exec)
ivtmp_23 = 0;
// # SUCC: 3 [100.0%] (fallthru)
my_memcpybb_3:
// # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru)
*(char *)((uintptr_t)dest + (uintptr_t)ivtmp_23) = *(char *)((uintptr_t)src + (uintptr_t)ivtmp_23);
ivtmp_23 = ivtmp_23 + 1;
if (ivtmp_23 != count)
goto my_memcpybb_3;
else
goto my_memcpybb_4;
// # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memcpybb_4:
// # PRED: 3 [9.0%] (false,exec) 2 [9.0%] (false,exec)
return (uintptr_t)dest;
// # SUCC: EXIT [100.0%]
}
void* my_memset(void *s, int c, size_t n) {
uintptr_t ivtmp_56;
my_memsetbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
if (n != 0)
goto my_memsetbb_5;
else
goto my_memsetbb_4;
// # SUCC: 5 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memsetbb_5:
// # PRED: 2 [91.0%] (true,exec)
ivtmp_56 = 0;
// # SUCC: 3 [100.0%] (fallthru)
my_memsetbb_3:
// # PRED: 3 [91.0%] (true,exec) 5 [100.0%] (fallthru)
*(char *)((uintptr_t)s + (uintptr_t)ivtmp_56) = (char) (char) c;
ivtmp_56 = ivtmp_56 + 1;
if (ivtmp_56 != n)
goto my_memsetbb_3;
else
goto my_memsetbb_4;
// # SUCC: 3 [91.0%] (true,exec) 4 [9.0%] (false,exec)
my_memsetbb_4:
// # PRED: 3 [9.0%] (false,exec) 2 [9.0%] (false,exec)
return (uintptr_t)s;
// # SUCC: EXIT [100.0%]
}
This diff is collapsed.
/***********************************************************
Intermediate representation of
sha/app_dir/sha_driver.c
Converted by ir2c v0.1
***********************************************************/
#include <limits.h>
#include <stdint.h>
#include "ir2c.h"
/* NIST Secure Hash Algorithm */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "sha.h"
#include "in_small.h"
#include "my_variable.h"
SHA_INFO sha_info; //making global
int main() {
mainbb_2:
// # PRED: ENTRY [100.0%] (fallthru,exec)
sha_stream (&sha_info, &in_Data, ARR_SIZE);
return 0;
// # SUCC: EXIT [100.0%]
}
...@@ -14,7 +14,7 @@ from display_cfg import display_cfgs ...@@ -14,7 +14,7 @@ from display_cfg import display_cfgs
## Global Variables ## Global Variables
###################################################### ######################################################
COND_EXEC_BLOCKLEN_THRESH = 4 COND_EXEC_BLOCKLEN_THRESH = 6
app = None app = None
...@@ -183,7 +183,7 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC): ...@@ -183,7 +183,7 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC):
succBlockISC = cfgISC.listBlocks[listSuccBlocksISC[0]] succBlockISC = cfgISC.listBlocks[listSuccBlocksISC[0]]
if (succBlockISC.isReturning == 1): if (succBlockISC.isReturning == 1):
logging.debug("/t OBJ:%s returns, and is mapped to ISC:%s" logging.debug("/t OBJ:%s returns, and is mapped to ISC:%s"
% (blockObj.name, succBlockObj.name)) % (blockObj.name, succBlockISC.name))
blockISC.mapsTo.append(blockIndObj) blockISC.mapsTo.append(blockIndObj)
succBlockISC.mapsTo.append(blockIndObj) succBlockISC.mapsTo.append(blockIndObj)
blockObj.mapsTo.append(blockIndISC) blockObj.mapsTo.append(blockIndISC)
...@@ -288,7 +288,8 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC): ...@@ -288,7 +288,8 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC):
return -1 return -1
# If none of the blocks return, it means we have to continue the DFT # If none of the blocks return, it means we have to continue the DFT
if(len(listSuccBlocksWOBackEdgeISC) != len(listSuccBlocksWOBackEdgeObj)) and blockObj.hasConditionalExec == 1: # len(listSuccBlocksWOBackEdgeISC) != len(listSuccBlocksWOBackEdgeObj) and
if blockObj.hasConditionalExec == 1:
# Check that length of each successor block is less than threshold for Conditional Execution # Check that length of each successor block is less than threshold for Conditional Execution
lenLongestSuccBlock = 0 lenLongestSuccBlock = 0
...@@ -386,75 +387,55 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC): ...@@ -386,75 +387,55 @@ def mapping(cfgISC, blockIndISC, cfgObj, blockIndObj, mergedLevelsISC):
if len(listSuccBlocksISC) == len(listSuccBlocksObj): if len(listSuccBlocksISC) == len(listSuccBlocksObj):
logging.debug("\t %s::%s length of successors is same, trying DFT" % logging.debug("\t %s::%s length of successors is same, trying DFT" %
(blockISC.name, blockObj.name)) (blockISC.name, blockObj.name))
succBlocISCkMatchingFound = 0 allSuccBlocksISCMatchingFound = 1
for succBlockIndISC in listSuccBlocksISC: for succBlockIndISC in listSuccBlocksISC:
# stackEntryISC = find(lambda stackEntry: stackEntry[0] == succBlockIndISC, mappingStackISC)
# if stackEntryISC != None:
# # look for all successors of blockObj which are in the stack,
# # and check if the succBlockIndISC maps to the obj node
# backEdgeMatched = 0
# for succBlockIndObj in listSuccBlocksObj:
# stackEntryObj = find(lambda stackEntry: stackEntry[0] == succBlockIndObj, mappingStackObj)
# if stackEntryObj != None:
# if (succBlockIndObj in stackEntryISC[1] and
# succBlockIndISC in stackEntryObj[1]):
# # back edge matched!
# logging.debug("%s::%s Back Edge to %s::%s matched!" %
# (blockISC.name, blockObj.name,
# cfgISC.listBlocks[succBlockIndISC].name,
# cfgObj.listBlocks[succBlockIndObj].name))
# backEdgeMatched = 1
# succBlocISCkMatchingFound = 1
# break
# if backEdgeMatched == 1:
# continue
# else:
# logging.error("%s::%s ISC block has back edge, that could not be matched to Obj Block" %
# (blockISC.name, blockObj.name))
# succBlocISCkMatchingFound = 0
# break
succBlockISCMatchFoundUsingDFT = 0 succBlockISCMatchFoundUsingDFT = 0
for succBlockIndObj in listSuccBlocksObj: for succBlockIndObj in listSuccBlocksObj:
# stackEntryObj = find(lambda stackEntry: stackEntry[0] == succBlockIndObj, mappingStackObj) if cfgObj.listBlocks[succBlockIndObj].mapsTo:
# if stackEntryObj != None: if succBlockIndISC in cfgObj.listBlocks[succBlockIndObj].mapsTo:
# # TODO: Check for some trouble # Both have already been mapped.
# # We should just skip this back edge succBlockISCMatchFoundUsingDFT = 1
# continue break # to continue matching the next successor in ISC
else:
logging.debug("\t\t %s::%s Trying DFT on %s::%s" % # Obj has been mapped to some other node.
(blockISC.name, blockObj.name, continue
cfgISC.listBlocks[succBlockIndISC].name,
cfgObj.listBlocks[succBlockIndObj].name))
mappingStackISC.append((succBlockIndISC, [succBlockIndObj]))
mappingStackObj.append((succBlockIndObj, [succBlockIndISC]))
if (mapping(cfgISC, succBlockIndISC,
cfgObj, succBlockIndObj,
mergedLevelsISC) == 0):
cfgISC.listBlocks[succBlockIndISC].mapsTo.append(blockIndObj)
cfgObj.listBlocks[succBlockIndObj].mapsTo.append(blockIndISC)
mappingStackISC.pop()
mappingStackObj.pop()
succBlockISCMatchFoundUsingDFT = 1
succBlocISCkMatchingFound = 1
break
else: else:
mappingStackISC.pop() # Obj blocked hasn't yet been mapped. Try mapping
mappingStackObj.pop() logging.debug("\t\t %s::%s Trying DFT on %s::%s" %
continue # to try to match next successor of blockObj with current successor of blockISC (blockISC.name, blockObj.name,
cfgISC.listBlocks[succBlockIndISC].name,
cfgObj.listBlocks[succBlockIndObj].name))
mappingStackISC.append((succBlockIndISC, [succBlockIndObj]))
mappingStackObj.append((succBlockIndObj, [succBlockIndISC]))
if (mapping(cfgISC, succBlockIndISC,
cfgObj, succBlockIndObj,
mergedLevelsISC) == 0):
cfgISC.listBlocks[succBlockIndISC].mapsTo.append(succBlockIndObj)
cfgObj.listBlocks[succBlockIndObj].mapsTo.append(succBlockIndISC)
mappingStackISC.pop()
mappingStackObj.pop()
succBlockISCMatchFoundUsingDFT = 1
break
else:
succBlockISCMatchFoundUsingDFT = 0
mappingStackISC.pop()
mappingStackObj.pop()
continue # to try to match next successor of blockObj with current successor of blockISC
if succBlockISCMatchFoundUsingDFT == 1: if succBlockISCMatchFoundUsingDFT == 1:
logging.debug("\t\t %s::%s DFT: Found matching for %s::%s" % logging.debug("\t\t %s::%s DFT: Found matching for %s::%s" %
(blockISC.name, blockObj.name, (blockISC.name, blockObj.name,
cfgISC.listBlocks[succBlockIndISC].name, cfgISC.listBlocks[succBlockIndISC].name,
cfgObj.listBlocks[succBlockIndObj].name)) cfgObj.listBlocks[succBlockIndObj].name))
succBlockISCMatchFoundUsingDFT = 0
continue # to match next blockISC continue # to match next blockISC
else: else:
logging.error("\t\t %s::%s DFT: Matching obj block for ISC block not found!" % logging.error("\t\t %s::%s DFT: Matching obj block for ISC block not found!" %
(blockISC.name, blockObj.name)) (blockISC.name, blockObj.name))
succBlocISCkMatchingFound = 0 allSuccBlocksISCMatchingFound = 0
break break
if succBlocISCkMatchingFound == 1: if allSuccBlocksISCMatchingFound == 1:
# Mapping was found for each successor block of blockISC # Mapping was found for each successor block of blockISC
blockISC.mapsTo.append(blockIndObj) blockISC.mapsTo.append(blockIndObj)
blockObj.mapsTo.append(blockIndISC) blockObj.mapsTo.append(blockIndISC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment