Mill Computing, Inc. Forums The Mill Architecture Execution Reply To: Execution

Ivan Godard
Keymaster
Post count: 629

I think you meant:
if((a==b) && (c==D)) ||(d==a))
then that becomes:
brtr(<d==a>, <then>), brfl(<a==b>, <else>), brtr(<c==D>, <then>), br(<else>);
i.e. one instruction if you have four branch units.

Note that this code assumes that reordering the arguments of a conjunction or disjunction is permitted, which is true in some languages. If not permitted (as in C), you would use:

    brfl(<a==b>, <disj>), brtr(<c==D>, <then>), br(<disj>);
disj:
    brtr(<d==a>, <then>), br(<else>);

This code ensures correct C semantics if one of the predicates is a NaR.

  • This reply was modified 8 years, 7 months ago by  Ivan Godard.
  • This reply was modified 8 years, 7 months ago by  Ivan Godard.