diff options
Diffstat (limited to 'erts/emulator/beam/jit/arm/ops.tab')
-rw-r--r-- | erts/emulator/beam/jit/arm/ops.tab | 126 |
1 files changed, 110 insertions, 16 deletions
diff --git a/erts/emulator/beam/jit/arm/ops.tab b/erts/emulator/beam/jit/arm/ops.tab index 9cd7a9d925..6d27a18c2d 100644 --- a/erts/emulator/beam/jit/arm/ops.tab +++ b/erts/emulator/beam/jit/arm/ops.tab @@ -79,7 +79,7 @@ nif_start i_generic_breakpoint i_debug_breakpoint -i_return_time_trace +i_call_trace_return i_return_to_trace trace_jump W i_yield @@ -271,15 +271,19 @@ i_get_tuple_element Tuple Pos Tuple2 | current_tuple Tuple3 | current_tuple Tuple => _ +i_get_tuple_element Tuple Pos Dst | current_tuple d | swap R1 R2 => + i_get_tuple_element Tuple Pos Dst | swap R1 R2 + load_tuple_ptr s # If positions are in consecutive memory, fetch and store two words at # once. +## FIXME: Fix this bug in maint, too. i_get_tuple_element Tuple Pos1 Dst1 | current_tuple Tuple2 | get_tuple_element Tuple3 Pos2 Dst2 | equal(Tuple, Tuple2) | equal(Tuple, Tuple3) | - consecutive_words(Pos1, Pos2) => + consecutive_words(Pos1, Pos2) | distinct(Dst1, Dst2) => get_two_tuple_elements Tuple Pos1 Dst1 Dst2 | current_tuple Tuple Dst2 @@ -293,6 +297,14 @@ current_tuple Tuple Dst => current_tuple Tuple i_get_tuple_element s P S get_two_tuple_elements s P S S +i_get_tuple_element Tuple Pos Dst | swap Reg1 Reg2 | equal(Dst, Reg1) => + get_tuple_element_swap Tuple Pos Dst Reg2 + +i_get_tuple_element Tuple Pos Dst | swap Reg2 Reg1 | equal(Dst, Reg1) => + get_tuple_element_swap Tuple Pos Dst Reg2 + +get_tuple_element_swap s P d d + # # Exception raising instructions. Infrequently executed. # @@ -359,6 +371,10 @@ move S1=y D1=y | move S2=y D2=y | consecutive_words(D2, D1) => move_two_yregs S2 D2 S1 D1 +move Src Dst | trim N u => move_trim Src Dst N + +move_trim s d t + move Src Dst => i_move Src Dst i_move s d @@ -455,6 +471,41 @@ is_eq_exact f s s is_ne_exact f s s +is_integer NotInt N0 | is_ge Small N1=xy Min=i | is_ge Large Max=i N2=xy | + equal(N0, N1) | equal(N1, N2) | + equal(NotInt, Small) | equal(Small, Large) => + is_int_in_range NotInt N0 Min Max + +is_integer NotInt N0 | is_ge Large Max=i N2=xy | is_ge Small N1=xy Min=i | + equal(N0, N1) | equal(N1, N2) | + equal(NotInt, Small) | equal(Small, Large) => + is_int_in_range NotInt N0 Min Max + +is_integer NotInt N0 | is_ge Fail N1=xy Min=i | + equal(N0, N1) | equal(NotInt, Fail) => + is_int_ge NotInt N0 Min + +is_int_in_range f S c c +is_int_ge f S c + +is_ge Small N1=xy Min=i | is_ge Large Max=i N2=xy | equal(N1, N2) => + is_in_range Small Large N1 Min Max + +is_ge Large Max=i N2=xy | is_ge Small N1=xy Min=i | equal(N1, N2) => + is_in_range Small Large N2 Min Max + +is_in_range f f S c c + +is_ge Small N1=xy A=i | is_lt Large B=i N2=xy | equal(N1, N2) => + is_ge_lt Small Large N1 A B + +is_ge_lt f f S c c + +is_ge Fail1 N1=xy A=i | is_ge Fail2 N2=xy B=i | equal(N1, N2) => + is_ge_ge Fail1 Fail2 N1 A B + +is_ge_ge f f S c c + is_lt f s s is_ge f s s @@ -694,6 +745,9 @@ bif_or j s s d bif1 Fail Bif=u$bif:erlang:not/1 Src=d Dst=d => bif_not Fail Src Dst bif_not j S d +bif1 Fail Bif=u$bif:erlang:node/1 Src=d Dst=d => bif_node Fail Src Dst +bif_node j S d + gc_bif1 Fail Live Bif=u$bif:erlang:bit_size/1 Src Dst=d => bif_bit_size Fail Src Dst bif_bit_size j s d @@ -706,6 +760,21 @@ bif1 Fail Bif=u$bif:erlang:tuple_size/1 Src=d Dst=d => bif_tuple_size Fail Src Dst bif_tuple_size j S d +bif2 Fail Bif=u$bif:erlang:map_get/2 Src1 Src2=xy Dst=d => + bif_map_get Fail Src1 Src2 Dst +bif_map_get j s s d + +bif2 Fail Bif=u$bif:erlang:is_map_key/2 Key Map=xy Dst=d => + bif_is_map_key Bif Fail Key Map Dst +bif_is_map_key b j s s d + +bif2 Fail Bif=u$bif:erlang:max/2 Src1 Src2 Dst => + bif_max Src1 Src2 Dst +bif2 Fail Bif=u$bif:erlang:min/2 Src1 Src2 Dst => + bif_min Src1 Src2 Dst +bif_max s s d +bif_min s s d + bif1 Fail Bif S1 Dst | never_fails(Bif) => nofail_bif1 S1 Bif Dst bif2 Fail Bif S1 S2 Dst | never_fails(Bif) => nofail_bif2 S1 S2 Bif Dst @@ -714,6 +783,8 @@ bif2 Fail Bif S1 S2 Dst => i_bif2 S1 S2 Fail Bif Dst nofail_bif2 S1=d S2 Bif Dst | is_eq_exact_bif(Bif) => bif_is_eq_exact S1 S2 Dst nofail_bif2 S1=d S2 Bif Dst | is_ne_exact_bif(Bif) => bif_is_ne_exact S1 S2 Dst +nofail_bif2 S1 S2 Bif Dst | is_ge_bif(Bif) => bif_is_ge S1 S2 Dst +nofail_bif2 S1 S2 Bif Dst | is_lt_bif(Bif) => bif_is_lt S1 S2 Dst i_get_hash c I d i_get s d @@ -731,11 +802,19 @@ i_bif3 s s s j b d bif_is_eq_exact S s d bif_is_ne_exact S s d +bif_is_ge s s d +bif_is_lt s s d # # Internal calls. # +i_move S=y==0 Dst | call_last Ar P D => move_call_last S Dst P D +i_move S=y==0 Dst | call_ext_last Ar P=u$is_not_bif D => move_call_ext_last S Dst P D + +move_call_last y d f t +move_call_ext_last y d e t + call Ar Func => i_call Func call_last Ar Func D => i_call_last Func D call_only Ar Func => i_call_only Func @@ -842,22 +921,38 @@ i_flush_stubs i_breakpoint_trampoline # ================================================================ -# New bit syntax matching (R11B). +# New bit syntax matching for fixed sizes (from OTP 26). +# ================================================================ + +bs_match Fail Ctx Size Rest=* => bs_match(Fail, Ctx, Size, Rest) + +i_bs_match Fail Ctx Rest=* | test_heap Need Live => + i_bs_match_test_heap Fail Ctx Need Live Rest + +i_bs_match f S * +i_bs_match_test_heap f S I t * + +# +# The following instruction is specially handled in beam_load.c +# to produce a user-friendly message if a bad bs_match instruction +# is encountered. +# +bad_bs_match/1 +bad_bs_match A | never() => _ + +# ================================================================ +# Bit syntax matching (from R11B). # ================================================================ %warm -# Matching integers +# Matching integers. bs_match_string Fail Ms Bits Val => i_bs_match_string Ms Fail Bits Val i_bs_match_string S f W M # Fetching integers from binaries. -bs_get_integer2 Fail=f Ms=xy Live=u Sz=sq Unit=u Flags=u Dst=d => - get_integer2(Fail, Ms, Live, Sz, Unit, Flags, Dst) - -i_bs_get_integer S f t t s d -i_bs_get_fixed_integer S f t t t d +bs_get_integer2 f S t s t t d # Fetching binaries from binaries. bs_get_binary2 Fail=f Ms=xy Live=u Sz=sq Unit=u Flags=u Dst=d => @@ -1384,12 +1479,11 @@ recv_marker_use S # Mark all intentionally unused macros, predicates, and generators. # -%unused pred.negation_is_small - -%unused gen_increment -%unused gen.increment -%unused gen.increment_from_minus -%unused gen.plus_from_minus - # Landing pad for fun calls/apply where we set up arguments and check errors i_lambda_trampoline F f W W + +# +# OTP 26 +# + +update_record a I s d I * |