summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2012-10-16 14:14:25 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2012-10-18 15:02:08 +0800
commitf42bb826b5e2a0572c38fb33647546743ad34c11 (patch)
tree75e17c9a7c6660eaa4e49348318f719bbacb6d9a
parenta41d964869f0e3aafa21aea88f5579f1e619606f (diff)
Fix symbol register subreg number calculation rule symbol_reg_p
When in normal mode, subreg_nr should not be divided by type_size. This patch fixes such bug.
-rw-r--r--src/gram.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gram.y b/src/gram.y
index 1b40988..ccd4763 100644
--- a/src/gram.y
+++ b/src/gram.y
@@ -1634,8 +1634,13 @@ symbol_reg_p: STRING LPAREN exp RPAREN
memcpy(&$$, dcl_reg, sizeof(*dcl_reg));
$$.base.reg_nr += $3;
$$.base.subreg_nr += $5;
- $$.base.reg_nr += $$.base.subreg_nr / (32 / get_type_size(dcl_reg->type));
- $$.base.subreg_nr = $$.base.subreg_nr % (32 / get_type_size(dcl_reg->type));
+ if(advanced_flag) {
+ $$.base.reg_nr += $$.base.subreg_nr / (32 / get_type_size(dcl_reg->type));
+ $$.base.subreg_nr = $$.base.subreg_nr % (32 / get_type_size(dcl_reg->type));
+ } else {
+ $$.base.reg_nr += $$.base.subreg_nr / 32;
+ $$.base.subreg_nr = $$.base.subreg_nr % 32;
+ }
free($1);
}
;