> > I moved to helper2.c because AFAICT helper.c is compiled with the same > > sort of restrictions as op.c which leads to the compile failure. > > Yes, helper.c is compiled with the global register variables and the code > is called directly from the op_xxx functions, but one needs the global > register variables to access global data, these contain the required > environment for the emulation. AFAIK helper2.c is used by the CODE_COPY > branch on i386 with even stronger restrictions, but I may be wrong here.
helper.c is compiled with the same setting as op.c, so has direct access to the dyngen state ("T0", "env" etc). helper2.c is regular code. Either may be used from op.c, the difference is whether all arguments are explicit. Also, if a helper throws an exception it must be in helper.c to avoid clobbering CPU state before calling raise_exception. Note that some targets use a different naming scheme. They use helper.c for regular code and op_helper.c for op.c-like code. IMHO this is a much better naming scheme. Paul