-
Notifications
You must be signed in to change notification settings - Fork 9
Add fixes for LLVM main branch assembly and refactor #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…s an extensino to remove
…BlackFormatter to format Python file
…uces incorrect results
…pported as they can be implemented in the same way as vl1re64 and vs1r
…ould , the one would also be mistakenly replaced with t0
| vd, vs2 = instruction[1], instruction[2] | ||
| vm = ", " + instruction[3] if len(instruction) > 3 else "" | ||
| newline = ( | ||
| "\tvwaddu.vx, {VD}, {VS2}, x0{VM}\n" # unsigned widening add zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused why there are commas behind vwaddu.vx, maybe they are mistakes?
There is another problem here, when I use the original script vs2 can be '[reg]\n', the problem can be solved with letting vs2 be instruction[2].replace("\n","").
| } | ||
| if name in remove_list: | ||
| newline = newline.replace("_" + attribute, "") | ||
| line_changed = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These modified codes will turn former code into latter one, and it will cause gcc compilation error because there is no v0p7.
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_zicsr2p0_zifencei2p0_zve32f1p0_zve32x1p0_zvl32b1p0"
.attribute 5, "rv64i2p0_m2p0_a2p0_f2p0_d2p0_c2p0_zicsr2p0"
This is what the original code will generate.
.attribute 5, "rv64i2p1_m2p0_a2p1_f2p2_d2p2_c2p0_v0p7"
| suggestion += "# Pick unused register e.g. t0\n" | ||
| suggestion += "#\taddi t0, " + AVL + '\n' | ||
| suggestion += "# " + temp + '\n' | ||
| suggestion += f"\taddi t0, x0, {AVL} \n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems delete # is a mistake
The PR has two parts.
The first part is a set of fixes found when converting the assembly generated by the LLVM main branch (using the Jul 25 18:49:38 commit, hash: 7304936479a7eb61adc9edcaf6ce56e4792590ad) to RVV 0.7.1. This has been tested with the riscv-gnu-toolchain XuanTie 10.2 using a simple saxpy program that uses OpenMP SIMD directives on the SG2042 RISC-V Testbed:
vmis empty in the whole register load/store/copyvl*re32andvl*64redidn't include the.vin the whole register load/store/copyuleb128and.addrsiginstructions from roll-backed assemblyaddiinstructionThe second part is a set of refactorings to improve readability and ease of maintenance:
I'm happy to turn this into two separate PRs if preferred.