<div dir="ltr"><div><div><div><div>Hi Martin,<br><br></div>If I'm reading your question correctly, there are really two aspects to what you're suggesting:<br></div>1. A compiler emits a CPU description in some standardized form<br></div>2. A compiler that takes such CPU descriptions as input to generate a back end<br><br></div>As Dean suggested, I believe you can get reasonably good results for number 1. by writing a TblGen-like tool to interpret Target Description files. Number 2. on the other hand is probably not doable in general. I don't really think it is feasible to have a generic tool that will simply take a CPU description as input and emit a functioning back end to hook to a target-independent compiler.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 4:46 PM, Dean Michael Berris via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On 15 Jul 2016, at 16:33, Martin Vahi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
><br>
> I'm just trying to get an<br>
> overview of a greater picture, I'm<br>
> currently not working on any compiler<br>
> porting or CPU development, but could<br>
> someone please tell, if there exists in LLVM or<br>
> some other compiler a feature, where<br>
> different CPU-vendors offer some standardized<br>
> XML/JSON/YAML file that describes the CPU's<br>
> parameters, registers, commands in some formal<br>
> manner and compilers that support that CPU<br>
> description format, can just import that CPU-description<br>
> a bit like bookmarks are imported to web browsers<br>
> and importing/loading of the formal CPU-description<br>
> would be all that is needed to port the compiler<br>
> to that CPU?<br>
><br>
> The file would describe register names, register<br>
> widths, what command works with what register, etc.<br>
> Practically the CPU-description file would be<br>
> written in some domain specific language even if the<br>
> syntax is XML/JSON/YAML. Again, the idea is that<br>
> if web browsers are able to configure the GUI<br>
> according to HTML, then compilers might configure<br>
> their back-ends according to the CPU-description file.<br>
<br>
</span>I'm not aware of any such existing document/resource, but I think it would really be a nice resource to have just as a catalogue of what's out there. I suspect someone just hasn't done this, or if someone has then that it isn't that popular nor accessible.<br>
<br>
What I do know is that in LLVM you can look at the existing targets described in tablegen files scattered around. It's not exactly XML but I think you can probably come up with a generator that takes the tablegen inputs and generates an XSD (or equivalent) and an XML document according to that generated schema. The tutorials on tablegen should be helpful in that regard.<br>
<span class=""><br>
><br>
> The CPU description file might even be part of the<br>
> internal test suite of the CPU-vendor during the<br>
> development of the CPU. Why the duplication of effort<br>
> at describing the programming interface specification<br>
> of the CPU, first at the CPU-vendor side and later<br>
> at the compiler side?<br>
> After all, it is CERTAIN that at least SOME COMPILER<br>
> is needed to make any CPU useful at all, with the<br>
> exception of some really tiny micro-controllers that<br>
> might be usable with ASM alone, but even among<br>
> micro-controllers those are a rarity.<br>
><br>
<br>
</span>At least for what's in LLVM already, you should be able to do this if you're so inclined. :)<br>
<span class=""><br>
> I hope to be the most stupid person on this list,<br>
> despite hoping that my current letter is smart enough<br>
> to deserve an answer. :-/<br>
><br>
<br>
</span>I tried, hopefully that helps (also, note, I'm also a newbie here). :)<br>
<br>
Cheers<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>