aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-26 14:44:01 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-26 14:44:01 -0400
commit3085d29af83d07769582f751b3c2f5f36634e34b (patch)
treeab5e72656369bccb19857277707b90ce1fc78ec3 /src/ir_print.cpp
parent5cd4753bea9e8e79bf30217b9d0b7a4485271588 (diff)
parent07c0d484eec327ca3bd1e3ce081c1ced230536a9 (diff)
downloadzig-3085d29af83d07769582f751b3c2f5f36634e34b.tar.gz
zig-3085d29af83d07769582f751b3c2f5f36634e34b.zip
Merge remote-tracking branch 'origin/master' into copy-elision-3
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index 9ba7527417..a973079900 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -1563,15 +1563,32 @@ static void ir_print_mark_err_ret_trace_ptr(IrPrint *irp, IrInstructionMarkErrRe
fprintf(irp->f, ")");
}
-static void ir_print_sqrt(IrPrint *irp, IrInstructionSqrt *instruction) {
- fprintf(irp->f, "@sqrt(");
+static void ir_print_float_op(IrPrint *irp, IrInstructionFloatOp *instruction) {
+
+ fprintf(irp->f, "@%s(", float_op_to_name(instruction->op, false));
if (instruction->type != nullptr) {
ir_print_other_instruction(irp, instruction->type);
} else {
fprintf(irp->f, "null");
}
fprintf(irp->f, ",");
- ir_print_other_instruction(irp, instruction->op);
+ ir_print_other_instruction(irp, instruction->op1);
+ fprintf(irp->f, ")");
+}
+
+static void ir_print_mul_add(IrPrint *irp, IrInstructionMulAdd *instruction) {
+ fprintf(irp->f, "@mulAdd(");
+ if (instruction->type_value != nullptr) {
+ ir_print_other_instruction(irp, instruction->type_value);
+ } else {
+ fprintf(irp->f, "null");
+ }
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->op1);
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->op2);
+ fprintf(irp->f, ",");
+ ir_print_other_instruction(irp, instruction->op3);
fprintf(irp->f, ")");
}
@@ -2053,8 +2070,11 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction) {
case IrInstructionIdMarkErrRetTracePtr:
ir_print_mark_err_ret_trace_ptr(irp, (IrInstructionMarkErrRetTracePtr *)instruction);
break;
- case IrInstructionIdSqrt:
- ir_print_sqrt(irp, (IrInstructionSqrt *)instruction);
+ case IrInstructionIdFloatOp:
+ ir_print_float_op(irp, (IrInstructionFloatOp *)instruction);
+ break;
+ case IrInstructionIdMulAdd:
+ ir_print_mul_add(irp, (IrInstructionMulAdd *)instruction);
break;
case IrInstructionIdAtomicLoad:
ir_print_atomic_load(irp, (IrInstructionAtomicLoad *)instruction);