;
function_attributes
- : USING CONSTANT {
+ : USING constant_expr {
$$ = newLink(SPECIFIER) ;
- FUNC_REGBANK($$) = (int) floatFromVal($2);
+ FUNC_REGBANK($$) = (int) floatFromVal(constExprValue($2,TRUE));
}
| REENTRANT { $$ = newLink (SPECIFIER);
FUNC_ISREENT($$)=1;
relational_expr
: shift_expr
- | relational_expr '<' shift_expr {
- $$ = (port->lt_nge ?
- newNode('!',newNode(GE_OP,$1,$3),NULL) :
- newNode('<', $1,$3));
- }
- | relational_expr '>' shift_expr {
- $$ = (port->gt_nle ?
- newNode('!',newNode(LE_OP,$1,$3),NULL) :
- newNode('>',$1,$3));
- }
- | relational_expr LE_OP shift_expr {
- $$ = (port->le_ngt ?
- newNode('!', newNode('>', $1 , $3 ), NULL) :
- newNode(LE_OP,$1,$3));
- }
- | relational_expr GE_OP shift_expr {
- $$ = (port->ge_nlt ?
- newNode('!', newNode('<', $1 , $3 ), NULL) :
- newNode(GE_OP,$1,$3));
- }
+ | relational_expr '<' shift_expr { $$ = newNode('<', $1,$3);}
+ | relational_expr '>' shift_expr { $$ = newNode('>', $1,$3);}
+ | relational_expr LE_OP shift_expr { $$ = newNode(LE_OP,$1,$3);}
+ | relational_expr GE_OP shift_expr { $$ = newNode(GE_OP,$1,$3);}
;
equality_expr
: relational_expr
- | equality_expr EQ_OP relational_expr {
- $$ = (port->eq_nne ?
- newNode('!',newNode(NE_OP,$1,$3),NULL) :
- newNode(EQ_OP,$1,$3));
- }
- | equality_expr NE_OP relational_expr {
- $$ = (port->ne_neq ?
- newNode('!', newNode(EQ_OP,$1,$3), NULL) :
- newNode(NE_OP,$1,$3));
- }
+ | equality_expr EQ_OP relational_expr { $$ = newNode(EQ_OP,$1,$3);}
+ | equality_expr NE_OP relational_expr { $$ = newNode(NE_OP,$1,$3);}
;
and_expr
$$ = newNode($2,$1,$3);
break;
case MUL_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('*',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '*', $3);
break;
case DIV_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('/',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '/', $3);
break;
case MOD_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('%',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '%', $3);
break;
case ADD_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('+',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '+', $3);
break;
case SUB_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('-',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '-', $3);
break;
case LEFT_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode(LEFT_OP,removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, LEFT_OP, $3);
break;
case RIGHT_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode(RIGHT_OP,removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, RIGHT_OP, $3);
break;
case AND_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('&',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '&', $3);
break;
case XOR_ASSIGN:
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('^',removePreIncDecOps(copyAst($1)),$3));
+ $$ = createRMW($1, '^', $3);
break;
case OR_ASSIGN:
- /* $$ = newNode('=',$1,newNode('|',removeIncDecOps(copyAst($1)),$3)); */
- $$ = newNode('=',removePostIncDecOps(copyAst($1)),
- newNode('|',removePreIncDecOps(copyAst($1)),$3));
+/* $$ = newNode('=',$1,newNode('|',removeIncDecOps(copyAst($1)),$3)); */
+/* $$ = newNode('=',removePostIncDecOps(copyAst($1)),
+ newNode('|',removePreIncDecOps(copyAst($1)),$3)); */
+ $$ = createRMW($1, '|', $3);
break;
default :
$$ = NULL;
Interrupt_storage
: INTERRUPT { $$ = INTNO_UNSPEC ; }
- | INTERRUPT CONSTANT
- { int intno = (int) floatFromVal($2);
+ | INTERRUPT constant_expr
+ { int intno = (int) floatFromVal(constExprValue($2,TRUE));
if ((intno >= 0) && (intno <= INTNO_MAX))
$$ = intno;
else
struct_declarator
: declarator
| ':' constant_expr {
- int bitsize;
+ unsigned int bitsize;
$$ = newSymbol (genSymName(NestLevel),NestLevel) ;
- bitsize= (int) floatFromVal(constExprValue($2,TRUE));
+ bitsize= (unsigned int) floatFromVal(constExprValue($2,TRUE));
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);
}
| declarator ':' constant_expr
{
- int bitsize;
- bitsize= (int) floatFromVal(constExprValue($3,TRUE));
+ unsigned int bitsize;
+ bitsize= (unsigned int) floatFromVal(constExprValue($3,TRUE));
if (bitsize > (port->s.int_size * 8)) {
bitsize = port->s.int_size * 8;
werror(E_BITFLD_SIZE, bitsize);