Skip to content

Commit 92b31b1

Browse files
committed
Rename sext/zext instructions
1 parent 472fd65 commit 92b31b1

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

crates/polkavm-common/src/assembler.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,9 @@ pub fn assemble(code: &str) -> Result<Vec<u8>, String> {
447447
("clz", OpMarker::NONE) => Some(Instruction::count_leading_zero_bits_64 as F),
448448
("ctz", OpMarker::I32) => Some(Instruction::count_trailing_zero_bits_32 as F),
449449
("ctz", OpMarker::NONE) => Some(Instruction::count_trailing_zero_bits_64 as F),
450-
("sext.b", _) => Some(Instruction::sign_extend_8 as F),
451-
("sext.h", _) => Some(Instruction::sign_extend_16 as F),
452-
("zext.h", _) => Some(Instruction::zero_extend_16 as F),
450+
("sext8", _) => Some(Instruction::sign_extend_8 as F),
451+
("sext16", _) => Some(Instruction::sign_extend_16 as F),
452+
("zext16", _) => Some(Instruction::zero_extend_16 as F),
453453
("reverse", _) => Some(Instruction::reverse_byte as F),
454454
_ => None,
455455
};

crates/polkavm-common/src/program.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,19 +2516,19 @@ impl<'a, 'b, 'c> InstructionVisitor for InstructionFormatter<'a, 'b, 'c> {
25162516
fn sign_extend_8(&mut self, d: RawReg, s: RawReg) -> Self::ReturnTy {
25172517
let d = self.format_reg(d);
25182518
let s = self.format_reg(s);
2519-
write!(self, "{d} = sext.b {s}")
2519+
write!(self, "{d} = sext8 {s}")
25202520
}
25212521

25222522
fn sign_extend_16(&mut self, d: RawReg, s: RawReg) -> Self::ReturnTy {
25232523
let d = self.format_reg(d);
25242524
let s = self.format_reg(s);
2525-
write!(self, "{d} = sext.h {s}")
2525+
write!(self, "{d} = sext16 {s}")
25262526
}
25272527

25282528
fn zero_extend_16(&mut self, d: RawReg, s: RawReg) -> Self::ReturnTy {
25292529
let d = self.format_reg(d);
25302530
let s = self.format_reg(s);
2531-
write!(self, "{d} = zext.h {s}")
2531+
write!(self, "{d} = zext16 {s}")
25322532
}
25332533

25342534
fn reverse_byte(&mut self, d: RawReg, s: RawReg) -> Self::ReturnTy {

tools/spectool/spec/src/inst_sign_extend_16.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pre: a0 = 0xaaaa
22
pre: gas = 10000
33

44
pub @main:
5-
a2 = sext.h a0
5+
a2 = sext16 a0
66

77
post: a2 = 0xffffffffffffaaaa
88
post: gas = 9998

tools/spectool/spec/src/inst_sign_extend_8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pre: a0 = 0xaa
22
pre: gas = 10000
33

44
pub @main:
5-
a2 = sext.b a0
5+
a2 = sext8 a0
66

77
post: a2 = 0xffffffffffffffaa
88
post: gas = 9998

tools/spectool/spec/src/inst_zero_extend_16.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ pre: a0 = 0xaaaa
22
pre: gas = 10000
33

44
pub @main:
5-
a2 = zext.h a0
5+
a2 = zext16 a0
66

77
post: a2 = 0x00000000aaaa
88
post: gas = 9998

0 commit comments

Comments
 (0)