From 330903ad8189707069d8dff597ccf00706f35e94 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 31 Aug 2006 15:59:14 -0700 Subject: [PATCH] Parse negative integers for imm32s, and don't exceed the IP count width field. This fixes the while test. --- assembler/src/gram.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assembler/src/gram.y b/assembler/src/gram.y index 2a4b05fc..64b73361 100644 --- a/assembler/src/gram.y +++ b/assembler/src/gram.y @@ -1010,7 +1010,7 @@ relativelocation: imm32 $$.reg_file = BRW_IMMEDIATE_VALUE; $$.reg_type = BRW_REGISTER_TYPE_D; - $$.imm32 = $1; + $$.imm32 = (int)$1 & 0x0000ffff; } ; @@ -1151,6 +1151,7 @@ writemask_w: /* empty */ { $$ = 0; } /* 1.4.11: Immediate values */ imm32: INTEGER { $$ = $1; } + | MINUS INTEGER { $$ = -$2; } | NUMBER { $$ = $1; } ;