Class: JIT::Primitive
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary (collapse)
-
- (Primitive) %(divisor)
Generates an instruction to apply the modulo function on this value.
-
- (Primitive) &(other)
Generates an instruction to perform a [bitwise AND](en.wikipedia.org/wiki/Bitwise_operation#AND) with this value.
-
- (Primitive) *(other)
Generates an instruction to perform a multiplication with this value.
-
- (Primitive) **(exponent)
Generates an instruction to find a power of this value.
-
- (Primitive) +(other)
Generates an instruction to perform an addition with this value.
-
- (Primitive) -(other)
Generates an instruction to perform a subtraction with this value.
-
- (Primitive) -@
Generates an instruction to reverse the sign of this value.
-
- (Primitive) /(divisor)
Generates an instruction to perform a division with this value.
-
- (Bool) <(other)
Generates an instruction to check whether this value is less than another value.
-
- (Primitive) <<(other)
Generates an instruction to perform an arithmetic left shift on this value.
-
- (Bool) <=(other)
Generates an instruction to check whether this value is less than or equal to another value.
-
- (Bool) >(other)
Generates an instruction to check whether this value is greater than another value.
-
- (Bool) >=(other)
Generates an instruction to check whether this value is greater than or equal to another value.
-
- (Primitive) >>(other)
Generates an instruction to perform an arithmetic right shift on this value.
-
- (Primitive) ^(other)
Generates an instruction to perform a [bitwise XOR](en.wikipedia.org/wiki/Bitwise_operation#XOR) with this value.
-
- (Bool) eq(other)
Generates an instruction to check whether this value is equal to another value.
-
- (Bool) ne(other)
Generates an instruction to check whether this value is not equal to another value.
-
- (Primitive) |(other)
Generates an instruction to perform a [bitwise OR](en.wikipedia.org/wiki/Bitwise_operation#OR) with this value.
-
- (Primitive) ~
Generates an instruction to calculate the bitwise negation of this value.
Methods inherited from Value
#address, #addressable?, #cast, create, #function, #set_addressable, #store, #to_bool, #to_not_bool, #type, wrap
Instance Method Details
- (Primitive) %(divisor)
Generates an instruction to apply the modulo function on this value.
265 266 267 |
# File 'lib/libjit/value.rb', line 265 def %(divisor) Value.wrap LibJIT.jit_insn_rem(function.jit_t, jit_t, divisor.jit_t) end |
- (Primitive) &(other)
Generates an instruction to perform a [bitwise AND](en.wikipedia.org/wiki/Bitwise_operation#AND) with this value.
200 201 202 |
# File 'lib/libjit/value.rb', line 200 def &(other) Value.wrap LibJIT.jit_insn_and(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) *(other)
Generates an instruction to perform a multiplication with this value.
249 250 251 |
# File 'lib/libjit/value.rb', line 249 def *(other) Value.wrap LibJIT.jit_insn_mul(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) **(exponent)
Generates an instruction to find a power of this value.
273 274 275 |
# File 'lib/libjit/value.rb', line 273 def **(exponent) Value.wrap LibJIT.jit_insn_pow(function.jit_t, jit_t, exponent.jit_t) end |
- (Primitive) +(other)
Generates an instruction to perform an addition with this value.
233 234 235 |
# File 'lib/libjit/value.rb', line 233 def +(other) Value.wrap LibJIT.jit_insn_add(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) -(other)
Generates an instruction to perform a subtraction with this value.
241 242 243 |
# File 'lib/libjit/value.rb', line 241 def -(other) Value.wrap LibJIT.jit_insn_sub(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) -@
Generates an instruction to reverse the sign of this value.
225 226 227 |
# File 'lib/libjit/value.rb', line 225 def -@ Value.wrap LibJIT.jit_insn_neg(function.jit_t, jit_t) end |
- (Primitive) /(divisor)
Generates an instruction to perform a division with this value.
257 258 259 |
# File 'lib/libjit/value.rb', line 257 def /(divisor) Value.wrap LibJIT.jit_insn_div(function.jit_t, jit_t, divisor.jit_t) end |
- (Bool) <(other)
Generates an instruction to check whether this value is less than another value.
126 127 128 |
# File 'lib/libjit/value.rb', line 126 def <(other) Value.wrap(LibJIT.jit_insn_lt(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Primitive) <<(other)
Generates an instruction to perform an arithmetic left shift on this value.
183 184 185 |
# File 'lib/libjit/value.rb', line 183 def <<(other) Value.wrap LibJIT.jit_insn_shl(function.jit_t, jit_t, other.jit_t) end |
- (Bool) <=(other)
Generates an instruction to check whether this value is less than or equal to another value.
135 136 137 |
# File 'lib/libjit/value.rb', line 135 def <=(other) Value.wrap(LibJIT.jit_insn_le(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Bool) >(other)
Generates an instruction to check whether this value is greater than another value.
143 144 145 |
# File 'lib/libjit/value.rb', line 143 def >(other) Value.wrap(LibJIT.jit_insn_gt(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Bool) >=(other)
Generates an instruction to check whether this value is greater than or equal to another value.
152 153 154 |
# File 'lib/libjit/value.rb', line 152 def >=(other) Value.wrap(LibJIT.jit_insn_ge(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Primitive) >>(other)
Generates an instruction to perform an arithmetic right shift on this value.
191 192 193 |
# File 'lib/libjit/value.rb', line 191 def >>(other) Value.wrap LibJIT.jit_insn_shr(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) ^(other)
Generates an instruction to perform a [bitwise XOR](en.wikipedia.org/wiki/Bitwise_operation#XOR) with this value.
209 210 211 |
# File 'lib/libjit/value.rb', line 209 def ^(other) Value.wrap LibJIT.jit_insn_xor(function.jit_t, jit_t, other.jit_t) end |
- (Bool) eq(other)
Generates an instruction to check whether this value is equal to another value.
160 161 162 |
# File 'lib/libjit/value.rb', line 160 def eq(other) Value.wrap(LibJIT.jit_insn_eq(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Bool) ne(other)
Generates an instruction to check whether this value is not equal to another value.
168 169 170 |
# File 'lib/libjit/value.rb', line 168 def ne(other) Value.wrap(LibJIT.jit_insn_ne(function.jit_t, jit_t, other.jit_t)).to_bool end |
- (Primitive) |(other)
Generates an instruction to perform a [bitwise OR](en.wikipedia.org/wiki/Bitwise_operation#OR) with this value.
218 219 220 |
# File 'lib/libjit/value.rb', line 218 def |(other) Value.wrap LibJIT.jit_insn_or(function.jit_t, jit_t, other.jit_t) end |
- (Primitive) ~
Generates an instruction to calculate the bitwise negation of this value.
175 176 177 |
# File 'lib/libjit/value.rb', line 175 def ~() Value.wrap LibJIT.jit_insn_not(function.jit_t, jit_t) end |