diff options
author | Homer Hsing <homer.xing@intel.com> | 2012-10-16 14:14:25 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-10-18 15:02:08 +0800 |
commit | f42bb826b5e2a0572c38fb33647546743ad34c11 (patch) | |
tree | 75e17c9a7c6660eaa4e49348318f719bbacb6d9a | |
parent | a41d964869f0e3aafa21aea88f5579f1e619606f (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.y | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } ; |