| parrotcode Register Comparison Ops | |
| Docs | FAQ | Download | Examples | Talks | Resources | Perl 6 | Languages | Who's Who | Donors | Cage Cleaners | Wiki | |
cmp.ops - Register Comparison Ops
Operations that compare two registers against each other. Some of these operations affect control flow directly; others do not.
The variants with a prepended n_ like <n_not> generate a new target PMC.
If possible,
they use the appropriate language type,
specified with .HLL.
These operators branch based on the relationship between their operands.
Branch if $1 is equal to $2. For PMCs this does a generic comparison, whatever that is for the involved PMCs. Mixed PMC number/string operands do a numeric or string comparison respectively.
eq_str and eq_num enforce string or number comparisons.
eq_addr compares the address of the objects or strings.
Branch if $1 is not equal to $2.
Branch if $1 is less than $2.
Branch if $1 is less than or equal to $2.
Branch if $1 is greater than $2.
Branch if $1 is greater than or equal to $2.
Branch to $2 if $1 is a NULL PMC.
Branch to $2 if $1 is a NULL STRING.
Branch to $2 if $1 is not a NULL PMC.
Branch to $2 if $1 is not a NULL STRING.
These ops do comparisons and truth testing without doing flow control.
Sets $1 to -1 if $2 < $3, +1 if $2 > $3, and 0 otherwise.
Sets $1 to 1 or 0, depending on the identity of the 2 objects. The identity is the PMCs memory address.
Sets $1 to 0 or 1, depending on the identity of the 2 objects.
Sets $1 to 1 or 0, depending on whether $2 is true or not.
Sets $1 to 1 or 0, depending on whether $2 is false or not.
Sets $1 to 1 if the object is null, 0 otherwise.
These 3 opcodes are valid, but create as their reverse.
Sets $1 to 1 if $2 is greater than $3.
These 3 opcodes are valid, but create as their reverse.
Sets $1 to 1 if $2 is greater than or equal to $3.
Sets $1 to 1 if $2 is less than or equal to $3.
Sets $1 to 1 if $2 is less than $3.
Sets $1 to 1 if $2 is equal to $3.
Sets $1 to 1 if $2 is not equal to $3.
These operations apply logical functions to their arguments.
Short-circuiting logical and. Returns $2 if it's false, else returns $3.
Set the boolean state of $1 to the opposite of the boolean state from $1.
Set the boolean state of $1 to the opposite of the boolean state from $2.
Short-circuiting logical or. Returns $2 if it's true, else returns $3.
Logical xor. Returns $2 if it's true and $3 isn't, returns $3 if it's true and $2 isn't, else returns false.
Copyright (C) 2001-2008, The Perl Foundation.
This program is free software. It is subject to the same license as the Parrot interpreter itself.
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|