Skip to content
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

ESP32-S3 SIMD instructions misassembled (LLVM-368) #101

Open
Noxime opened this issue Sep 4, 2024 · 3 comments
Open

ESP32-S3 SIMD instructions misassembled (LLVM-368) #101

Noxime opened this issue Sep 4, 2024 · 3 comments
Assignees
Labels
Resolution: Done Status: Done Issue is done internally

Comments

@Noxime
Copy link

Noxime commented Sep 4, 2024

After running into some IllegalInstruction exceptions, I found that a number of the PIE instructions on the ESP32-S3 have the wrong instruction format. As an example, the EE.VADDS.S8.LD.INCP has wrong definition:

XtensaS3DSPInstrInfo.td

let Inst{28-23} = 0x38;
let Inst{22-20} = qu{2-0};
let Inst{19-17} = qa{2-0};
let Inst{16-14} = qx{2-0};
let Inst{13-11} = qy{2-0};
let Inst{10-4} = 0x1c;
let Inst{3-0} = as{3-0};

This does not match the instruction format from the ESP32-S3 TRM:
111000 qu[2:1] qy[0] 001 qu[0] qa[2:0] qx[1:0] qy[2:1] 1100 as[3:0] 111 qx[2]

I haven't gathered a comprehensive list, but I suspect all the instructions with format EE_Inst32 and let Inst{28-... in their body are defective, since they don't define all instruction bits (and by quick glance, have the fields in wrong places). Generally, all combined math+memory instructions (32 bit *.[LD/ST].[INCP/IP/XP])

I can PR the fixes to these tablegen files myself, but the file says it's been generated from something called AI_S6_V2.h, which cannot be found anywhere on the internet. Should this be fixed in that Espressif-internal file, or can I submit changes to the .td file manually?

@github-actions github-actions bot changed the title ESP32-S3 SIMD instructions misassembled ESP32-S3 SIMD instructions misassembled (LLVM-368) Sep 4, 2024
@sstefan1
Copy link
Collaborator

sstefan1 commented Sep 4, 2024

Hi! I'm not sure I can share the file. Apparently the file seems to be wrong here. As soon as we fix the file, I'll commit the fixed tablegen definitions.

@espressif-bot espressif-bot added Status: In Progress work is in progress and removed Status: Opened labels Sep 5, 2024
@sstefan1
Copy link
Collaborator

Hi @Noxime! The fix for this is now merged. Please check it out.

@Noxime
Copy link
Author

Noxime commented Oct 16, 2024

Hi @Noxime! The fix for this is now merged. Please check it out.

Woo, thank you!

@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: Done and removed Status: In Progress work is in progress labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants