Add a bconst instruction. (#116)

* Add a bconst instruction.
This commit is contained in:
Dan Gohman
2017-07-13 10:12:25 -07:00
committed by Jakob Stoklund Olesen
parent d8e2cb2b42
commit 3bcfb103b9
9 changed files with 64 additions and 2 deletions

View File

@@ -107,6 +107,7 @@ pub enum InstructionData {
UnaryImm { opcode: Opcode, imm: Imm64 },
UnaryIeee32 { opcode: Opcode, imm: Ieee32 },
UnaryIeee64 { opcode: Opcode, imm: Ieee64 },
UnaryBool { opcode: Opcode, imm: bool },
Binary { opcode: Opcode, args: [Value; 2] },
BinaryImm {
opcode: Opcode,

View File

@@ -273,6 +273,7 @@ impl<'a> Verifier<'a> {
UnaryImm { .. } |
UnaryIeee32 { .. } |
UnaryIeee64 { .. } |
UnaryBool { .. } |
Binary { .. } |
BinaryImm { .. } |
Ternary { .. } |

View File

@@ -243,6 +243,7 @@ pub fn write_operands(w: &mut Write,
UnaryImm { imm, .. } => write!(w, " {}", imm),
UnaryIeee32 { imm, .. } => write!(w, " {}", imm),
UnaryIeee64 { imm, .. } => write!(w, " {}", imm),
UnaryBool { imm, .. } => write!(w, " {}", imm),
Binary { args, .. } => write!(w, " {}, {}", args[0], args[1]),
BinaryImm { arg, imm, .. } => write!(w, " {}, {}", arg, imm),
Ternary { args, .. } => write!(w, " {}, {}, {}", args[0], args[1], args[2]),