+static ast_expression *intrin_isnan(parser_t *parser) {
+ /*
+ * float isnan(float x) {
+ * float local;
+ * local = x;
+ *
+ * return (x != local);
+ * }
+ */
+ static ast_value *value = NULL;
+
+ if (!value) {
+ ast_value *arg1 = ast_value_new (parser_ctx(parser), "x", TYPE_FLOAT);
+ ast_value *local = ast_value_new (parser_ctx(parser), "local", TYPE_FLOAT);
+ ast_block *body = ast_block_new (parser_ctx(parser));
+ ast_function *func = NULL;
+
+ INTRIN_VAL(value, "isnan", func, "<float>", TYPE_FLOAT);
+
+ vec_push(body->locals, local);
+ vec_push(body->exprs,
+ (ast_expression*)ast_store_new(
+ parser_ctx(parser),
+ INSTR_STORE_F,
+ (ast_expression*)local,
+ (ast_expression*)arg1
+ )
+ );
+
+ vec_push(body->exprs,
+ (ast_expression*)ast_return_new(
+ parser_ctx(parser),
+ (ast_expression*)ast_binary_new(
+ parser_ctx(parser),
+ INSTR_NE_F,
+ (ast_expression*)arg1,
+ (ast_expression*)local
+ )
+ )
+ );
+
+ vec_push(value->expression.params, arg1);
+
+ vec_push(func->blocks, body);
+
+ INTRIN_REG(func, value);
+ }
+
+ return (ast_expression*)value;
+}
+
+static ast_expression *intrin_debug_typestring(parser_t *parser) {
+ (void)parser;
+ return (ast_expression*)0x1;
+}
+