TL;DR: I am trying to implement a new calling convention for X86 with
an associated new return instruction. I am getting stuck with the
error listed towards the end and not sure where I need to make a
change. I have included the changes I have made. Any help is appreciated.
(In addition to finding out how to get past this error, I also would
love a pointer on how to generate a two-byte opcode for my new
instruction, e.g., 0xF0 0x3F. In the code below you can see that I am
currently just generating 0xF0. Thank-you.)
The rest of the note is:
-
Overview of changes I made to clang
-
Overview of changes I made to llvm
-
C file I am trying to compile
-
Error I get from executing llc
-
The llvm IR for the C file
-
The detailed list of changes I made to llvm
-
The detailed list of changes I made to clang
-
OVERVIEW OF CHANGES I MADE TO CLANG
In the front-end I added a new attribute: __attribute__ ((new_interrupt))
. I am fairly confident I touched all the places I
needed to, but all the changes I made in Attr.td, SemaDeclAttr.cpp,
SemaExpr.cpp, AttrDocs.td, and DiagnosticSemaKinds.td are listed at
the very end under ‘CHANGES TO CLANG:’
- OVERVIEW OF CHANGES I MADE TO LLVM
In llvm I am sure I have either made incorrect changes or am still
missing changes I need to make. The overview is I added new defs for
my new X86 instructions, a new calling convention, code to detect the
attribute, and some new asm and LL tokens. Yet, when I compile:
- C FILE I AM TRYING TO COMPILE