| Summary: | switch reference assembler to machine-readable specs | ||
|---|---|---|---|
| Product: | Libre-SOC's first SoC | Reporter: | Dmitry Selyutin <ghostmansd> |
| Component: | Source Code | Assignee: | Dmitry Selyutin <ghostmansd> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | libre-soc-bugs, lkcl |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://bugs.libre-soc.org/show_bug.cgi?id=939 https://bugs.libre-soc.org/show_bug.cgi?id=550 |
||
| NLnet milestone: | NLnet.2021-08-071.cavatools | total budget (EUR) for completion of task and all subtasks: | 5500 |
| budget (EUR) for this task, excluding subtasks' budget: | 5500 | parent task for budget allocation: | 939 |
| child tasks for budget allocation: | 948 949 950 | The table of payments (in EUR) for this task; TOML format: |
[ghostmansd]
amount=5500
submitted=2023-03-06
paid=2023-03-10
|
| Bug Depends on: | |||
| Bug Blocks: | 939 | ||
|
Description
Dmitry Selyutin
2022-10-13 17:11:47 BST
Updated the title, since this must be done for both binutils and pysvp64asm. We're moving towards cool assembly and disassembly! Word instructions are (mostly?) complete; and SVP64 instructions are on the way. I started with operands, since I still remember how they work and I'd really like to complete them until I forget it. Then I'll address opmodes. There are too many changes to recall, but these are major ones: 1. We now support GPR and FPR remap on insndb level, including vectors. There must be more checks, like checks for ranges, but anyway. 2. We now support a cool and sweet CR operands assembly syntax, in any of these forms: CR, N*CR, CR*N, BIT+CR, CR+BIT, BIT+N*CR, N*CR+BIT, etc. Again, the strict checks are to be added later. 3. Disassembly now supports that syntax too, including our home-grown "<CR>.<COND>" syntax. An example is below. Be sure to use the latest binutils, since I fixed some issues in the scope of this task. $ cat /tmp/test.s && INSNDB=true SILENCELOG=true pysvp64asm /tmp/test.s /tmp/py.s && echo "### PYSVP64ASM ###" && cat /tmp/py.s && echo "### BINUTILS ###" && powerpc64le-linux-gnu-as -mlibresoc /tmp/py.s -o /tmp/test.o && powerpc64le-linux-gnu-objcopy -Obinary /tmp/test.o /tmp/bin.o && powerpc64le-linux-gnu-objdump -dr -Mlibresoc /tmp/test.o && echo "### PYSVP64DIS ###" && time pysvp64dis /tmp/bin.o sv.isel 2,3,4,28 sv.isel r2,r3,r4,4*cr7+lt sv.cmpi 5,1,3,2 sv.add *122,56,*3 ### PYSVP64ASM ### .long 0x05400000; .long 0x7C43271E; # sv.isel 2,3,4,28 # sv.isel 2,3,4,28 .long 0x05400000; .long 0x7C43271E; # sv.isel r2,r3,r4,4*cr7+lt # sv.isel r2,r3,r4,4*cr7+lt .long 0x05400000; .long 0x2EA30002; # sv.cmpi 5,1,3,2 # sv.cmpi 5,1,3,2 .long 0x054031E0; .long 0x7FD80214; # sv.add *122,56,*3 # sv.add *122,56,*3 ### BINUTILS ### /tmp/test.o: file format elf64-powerpcle Disassembly of section .text: 0000000000000000 <.text>: 0: 00 00 40 05 sv.isel r2,r3,r4,cr7.lt 4: 1e 27 43 7c 8: 00 00 40 05 sv.isel r2,r3,r4,cr7.lt c: 1e 27 43 7c 10: 00 00 40 05 sv.cmpdi cr5,r3,2 14: 02 00 a3 2e 18: e0 31 40 05 sv.add *r122,r56,*r3 1c: 14 02 d8 7f ### PYSVP64DIS ### 00 00 40 05 sv.isel r2,r3,r4,cr7.lt 1e 27 43 7c 00 00 40 05 sv.isel r2,r3,r4,cr7.lt 1e 27 43 7c 00 00 40 05 sv.cmpi cr1.gt,1,r3,2 02 00 a3 2e e0 31 40 05 sv.add *r122,r56,*r3 14 02 d8 7f OK, we've finally reached some stable point. Only one test appear to be failing in insndb branch: https://salsa.debian.org/Kazan-team/mirrors/openpower-isa/-/jobs/3849625#L11650 This test fails in master as well: https://salsa.debian.org/Kazan-team/mirrors/openpower-isa/-/jobs/3729594#L6734 I consider this task done; any further enhancements should be done in scope of other tasks. Any objections? |