[Libre-soc-bugs] [Bug 1115] rldimi "mb" offset by 1 bit

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Jun 7 12:59:28 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=1115

--- Comment #3 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
start with this:

echo "rldimi. 3,4,56,8" >> /tmp/test.s

then run these:

pysvp64asm /tmp/test.s /tmp/py.s
powerpc64le-linux-gnu-as /tmp/py.s -o /tmp/test.o
powerpc64le-linux-gnu-objcopy -Obinary /tmp/test.o /tmp/bin.o
powerpc64le-linux-gnu-objdump -dr /tmp/test.o 
pysvp64dis -v /tmp/bin.o 

and the output is:

   0:   0f c2 83 78     rldimi. r3,r4,56,8
0f c2 83 78    rldimi. r3,r4,56,16
    spec
        rldimi. RA,RS,sh,mb Rc=1
    pcode
        n <- sh
        r <- ROTL64((RS), n)
        b <- mb[5] || mb[0:4]
        m <- MASK(b,  ¬n)
        RA <- r&m | (RA)& ¬m
    binary
        [0:8]   01111000
        [8:16]  10000011
        [16:24] 11000010
        [24:32] 00001111
    opcodes
        011110---------------------011-1
    PO
        011110
        0, 1, 2, 3, 4, 5
    XO
        011
        27, 28, 29
    Rc
        1
        31
    RA (scalar)
        00011
        11, 12, 13, 14, 15
    RS (scalar)
        00100
        6, 7, 8, 9, 10
    sh
        111000
        30, 16, 17, 18, 19, 20
    mb
        010000
        21, 22, 23, 24, 25, 26


now let's do "rldimi. r3,r4,56,32":

   0:   2f c0 83 78     rldimi. r3,r4,56,32
2f c0 83 78    rldimi. r3,r4,56,1
    spec
        rldimi. RA,RS,sh,mb Rc=1
    pcode
        n <- sh
        r <- ROTL64((RS), n)
        b <- mb[5] || mb[0:4]
        m <- MASK(b,  ¬n)
        RA <- r&m | (RA)& ¬m
    binary
        [0:8]   01111000
        [8:16]  10000011
        [16:24] 11000000
        [24:32] 00101111
    opcodes
        011110---------------------011-1
    PO
        011110
        0, 1, 2, 3, 4, 5
    XO
        011
        27, 28, 29
    Rc
        1
        31
    RA (scalar)
        00011
        11, 12, 13, 14, 15
    RS (scalar)
        00100
        6, 7, 8, 9, 10
    sh
        111000
        30, 16, 17, 18, 19, 20
    mb
        000001
        21, 22, 23, 24, 25, 26

and, ahhh mb has bit 0 in the wrong place.

it looks like Operand-Decode of mb is out

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/shift_rot/shift_rot_cases.py;h=71a5ce#l159

damn, there's no "ExpectedResults".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list