Parse negative integers for imm32s, and don't exceed the IP count width field.
authorEric Anholt <eric@anholt.net>
Thu, 31 Aug 2006 22:59:14 +0000 (15:59 -0700)
committerDamien Lespiau <damien.lespiau@intel.com>
Mon, 4 Mar 2013 15:54:24 +0000 (15:54 +0000)
This fixes the while test.

assembler/src/gram.y

index 2a4b05f..64b7336 100644 (file)
@@ -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; }
 ;