{
ASTNode *n;
unsigned width = $6->GetValueWidth();
- unsigned rotate = $4;
+ unsigned rotate = $4 % width;
if (0 == rotate)
{
n = $6;
}
- else if (rotate < width)
+ else
{
ASTNode high = parserInterface->CreateBVConst(32,width-1);
ASTNode zero = parserInterface->CreateBVConst(32,0);
n = new ASTNode(parserInterface->nf->CreateTerm(BVCONCAT,width,bottom,top));
delete $6;
}
- else
- {
- n = NULL; // remove gcc warning.
- yyerror("Rotate must be strictly less than the width.");
- }
$$ = n;
}
{
ASTNode *n;
unsigned width = $6->GetValueWidth();
- unsigned rotate = $4;
+ unsigned rotate = $4 % width;
if (0 == rotate)
{
n = $6;
}
- else if (rotate < width)
+ else
{
ASTNode high = parserInterface->CreateBVConst(32,width-1);
ASTNode zero = parserInterface->CreateBVConst(32,0);
n = new ASTNode(parserInterface->nf->CreateTerm(BVCONCAT,width,bottom,top));
delete $6;
}
- else
- {
- n = NULL; // remove gcc warning.
- yyerror("Rotate must be strictly less than the width.");
- }
$$ = n;
}