Re: [llvm-dev] Tablegen backend for emulator core?

31 views
Skip to first unread message

swym via llvm-dev

unread,
Apr 18, 2021, 1:30:32 PM4/18/21
to llvm...@lists.llvm.org, simon...@embecosm.com
First off: sorry for CCing, I was not subscribed to llvm-dev in March so couldn't reply directly...

I've been following the discussion and was wondering if either of is aware of Ghidra's slaspec: it specifies instruction encoding along with instruction semantics through what they call pcode. For instructions that go beyond what a simple RTL can express, like flushing caches or alike, you can define custom pcode functions whose actual implementation you can fill in yourself. See [1] for an example.

This means that for code that don't require custom pcode functions, you bascially get emulation for free. See [2] for the C++ code needed to do emulation. In the C++ code, you can also provide the implementation of custom pcode functions.

Dabbling with the PPC backend's TableGen files myself from time to time, I find myself wishing there was something to sleigh's p-code and your discussion immediately rang a dozen bells ;)

Redards,

Thomas




Reply all
Reply to author
Forward
0 new messages