Skip to content

Commit 1a9e29e

Browse files
author
Noah Gibbs
authored
Minor fix to TEST() - allow positive signed 32-bit immediate operands (ruby#209)
1 parent 879ad25 commit 1a9e29e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

yjit/src/asm/x86_64/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,6 @@ pub fn test(cb: &mut CodeBlock, rm_opnd: X86Opnd, test_opnd: X86Opnd) {
13271327
},
13281328
X86Opnd::Imm(imm) => {
13291329
// This mode only applies to 64-bit R/M operands with 32-bit signed immediates
1330-
assert!(imm.value < 0);
13311330
assert!(imm.num_bits <= 32);
13321331
assert!(rm_num_bits == 64);
13331332

yjit/src/asm/x86_64/tests.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,9 @@ fn test_test() {
381381
check_bytes("4885c0", |cb| test(cb, RAX, RAX));
382382
check_bytes("4885f0", |cb| test(cb, RAX, RSI));
383383
check_bytes("48f74640f7ffffff", |cb| test(cb, mem_opnd(64, RSI, 64), imm_opnd(!0x08)));
384+
check_bytes("48f7464008000000", |cb| test(cb, mem_opnd(64, RSI, 64), imm_opnd(0x08)));
385+
check_bytes("48f7c108000000", |cb| test(cb, RCX, imm_opnd(0x08)));
386+
//check_bytes("48a9f7ffff0f", |cb| test(cb, RAX, imm_opnd(0x0FFFFFF7)));
384387
}
385388

386389
#[test]

0 commit comments

Comments
 (0)