aboutsummaryrefslogtreecommitdiff
path: root/src/ir_print.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-09-18 16:35:57 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-09-18 16:35:57 -0400
commit86209e1a9259dca40803e56d612beacf5a35855c (patch)
tree21e2b617a7cd424f82e040b94014b1c176dcf63b /src/ir_print.cpp
parent914ad1ec2eff4ea9061804ad0da9cde7dd6543b6 (diff)
parentef0f3ba905e992556a60f935cbb7cb30cf1f27db (diff)
downloadzig-86209e1a9259dca40803e56d612beacf5a35855c.tar.gz
zig-86209e1a9259dca40803e56d612beacf5a35855c.zip
Merge branch 'merge-shawnl-simd5'
This is the first 3 commits of #2945, plus my fixups.
Diffstat (limited to 'src/ir_print.cpp')
-rw-r--r--src/ir_print.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ir_print.cpp b/src/ir_print.cpp
index f2877b46e6..8561ed4508 100644
--- a/src/ir_print.cpp
+++ b/src/ir_print.cpp
@@ -42,6 +42,8 @@ static const char* ir_instruction_type_str(IrInstruction* instruction) {
switch (instruction->id) {
case IrInstructionIdInvalid:
return "Invalid";
+ case IrInstructionIdShuffleVector:
+ return "Shuffle";
case IrInstructionIdDeclVarSrc:
return "DeclVarSrc";
case IrInstructionIdDeclVarGen:
@@ -1208,6 +1210,18 @@ static void ir_print_vector_type(IrPrint *irp, IrInstructionVectorType *instruct
fprintf(irp->f, ")");
}
+static void ir_print_shuffle_vector(IrPrint *irp, IrInstructionShuffleVector *instruction) {
+ fprintf(irp->f, "@shuffle(");
+ ir_print_other_instruction(irp, instruction->scalar_type);
+ fprintf(irp->f, ", ");
+ ir_print_other_instruction(irp, instruction->a);
+ fprintf(irp->f, ", ");
+ ir_print_other_instruction(irp, instruction->b);
+ fprintf(irp->f, ", ");
+ ir_print_other_instruction(irp, instruction->mask);
+ fprintf(irp->f, ")");
+}
+
static void ir_print_bool_not(IrPrint *irp, IrInstructionBoolNot *instruction) {
fprintf(irp->f, "! ");
ir_print_other_instruction(irp, instruction->value);
@@ -2143,6 +2157,9 @@ static void ir_print_instruction(IrPrint *irp, IrInstruction *instruction, bool
case IrInstructionIdVectorType:
ir_print_vector_type(irp, (IrInstructionVectorType *)instruction);
break;
+ case IrInstructionIdShuffleVector:
+ ir_print_shuffle_vector(irp, (IrInstructionShuffleVector *)instruction);
+ break;
case IrInstructionIdBoolNot:
ir_print_bool_not(irp, (IrInstructionBoolNot *)instruction);
break;