Restore missing cosmopolitan documentation on website

This commit is contained in:
Justine Tunney 2023-07-30 11:05:05 -07:00
parent 58352df0a4
commit d9d5f45e2d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
36 changed files with 715 additions and 228 deletions

View file

@ -1152,19 +1152,6 @@ static int GetSseIntSuffix(Type *ty) {
}
}
static bool IsOverflowArithmetic(Node *node) {
return (node->kind == ND_ADD || node->kind == ND_SUB ||
node->kind == ND_MUL || node->kind == ND_NEG) &&
node->overflow;
}
static void HandleOverflow(const char *ax) {
pop("%rdi");
println("\tmov\t%s,(%%rdi)", ax);
emitlin("\tseto\t%al");
emitlin("\tmovzbl\t%al,%eax");
}
static void HandleAtomicArithmetic(Node *node, const char *op) {
gen_expr(node->lhs);
push();
@ -1238,10 +1225,6 @@ void gen_expr(Node *node) {
}
}
case ND_NEG:
if (IsOverflowArithmetic(node)) {
gen_expr(node->overflow);
push();
}
gen_expr(node->lhs);
switch (node->ty->kind) {
case TY_FLOAT:
@ -1277,9 +1260,6 @@ void gen_expr(Node *node) {
ax = "%eax";
}
println("\tneg\t%s", ax);
if (IsOverflowArithmetic(node)) {
HandleOverflow(ax);
}
return;
case ND_VAR:
gen_addr(node);
@ -1771,10 +1751,6 @@ void gen_expr(Node *node) {
error_tok(node->tok, "invalid expression");
}
}
if (IsOverflowArithmetic(node)) {
gen_expr(node->overflow);
push();
}
if (node->lhs->ty->vector_size == 16) {
gen_expr(node->rhs);
pushx();
@ -2210,9 +2186,6 @@ void gen_expr(Node *node) {
default:
error_tok(node->tok, "invalid expression");
}
if (IsOverflowArithmetic(node)) {
HandleOverflow(ax);
}
}
void gen_stmt(Node *node) {