Permalink
Browse files

* div op and exceptions ("divide by zero", ...) handling added

  • Loading branch information...
mj41 committed May 24, 2007
1 parent c25ebf8 commit 4a75bb4c4ff2eb2183b62ee4bce51d88bb879a37
Showing with 10 additions and 4 deletions.
  1. +7 −0 src/lgp.pir
  2. +3 −4 src/lgp_conf.h
View
@@ -47,6 +47,8 @@ PARAMS_DONE:
# 3 3 3 - 14
# 9 5 3 - 22
+ push_eh EXCEPTION
+
# print "null fitness\n"
save 0
@@ -92,6 +94,7 @@ PARAMS_DONE:
# print "fintess: "
# print I31
# print "\n\n"
+ clear_eh
set_returns "(0)", I31
returncc
@@ -114,6 +117,10 @@ CALC_FITNESS:
# print "\n"
ret
+EXCEPTION:
+ set_returns "(0)", 9999999
+ returncc
+
EOC_LGP
# adding indi core
View
@@ -25,17 +25,16 @@ INTVAL lgp_out_regs[] = {
3
};
-INTVAL check_op_count = 1; // lgp_ops[last] = 16, // ret
-INTVAL lgp_op_count = 15;
+INTVAL lgp_op_count = 17;
opcode_t lgp_ops[] = {
488, // 20 ... abs_i: i(io)
490, // 21 ... abs_i_i: i(o), i(i)
495, // 22 ... add_i_i: i(io), i(i)
499, // 23 ... add_i_i_i: i(o), i(i), i(i)
// 505, // 24 ... cmod_i_i_i: i(o), i(i), i(i)
511, // 25 ... dec_i: i(io)
- // 514, // 26 ... div_i_i: i(io), i(i)
- // 518, // 27 ... div_i_i_i: i(o), i(i), i(i)
+ 514, // 26 ... div_i_i: i(io), i(i)
+ 518, // 27 ... div_i_i_i: i(o), i(i), i(i)
// 524, // 28 ... fdiv_i_i: i(io), i(i)
// 528, // 29 ... fdiv_i_i_i: i(o), i(i), i(i)
540, // 30 ... inc_i: i(io)

0 comments on commit 4a75bb4

Please sign in to comment.