Thanks for your continuing reports. Release 3.0f fixes a bug in xd3_iopt_flush_instructions:
/* If forcing, pick instructions until the list is empty, otherwise this empties 50% of * the queue. */ for (flushed = 0; ! xd3_rlist_empty (& stream->iopt.used); ) { - if ((ret = xd3_iopt_add_encoding (stream, - xd3_rlist_pop_front (& stream->iopt.used)))) { return ret; } - // TODO: what about this fraction?? - if (! force && ++flushed > stream->iopt_size / 2) { break; } + xd3_rinst *renc = xd3_rlist_pop_front (& stream->iopt.used); + if ((ret = xd3_iopt_add_encoding (stream, renc))) + { + return ret; + } + + if (! force) + { + if (++flushed > stream->iopt_size / 2) + { + break; + } + + /* If there are only two instructions remaining, break, because they were + * not optimized. This means there were more than 50% eliminated by the + * loop above. */ + r1 = xd3_rlist_front (& stream->iopt.used); + if (xd3_rlist_end(& stream->iopt.used, r1) || + xd3_rlist_end(& stream->iopt.used, r2 = xd3_rlist_next (r1)) || + xd3_rlist_end(& stream->iopt.used, r3 = xd3_rlist_next (r2))) + { + break; + } + } }
Untitled
No comments yet. -