Coalesce some formats into MultiAry.

Allow some flexibility in the signature matching for instruction
formats. In particular, look for a value list format as a second chance
option.

The Return, ReturnReg, and TernaryOverflow formats all fit the single
MultiAry catch-all format for instructions without immediate operands.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-10 12:17:12 -08:00
parent 6021da8e1c
commit 519eb1934b
8 changed files with 50 additions and 99 deletions

View File

@@ -238,7 +238,15 @@ fn write_instruction(w: &mut Write,
BinaryImm { arg, imm, .. } => writeln!(w, " {}, {}", arg, imm),
BinaryOverflow { args, .. } => writeln!(w, " {}, {}", args[0], args[1]),
Ternary { args, .. } => writeln!(w, " {}, {}, {}", args[0], args[1], args[2]),
TernaryOverflow { ref data, .. } => writeln!(w, " {}", data),
MultiAry { ref args, .. } => {
if args.is_empty() {
writeln!(w, "")
} else {
writeln!(w,
" {}",
DisplayValues(args.as_slice(&func.dfg.value_lists)))
}
}
InsertLane { lane, args, .. } => writeln!(w, " {}, {}, {}", args[0], lane, args[1]),
ExtractLane { lane, arg, .. } => writeln!(w, " {}, {}", arg, lane),
IntCompare { cond, args, .. } => writeln!(w, " {}, {}, {}", cond, args[0], args[1]),
@@ -280,20 +288,6 @@ fn write_instruction(w: &mut Write,
args[0],
DisplayValues(&args[1..]))
}
Return { ref args, .. } => {
if args.is_empty() {
writeln!(w, "")
} else {
writeln!(w,
" {}",
DisplayValues(args.as_slice(&func.dfg.value_lists)))
}
}
ReturnReg { ref args, .. } => {
writeln!(w,
" {}",
DisplayValues(args.as_slice(&func.dfg.value_lists)))
}
}
}