Commit 7a737869 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Fix asm constraint check for 'I': It must be <= 31, not <= 32.

[r21073]
parent b51ab5be
......@@ -54,28 +54,19 @@ static const arch_register_req_t no_register_req = {
static int check_immediate_constraint(long val, char immediate_constraint_type)
{
switch (immediate_constraint_type) {
case 0:
case 'i':
return 1;
case 'I':
return val >= 0 && val <= 32;
case 'J':
return val >= 0 && val <= 63;
case 'K':
return val >= -128 && val <= 127;
case 'L':
return val == 0xff || val == 0xffff;
case 'M':
return val >= 0 && val <= 3;
case 'N':
return val >= 0 && val <= 255;
case 'O':
return val >= 0 && val <= 127;
default:
break;
case 0:
case 'i': return 1;
case 'I': return 0 <= val && val <= 31;
case 'J': return 0 <= val && val <= 63;
case 'K': return -128 <= val && val <= 127;
case 'L': return val == 0xff || val == 0xffff;
case 'M': return 0 <= val && val <= 3;
case 'N': return 0 <= val && val <= 255;
case 'O': return 0 <= val && val <= 127;
default: panic("Invalid immediate constraint found");
}
panic("Invalid immediate constraint found");
return 0;
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment