autodoc: add some tags

This commit is contained in:
Vallahor 2022-06-03 21:13:34 -03:00 committed by Andrew Kelley
parent f13db1ce18
commit f189e46b8e
2 changed files with 22 additions and 1 deletions

View File

@ -1114,7 +1114,6 @@ var zigAnalysis;
return exprName(sliceIndex, opts);
}
case "cmpxchg":{
console.log(expr);
const typeIndex = zigAnalysis.exprs[expr.cmpxchg.type];
const ptrIndex = zigAnalysis.exprs[expr.cmpxchg.ptr];
const expectedValueIndex = zigAnalysis.exprs[expr.cmpxchg.expected_value];
@ -1195,6 +1194,7 @@ var zigAnalysis;
const param_expr = zigAnalysis.exprs[expr.builtin.param];
let param = exprName(param_expr, opts);
let payloadHtml = "@";
switch (expr.builtin.name) {
case "align_of": {
@ -1324,6 +1324,21 @@ var zigAnalysis;
case "bit_not": {
return "~" + param;
}
case "clz": {
return "@clz(T" + ", " + param + ")";
}
case "ctz": {
return "@ctz(T" + ", " + param + ")";
}
case "pop_count": {
return "@popCount(T" + ", " + param + ")";
}
case "byte_swap": {
return "@byteSwap(T" + ", " + param + ")";
}
case "bit_reverse": {
return "@bitReverse(T" + ", " + param + ")";
}
default: console.log("builtin function not handled yet or doesn't exist!");
};
return payloadHtml + "(" + param + ")";

View File

@ -1357,6 +1357,12 @@ fn walkInstruction(
.minimum,
.maximum,
.bit_not,
// @check
.clz,
.ctz,
.pop_count,
.byte_swap,
.bit_reverse,
=> {
const un_node = data[inst_index].un_node;
const bin_index = self.exprs.items.len;