On 07/21/2016 01:41 PM, Nikunj A Dadhania wrote:
It would probably be better to use helper functions for both div and mod,
because of the branches required.

C.f. target-arm/helper-a64.c, helper_sdiv64 et al.

What is the thumb rule to implement it has helper?
As I am implementing other instructions as well.

One as you suggested many branches.

Branches, or more than, say, 15 tcg instructions.

The former rule is primarily because branches inhibit all tcg optimization.

The latter rule is more flexible, depending on how many of them you expect may be able to optimize away. For ppc, I would expect few dead code opportunities; those are more for cisc targets that compute flags with every instruction.


r~

Reply via email to