Sema: clean up zirUnaryMath

* pass air_tag instead of zir_tag
 * also pass eval function so that the branch only happens once and the
   body of zirUnaryMath is simplified
 * Value.sqrt: update to handle f80 and f128 in the normalized way that
   includes handling c_longdouble.

Semi-related change: fix incorrect sqrt builtin name for f80 in stage1.
This commit is contained in:
Andrew Kelley
2022-02-07 16:48:37 -07:00
parent 722d4a11bb
commit a028488384
3 changed files with 44 additions and 67 deletions

View File

@@ -6996,7 +6996,7 @@ static LLVMValueRef ir_render_soft_f80_float_op(CodeGen *g, Stage1Air *executabl
const char *func_name;
switch (instruction->fn_id) {
case BuiltinFnIdSqrt:
func_name = "__sqrt";
func_name = "__sqrtx";
break;
case BuiltinFnIdSin:
func_name = "__sinx";