Implement sgt in interpreter

This commit is contained in:
Robin Salen 2023-04-06 16:59:19 -04:00
parent ac2ccc1eb9
commit 4db004417c
No known key found for this signature in database
GPG Key ID: FB87BACFB3CB2007

View File

@ -319,7 +319,7 @@ impl<'a> Interpreter<'a> {
0x10 => self.run_lt(), // "LT",
0x11 => self.run_gt(), // "GT",
0x12 => self.run_slt(), // "SLT",
0x13 => todo!(), // "SGT",
0x13 => self.run_sgt(), // "SGT",
0x14 => self.run_eq(), // "EQ",
0x15 => self.run_iszero(), // "ISZERO",
0x16 => self.run_and(), // "AND",
@ -583,6 +583,12 @@ impl<'a> Interpreter<'a> {
self.push_bool(signed_cmp(x, y) == Ordering::Less);
}
fn run_sgt(&mut self) {
let x = self.pop();
let y = self.pop();
self.push_bool(signed_cmp(x, y) == Ordering::Greater);
}
fn run_eq(&mut self) {
let x = self.pop();
let y = self.pop();