Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Relational ins opcodes
  • Loading branch information
coke committed Sep 18, 2013
1 parent 648a121 commit 783df30
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/nqp-opcode.txt
Expand Up @@ -78,13 +78,6 @@ General notes:
nqp::findcclass pir::find_cclass__Iisii (?)
nqp::findnotcclass pir::find_not_cclass__Iisii (?)

relational:
nqp::iseq_i pir::iseq__Iii
nqp::iseq_n pir::iseq__Inn
nqp::iseq_s pir::iseq__Iss
nqp::iseq_I
...etc...

aggregate:
nqp::list(item0, item1, ...) create a low-level list
nqp::qlist(item0, item1, ...) temporary for QRPA
Expand Down
52 changes: 52 additions & 0 deletions docs/ops.markdown
Expand Up @@ -171,6 +171,58 @@ name. `h` indicates a hyperbolic variant.
## tanh
* `tanh_n(num $n)`

# Relational Opcodes

## cmp
* `cmp_i(int $l, int $r)`
* `cmp_n(num $l, num $r)`
* `cmp_s(str $l, str $r)`

Compare two values, returns -1 if $l is greater than $r, 0 if they are equal,
and 1 if $r is greater than $l.

## iseq
* `iseq_i(int $l, int $r)`
* `iseq_n(num $l, num $r)`
* `iseq_s(str $l, str $r)`

Return non-zero if the two parameters are equal.

## isgt
* `isgt_i(int $l, int $r)`
* `isgt_n(num $l, num $r)`
* `isgt_s(str $l, str $r)`

Return non-zero if $l is greater than two $r.

## isge
* `isge_i(int $l, int $r)`
* `isge_n(num $l, num $r)`
* `isge_s(str $l, str $r)`

Return non-zero if $l is greater than or equal two $r.

## islt
* `islt_i(int $l, int $r)`
* `islt_n(num $l, num $r)`
* `islt_s(str $l, str $r)`

Return non-zero if $l is less than two $r.

## isle
* `isle_i(int $l, int $r)`
* `isle_n(num $l, num $r)`
* `isle_s(str $l, str $r)`

Return non-zero if $l is less than or equal two $r.

## isne
* `isne_i(int $l, int $r)`
* `isne_n(num $l, num $r)`
* `isne_s(str $l, str $r)`

Return non-zero if the two parameters are not equal.

# String Opcodes

## radix
Expand Down

0 comments on commit 783df30

Please sign in to comment.