2007-02-02 10:21:41 -05:00
|
|
|
/* -*-c-*- *********************************************************/
|
|
|
|
/*******************************************************************/
|
|
|
|
/*******************************************************************/
|
|
|
|
/**
|
|
|
|
This file is for threaded code.
|
2008-12-09 02:14:13 -05:00
|
|
|
|
2007-02-02 10:21:41 -05:00
|
|
|
----
|
|
|
|
This file is auto generated by insns2vm.rb
|
|
|
|
DO NOT TOUCH!
|
|
|
|
|
|
|
|
If you want to fix something, you must edit 'template/optunifs.inc.tmpl'
|
2014-04-17 02:53:05 -04:00
|
|
|
or tool/insns2vm.rb
|
2007-02-02 10:21:41 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2008-04-02 20:00:48 -04:00
|
|
|
static const int UNIFIED_insn_name_1[] = {id, size, ...};
|
|
|
|
static const int UNIFIED_insn_name_2[] = {id, size, ...};
|
2007-02-02 10:21:41 -05:00
|
|
|
...
|
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const int *const UNIFIED_insn_name[] = {size,
|
2007-02-02 10:21:41 -05:00
|
|
|
UNIFIED_insn_name_1,
|
|
|
|
UNIFIED_insn_name_2, ...};
|
|
|
|
...
|
2008-12-09 02:14:13 -05:00
|
|
|
|
2008-04-02 20:00:48 -04:00
|
|
|
static const int *const *const unified_insns_data[] = {
|
2007-02-02 10:21:41 -05:00
|
|
|
UNIFIED_insn_nameA,
|
|
|
|
UNIFIED_insn_nameB, ...};
|
|
|
|
*/
|
|
|
|
|
2017-08-22 00:22:01 -04:00
|
|
|
% unif_insns_data = @insns.find_all {|insn| !insn.is_sc}.map do |insn|
|
|
|
|
% size = insn.unifs.size
|
|
|
|
% if size > 0
|
|
|
|
% name = "UNIFIED_#{insn.name}"
|
|
|
|
% insn.unifs.sort_by{|unif| -unif[1].size}.each_with_index do |(uni_insn, uni_insns), i|
|
|
|
|
% uni_insns = uni_insns[1..-1]
|
|
|
|
static const int <%=name%>_<%=i%>[] = {
|
|
|
|
BIN(<%=uni_insn.name%>), <%=uni_insns.size + 2%>,
|
|
|
|
<% uni_insns.map{|e| -%>
|
|
|
|
BIN(<%=e.name%>),<% -%>
|
|
|
|
% }
|
|
|
|
|
|
|
|
};
|
|
|
|
% end
|
|
|
|
|
|
|
|
static const int *const <%=name%>[] = {(int *)<%=size+1%>,
|
|
|
|
% size.times do |e|
|
|
|
|
<%=name%>_<%=e%>,
|
|
|
|
% end
|
|
|
|
};
|
|
|
|
% name
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
|
|
|
|
static const int *const *const unified_insns_data[] = {<%#-%>
|
|
|
|
% unif_insns_data.each_with_index do |insn, i|
|
|
|
|
% if (i%8).zero?
|
|
|
|
|
|
|
|
<% -%>
|
|
|
|
% end
|
|
|
|
<%=insn || "0"%>,<%#-%>
|
|
|
|
% end
|
|
|
|
|
|
|
|
};
|
2007-02-02 10:21:41 -05:00
|
|
|
|
|
|
|
#undef GET_INSN_NAME
|
|
|
|
|
2017-08-21 23:07:01 -04:00
|
|
|
ASSERT_VM_INSTRUCTION_SIZE(unified_insns_data);
|