operand: allow signed immediates to be matched by IsIMMX (#182)
Many of the instruction functions correctly match the size of immediate values, but they only accept unsigned immediates. This PR fixes the operand check functions for intermediate types to also accept the signed variants. Fixes #181
This commit is contained in:
@@ -36,6 +36,12 @@ func TestChecks(t *testing.T) {
|
||||
|
||||
{IsIMM64, Imm((1 << 64) - 1), true},
|
||||
|
||||
// Signed Immediates
|
||||
{IsIMM8, I8(-1), true},
|
||||
{IsIMM16, I16(-1), true},
|
||||
{IsIMM32, I32(-1), true},
|
||||
{IsIMM64, I64(-1), true},
|
||||
|
||||
// Specific registers
|
||||
{IsAL, reg.AL, true},
|
||||
{IsAL, reg.CL, false},
|
||||
|
||||
Reference in New Issue
Block a user