Add x86_push and x86_pop instructions.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
04f6ccabe5
commit
8ed37e352e
@@ -32,6 +32,8 @@ Ternary = InstructionFormat(VALUE, VALUE, VALUE, typevar_operand=1)
|
|||||||
# operands.
|
# operands.
|
||||||
MultiAry = InstructionFormat(VARIABLE_ARGS)
|
MultiAry = InstructionFormat(VARIABLE_ARGS)
|
||||||
|
|
||||||
|
NullAry = InstructionFormat()
|
||||||
|
|
||||||
InsertLane = InstructionFormat(VALUE, ('lane', uimm8), VALUE)
|
InsertLane = InstructionFormat(VALUE, ('lane', uimm8), VALUE)
|
||||||
ExtractLane = InstructionFormat(VALUE, ('lane', uimm8))
|
ExtractLane = InstructionFormat(VALUE, ('lane', uimm8))
|
||||||
|
|
||||||
|
|||||||
@@ -99,4 +99,17 @@ fmax = Instruction(
|
|||||||
""",
|
""",
|
||||||
ins=(x, y), outs=a)
|
ins=(x, y), outs=a)
|
||||||
|
|
||||||
|
WideInt = TypeVar(
|
||||||
|
'WideInt', 'An integer type with 16 to 64 bits',
|
||||||
|
ints=(16, 64))
|
||||||
|
x = Operand('x', WideInt)
|
||||||
|
|
||||||
|
push = Instruction(
|
||||||
|
'x86_push', "Pushes onto the stack.",
|
||||||
|
ins=x, can_store=True, other_side_effects=True)
|
||||||
|
|
||||||
|
pop = Instruction(
|
||||||
|
'x86_pop', "Pops from the stack.",
|
||||||
|
outs=x, can_load=True, other_side_effects=True)
|
||||||
|
|
||||||
GROUP.close()
|
GROUP.close()
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ pub enum InstructionData {
|
|||||||
},
|
},
|
||||||
Ternary { opcode: Opcode, args: [Value; 3] },
|
Ternary { opcode: Opcode, args: [Value; 3] },
|
||||||
MultiAry { opcode: Opcode, args: ValueList },
|
MultiAry { opcode: Opcode, args: ValueList },
|
||||||
|
NullAry { opcode: Opcode },
|
||||||
InsertLane {
|
InsertLane {
|
||||||
opcode: Opcode,
|
opcode: Opcode,
|
||||||
lane: Uimm8,
|
lane: Uimm8,
|
||||||
|
|||||||
@@ -359,7 +359,8 @@ impl<'a> Verifier<'a> {
|
|||||||
Store { .. } |
|
Store { .. } |
|
||||||
RegMove { .. } |
|
RegMove { .. } |
|
||||||
Trap { .. } |
|
Trap { .. } |
|
||||||
CondTrap { .. } => {}
|
CondTrap { .. } |
|
||||||
|
NullAry { .. } => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ pub fn write_operands(
|
|||||||
write!(w, " {}", DisplayValues(args.as_slice(pool)))
|
write!(w, " {}", DisplayValues(args.as_slice(pool)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
NullAry { .. } => write!(w, " "),
|
||||||
InsertLane { lane, args, .. } => write!(w, " {}, {}, {}", args[0], lane, args[1]),
|
InsertLane { lane, args, .. } => write!(w, " {}, {}, {}", args[0], lane, args[1]),
|
||||||
ExtractLane { lane, arg, .. } => write!(w, " {}, {}", arg, lane),
|
ExtractLane { lane, arg, .. } => write!(w, " {}, {}", arg, lane),
|
||||||
IntCompare { cond, args, .. } => write!(w, " {} {}, {}", cond, args[0], args[1]),
|
IntCompare { cond, args, .. } => write!(w, " {} {}, {}", cond, args[0], args[1]),
|
||||||
|
|||||||
@@ -1955,6 +1955,7 @@ impl<'a> Parser<'a> {
|
|||||||
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
args: args.into_value_list(&[], &mut ctx.function.dfg.value_lists),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
InstructionFormat::NullAry => InstructionData::NullAry { opcode },
|
||||||
InstructionFormat::Jump => {
|
InstructionFormat::Jump => {
|
||||||
// Parse the destination EBB number. Don't translate source to local numbers yet.
|
// Parse the destination EBB number. Don't translate source to local numbers yet.
|
||||||
let ebb_num = self.match_ebb("expected jump destination EBB")?;
|
let ebb_num = self.match_ebb("expected jump destination EBB")?;
|
||||||
|
|||||||
Reference in New Issue
Block a user