Bug #1032

support all operators for both actionD and varaction2 or give a nice error message

Added by yexo over 9 years ago. Updated over 9 years ago.

Status:ClosedStart date:2010-06-22
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:0.1.0

Description

All expressions should get 2 new functions: supported_by_varaction2 and supported_by_actionD. That way the varaction2 code can delegate as much as possible to the actionD code (but never subexpressions that are not supported). For those cases that are not supported by either (lets say that the ternary operator would only be supported by actionD code but one of the expressions in it contains a variable) we should display a nice error message describing the actual problem.

Associated revisions

Revision 653:1b92218c9890
Added by Hirundo over 9 years ago

Feature: Implement signed shift operators (<< and >>) in actionD (#1032).

Revision 655:cbedb54c3a2d
Added by Hirundo over 9 years ago

Feature: Implement xor-operator in actionD (#1032).

Revision 653:1b92218c9890
Added by Hirundo over 9 years ago

Feature: Implement signed shift operators (<< and >>) in actionD (#1032).

Revision 655:cbedb54c3a2d
Added by Hirundo over 9 years ago

Feature: Implement xor-operator in actionD (#1032).

Revision 656:9c38c7bb4b1c
Added by Hirundo over 9 years ago

Feature: Implement min/max in actionD (#1032).

Revision 656:9c38c7bb4b1c
Added by Hirundo over 9 years ago

Feature: Implement min/max in actionD (#1032).

Revision 657:e0a190ddb075
Added by Hirundo over 9 years ago

Feature: Support shift operators (<< and >>) in varaction2 (#1032).

Revision 657:e0a190ddb075
Added by Hirundo over 9 years ago

Feature: Support shift operators (<< and >>) in varaction2 (#1032).

Revision 658:8e4b1a571dcb
Added by Hirundo over 9 years ago

Feature: Implement hasbit(x, n) in actionD (#1032).

Revision 658:8e4b1a571dcb
Added by Hirundo over 9 years ago

Feature: Implement hasbit(x, n) in actionD (#1032).

Revision 661:44e3a37ed1ef
Added by Hirundo over 9 years ago

Change: Spit out some more specific error messages upon encountering an expression that is not valid in action2/actionD (closes #1032).

Revision 661:44e3a37ed1ef
Added by Hirundo over 9 years ago

Change: Spit out some more specific error messages upon encountering an expression that is not valid in action2/actionD (closes #1032).

History

#1 Updated by Hirundo over 9 years ago

Overview of currently unsupported operators:

ActionD:

^ doable as (a|b) - (a&b)
min doable as (a<b)?a:b
max doable as (a>b)?a:b
STO_TMP inherently unusable
STO_PERM inherently unusable
<< Do as op 05.
>> I suggest using op 06 for this. We can additionally implement unsigned bit shifts using the >>> operator.

action2:
2^x can be computed using (1 ror (32-x)) (with a special check for x>=32)
<< a * (2^x)
>> a / (2^x)
HASBIT (a & (1 << x)) != 0

#2 Updated by yexo over 9 years ago

Better implementation for HASBIT in action2 would be: (a >> x) & 1

#3 Updated by Hirundo over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset 44e3a37ed1ef.

Also available in: Atom PDF