|
@@ -33,6 +33,21 @@ UNARY_INTRINSICS = {
|
|
|
'float_neg' : '-'
|
|
|
}
|
|
|
|
|
|
+CAST_INTRINSICS = {
|
|
|
+ 'cast_i2f' : float,
|
|
|
+ 'cast_i2s' : str,
|
|
|
+ 'cast_i2b' : bool,
|
|
|
+ 'cast_f2i' : int,
|
|
|
+ 'cast_f2s' : str,
|
|
|
+ 'cast_f2b' : bool,
|
|
|
+ 'cast_s2i' : int,
|
|
|
+ 'cast_s2f' : float,
|
|
|
+ 'cast_s2b' : bool,
|
|
|
+ 'cast_b2i' : int,
|
|
|
+ 'cast_b2f' : float,
|
|
|
+ 'cast_b2s' : str
|
|
|
+}
|
|
|
+
|
|
|
def create_get_length(expression):
|
|
|
"""Creates an expression that evaluates the given expression, and then
|
|
|
computes the length of its result."""
|
|
@@ -244,5 +259,7 @@ def register_intrinsics(target_jit):
|
|
|
target_jit.register_binary_intrinsic(key, value)
|
|
|
for (key, value) in UNARY_INTRINSICS.items():
|
|
|
target_jit.register_unary_intrinsic(key, value)
|
|
|
+ for (key, value) in CAST_INTRINSICS.items():
|
|
|
+ target_jit.register_cast_intrinsic(key, value)
|
|
|
for (key, value) in MISC_INTRINSICS.items():
|
|
|
target_jit.register_intrinsic(key, value)
|