|
| From: | Richard Henderson |
| Subject: | Re: [Qemu-ppc] [PATCH 2/6] target-ppc: Implement darn instruction |
| Date: | Mon, 8 Aug 2016 10:31:32 +0530 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
On 08/07/2016 11:06 PM, Nikunj A Dadhania wrote:
+target_ulong helper_darn(uint32_t l)
+{
+ target_ulong r = UINT64_MAX;
+
+ if (l <= 2) {
+ do {
+ r = random() * random();
+ r &= l ? UINT64_MAX : UINT32_MAX;
+ } while (r == UINT64_MAX);
+ }
+
+ return r;
+}
Without considering the rng, I think you should split this into darn32 and darn64 based on L in translate.c. You can diagnose l==2 in translate.c as well.
r~
| [Prev in Thread] | Current Thread | [Next in Thread] |