Bug 1084 - interesting pysvp64dis bug (in power_insn.py)
Summary: interesting pysvp64dis bug (in power_insn.py)
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Source Code (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Dmitry Selyutin
URL:
Depends on:
Blocks: 1056
  Show dependency treegraph
 
Reported: 2023-05-14 17:32 BST by Luke Kenneth Casson Leighton
Modified: 2023-05-28 19:07 BST (History)
1 user (show)

See Also:
NLnet milestone: ---
total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation:
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2023-05-14 17:32:01 BST
test.s:

sv.ldu/ff=~RC1/vli *16, 0(*17)

powerpc64le-linux-gnu-as /tmp/test.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 

....
    RA (vector)
        0000000000000
        43, 44, 45, 46, 47, 22, 23, 22, 23, 22, 23, 22, 23
        extra3<generator object ExtendableOperand.extra_idx at 0x7f7ce3f1c570>
Comment 1 Luke Kenneth Casson Leighton 2023-05-15 11:17:17 BST
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=aaa074c780af29367c582c386eb722884f00338f

found the duplicates in EXTRA3 overlap where
one of the EXTRA_IDX batch was a source RA
and another was a destination RA.

this caused chaos. now all sorted

    RA (vector)
        1111000
        43, 44, 45, 46, 47, 22, 23
Comment 2 Luke Kenneth Casson Leighton 2023-05-15 20:37:21 BST
same thing:

sv.cmp/ff=eq *4,1,*0,1


    BF (vector)
        00100
        38, 39, 40, 19, 20, {0}, {0}
        extra3<generator object ExtendableOperand.extra_idx at 0x7f9b7694b840>
Comment 3 Luke Kenneth Casson Leighton 2023-05-15 20:40:24 BST
https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=a30a56853db7a8754bcbc8d8122f7a35d15c37b1

sorted out RA and RT but did not sort out BF
Comment 4 Luke Kenneth Casson Leighton 2023-05-15 20:47:30 BST
copied the code that was duplicated for CROps disassembly

https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=2b60ad1a303817558f339e51549682b207863214
Comment 5 Dmitry Selyutin 2023-05-28 17:50:13 BST
The recent changes broke some insndb scenarios (most notably sv_binutils script). Fixed in master: https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=9746c94bdaad3a077c8d8f9965e6baeda152f476.
Comment 6 Luke Kenneth Casson Leighton 2023-05-28 19:07:54 BST
(In reply to Dmitry Selyutin from comment #5)
> The recent changes broke some insndb scenarios (most notably sv_binutils
> script). Fixed in master:
> https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;
> h=9746c94bdaad3a077c8d8f9965e6baeda152f476.

yeah that makes sense, it was there originally in sv/trans/svp64.py
to have source operands different from destination.  although
really they should not be different EXTRA indices, that experiment
is nixed.