From c23a608e97a14e18564e806f1a2921cdeb079606 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 26 Jul 2022 16:04:29 +0100 Subject: [PATCH] annoying. DX-Form is one exception to the rule of having the immediate be directly actual fields. the immediate has to be "de-constructed" before fitting into its places, d0 d1 and d2 --- src/openpower/sv/trans/svp64.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/openpower/sv/trans/svp64.py b/src/openpower/sv/trans/svp64.py index 1a39f091..f669f0d1 100644 --- a/src/openpower/sv/trans/svp64.py +++ b/src/openpower/sv/trans/svp64.py @@ -338,15 +338,20 @@ def fmvis(fields): # |0 |6 |7|8|9 |10 |11|12|13 |15|16|17 |26|27 |31 | # | PO | FRS | d1 | d0 | XO |d2 | PO = 22 - XO = 0b000011 + XO = 0b00011 Rc = 0 (FRS, imm) = fields + # first split imm into d1, d0 and d2. sigh + d2 = (imm & 1) # LSB (0) + d1 = (imm >> 1) & 0b11111 # bits 1-5 + d0 = (imm >> 6) # MSBs 6-15 return instruction( (PO , 0 , 5), (FRS, 6 , 10), - (imm, 11, 26), + (d1, 11, 15), + (d0, 16, 26), (XO , 27, 30), - (Rc , 31, 31), + (d2 , 31, 31), ) -- 2.30.2