>
> +void trencoder_report_branch(Object *trencoder_obj, uint64_t pc, bool
> taken)
> +{
> + TraceEncoder *te = TRACE_ENCODER(trencoder_obj);
> +
> + /*
> + * Note: the e-trace spec determines the value '1' for a
> + * branch *not* taken. The helper API is using taken = 1
> + * to be more intuitive when reading TCG code.
> + */
> + if (!taken) {
> + te->branch_map = deposit32(te->branch_map, te->branches, 1, 1);
> + }
> +
> + te->last_branch_pc = pc;
> + te->branches++;
> +
> + if (te->branches == TRACE_MAX_BRANCHES) {
> + trencoder_send_branch_map(trencoder_obj);
> + te->branches = 0;
>
Should we clear branch_map after sending the packet, or explicitly write
0 for taken branches using deposit32(te->branch_map, te->branches, 1, 0)?
Thanks
Jay Chang