-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgisel.html
179 lines (170 loc) · 7.12 KB
/
gisel.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AArch64 GISel coverage tests</title>
<script>
function load(label, type) {
fetch("data-" + label + type + ".json")
.then(response => {
if (!response.ok) {
fetch("data-" + label + ".json")
.then(response => response.json())
.then(json => drawTable(json, label))
.catch(reason => console.log(reason));
return Promise.reject()
}
return response.json()
})
.then(json => drawTable(json, label))
.catch(reason => console.log(reason));
}
function reload(type) {
load("int", type)
load("fp", type)
load("castint", type)
load("castfp", type)
load("vec", type)
}
document.addEventListener("DOMContentLoaded", function() {
reload('')
});
function drawTable(json, label) {
var instrs = {};
var tys = []
json.forEach(j => {
instrs[j.instr] ??= {};
instrs[j.instr][j.variant] ??= {};
instrs[j.instr][j.variant][j.ty] = j
if (!tys.includes(j.ty))
tys.push(j.ty);
});
const table = document.getElementById('table-'+label)
table.innerHTML = ""
head = table.createTHead();
tr = head.insertRow(0);
tr.insertCell().outerHTML = "<th>Instr</th>"
tr.insertCell().outerHTML = "<th>Variant</th>"
for (var ty in tys) {
tr.insertCell().outerHTML = "<th>"+escape(tys[ty])+"</th>"
}
body = table.createTBody();
for (var instr in instrs) {
var first = true
for (var variant in instrs[instr]) {
tr = body.insertRow();
if (first) {
tr.insertCell().outerHTML = "<th rowspan='"+Object.keys(instrs[instr]).length+"' valign='top'>"+instr+"</th>"
first = false
}
tr.insertCell().outerHTML = "<th>"+variant+"</th>"
for (var ty in tys) {
cell = tr.insertCell()
j = instrs[instr][variant][tys[ty]]
if (!j) {
cell.innerHTML = "-"
} else {
if (j.gisize == "-1")
cell.innerHTML = "Error"
else
cell.innerHTML = j.gisize - j.size
cell.onclick = function() {
let _j = j
let _label = label
return function() { drawDetails(_label, _j); }
}()
}
}
}
}
}
function escape(s) {
return s.replaceAll('<','<').replaceAll('>','>').replaceAll('#', '\#')
}
function drawDetails(label, j) {
var details = document.getElementById('details-'+label);
txt = "<h3>Details</h3>"
txt += j.instr + " " + j.variant + " " + escape(j.ty) + "\n";
txt += "Measured size:"+j.size+"\n"
txt += "GISel gisize:"+j.gisize+"\n"
txt += "(Costs: thru:"+j.thru+" codesize:"+j.codesize+" lat:"+j.lat+" sizelat:"+j.sizelat+"\n"
txt += "\nIR:\n<code>"+escape(j.ll)+"</code>\n"
txt += "\nAsm:\n<code>"+escape(j.asm)+"</code>\n"
txt += "\nGISel:\n<code>"+escape(j.giasm)+"</code>\n"
details.innerHTML = txt.replaceAll('\n', '<br>');
}
</script>
<style>
h1 {
font-family: verdana;
font-size: 24px;
}
h3 {
font-family: verdana;
font-size: 20px;
}
table {
width: 60%;
margin: 10px auto;
border-collapse: collapse;
background: white;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
th, td {
padding: 10px;
border: 1px solid #ddd;
text-align: left;
}
th {
background-color: #4c79aa;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
td:hover {
background-color: #ddd;
}
code {
font-family: Consolas,"courier new";
}
button:focus {
background: #c3c3c3;
}
</style>
</head>
<body>
<h1>AArch64 GISel coverage tests</h1>
<p>The table lists the difference between the number of instructions generated from gisel vs sdag (+ve means gisel is worse). More details and the asm can be found by clicking on a table entry.</p>
<div style="display: flex border=10px;">
<button onclick="reload('')">Base</button>
<button onclick="reload('-fullfp16')">FP16</button>
<button onclick="reload('-sve2')">SVE</button>
</div>
<h3>Integer diffs</h3>
<div style="display: flex;">
<div width="60%" style="flex: 0 0 60%;"><table id="table-int" class="dataframe" border="1"><th>Loading</th></table></div>
<div width="40%" style="position: sticky; top: 10px; align-self: flex-start; white-space: pre; padding: 10px;" id="details-int"><h3>Details</h3></div>
</div>
<h3>FP diffs</h3>
<div style="display: flex;">
<div width="60%" style="flex: 0 0 60%;"><table id="table-fp" class="dataframe" border="1"><th>Loading</th></table></div>
<div width="40%" style="position: sticky; top: 10px; align-self: flex-start; white-space: pre; padding: 10px;" id="details-fp"><h3>Details</h3></div>
</div>
<h3>Integer-Cast diffs</h3>
<div style="display: flex;">
<div width="60%" style="flex: 0 0 60%;"><table id="table-castint" class="dataframe" border="1"><th>Loading</th></table></div>
<div width="40%" style="position: sticky; top: 10px; align-self: flex-start; white-space: pre; padding: 10px;" id="details-castint"><h3>Details</h3></div>
</div>
<h3>FP-Cast diffs</h3>
<div style="display: flex;">
<div width="60%" style="flex: 0 0 60%;"><table id="table-castfp" class="dataframe" border="1"><th>Loading</th></table></div>
<div width="40%" style="position: sticky; top: 10px; align-self: flex-start; white-space: pre; padding: 10px;" id="details-castfp"><h3>Details</h3></div>
</div>
<h3>Vec diffs</h3>
<div style="display: flex;">
<div width="60%" style="flex: 0 0 60%;"><table id="table-vec" class="dataframe" border="1"><th>Loading</th></table></div>
<div width="40%" style="position: sticky; top: 10px; align-self: flex-start; white-space: pre; padding: 10px;" id="details-vec"><h3>Details</h3></div>
</div>
</body>
</html>