On 08/15/2015 11:16 AM, Chen Gang wrote:
But what you said is really quite valuable to me!! we can treat the flag
as a caller saved context, then can let the caller can use callee freely
(in fact, I guess, the real hardware treats it as caller context, too).
- we have to define the flag format based on the existing format in the
related docs and tilegx.md (reserve 0-20 and 25-31 bits).
- We can only use 21-24 for mark addsub, mul, or typecast result. If
21-24 bits are all zero, it means typecast result. For fsingle: 32-63
bits is the input integer; for fdouble: srca is the input integer.
Plausible.
- For addsub and mul result, we use 32-63 bits for an index of resource
handler (like 'fd' returned by open). fsingle_addsub2, fsingle_mul1,
fdouble_mul_flags, fdouble_addsub allocate resource, and pack1 free.
No, that's a bad idea. No state external to the inputs to the insns.