1
# ``The contents of this file are subject to the Erlang Public License,
2
# Version 1.1, (the "License"); you may not use this file except in
3
# compliance with the License. You should have received a copy of the
4
# Erlang Public License along with this software. If not, it can be
5
# retrieved via the world wide web at http://www.erlang.org/.
7
# Software distributed under the License is distributed on an "AS IS"
8
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
# the License for the specific language governing rights and limitations
12
# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
# AB. All Rights Reserved.''
20
# This file contains obsolete instructions that may implicitly build
24
# ================================================================
25
# Old bit syntax construction.
26
# ================================================================
28
%macro: i_bs_put_integer BsPutInteger
29
i_bs_put_integer j s I s
31
%macro: i_bs_put_float BsPutFloat
32
i_bs_put_float j s I s
34
%macro: i_bs_put_binary BsPutBinary
35
i_bs_put_binary j s I s
37
%macro: i_bs_put_binary_all BsPutBinaryAll
38
i_bs_put_binary_all j s
40
bs_put_string Len String => i_bs_put_string Len String
44
# ================================================================
45
# Old bit syntax matching.
46
# ================================================================
49
# Matching binaries: Getting started.
52
%macro: bs_start_match BsStartMatch -fail_action
56
bs_start_match Fail=f icwoa => jump Fail
62
# Fetching integers from binaries.
64
bs_get_integer Fail=f Sz=s Unit=u Flags=u Dst=d => \
65
gen_get_integer(Fail, Sz, Unit, Flags, Dst)
66
%macro: i_bs_get_integer BsGetInteger -fail_action -gen_dest
67
i_bs_get_integer f s I d
70
# Fetching integers from binaries.
72
bs_get_binary Fail=f Sz=s Unit=u Flags=u Dst=d => \
73
gen_get_binary(Fail, Sz, Unit, Flags, Dst)
74
%macro: i_bs_get_binary_imm BsGetBinaryImm -fail_action -gen_dest
75
%macro: i_bs_get_binary BsGetBinary -fail_action -gen_dest
76
%macro: i_bs_get_binary_all BsGetBinaryAll -fail_action -gen_dest
77
i_bs_get_binary_imm f I I d
78
i_bs_get_binary f s I d
79
i_bs_get_binary_all f d
82
# Fetching floats from binaries.
84
bs_get_float Fail=f Sz=s Unit=u Flags=u Dst=d => \
85
gen_get_float(Fail, Sz, Unit, Flags, Dst)
87
%macro: i_bs_get_float BsGetFloat -fail_action -gen_dest
88
i_bs_get_float f s I d
91
# Skipping uninteresting bits.
93
bs_skip_bits Fail=f Sz=s Unit=u Flags=u => gen_skip_bits(Fail, Sz, Unit, Flags)
95
%macro: i_bs_skip_bits_imm BsSkipBitsImm -fail_action
96
i_bs_skip_bits_imm f I
98
%macro: i_bs_skip_bits BsSkipBits -fail_action
103
%macro: i_bs_skip_bits_all BsSkipBitsAll -fail_action
109
bs_test_tail Fail=f Bits=u==0 => bs_test_zero_tail Fail
110
bs_test_tail Fail=f Bits=u => bs_test_tail_imm Fail Bits
115
# Some optimisations.
117
i_bs_get_binary_all Fail Dst | bs_test_tail f u==0 => i_bs_get_binary_all Fail Dst
118
i_bs_skip_bits_all Fail | bs_test_tail f u==0 => i_bs_skip_bits_all Fail
121
# Old bit syntax construction.
123
bs_init Size Flags | old_bs_instructions() => i_bs_init_old
126
bs_final Fail Dst => i_bs_final Fail Dst
133
# Old floating point instructions.
135
fmove FR=l Dst=d => fmove_old FR Dst
137
# The old instruction for moving a float out of a floating point register.
138
# (Allocates a heap fragment.)
144
# Old arithmetic instructions.
146
gc_bif2 Fail I u$bif:erlang:splus/2 S1 S2 Dst=d => m_plus Fail S1 S2 Dst
147
gc_bif2 Fail I u$bif:erlang:sminus/2 S1 S2 Dst=d => m_minus Fail S1 S2 Dst
148
gc_bif2 Fail I u$bif:erlang:stimes/2 S1 S2 Dst=d => m_times Fail S1 S2 Dst
149
gc_bif2 Fail I u$bif:erlang:div/2 S1 S2 Dst=d => m_div Fail S1 S2 Dst
151
gc_bif2 Fail I u$bif:erlang:intdiv/2 S1 S2 Dst=d => int_div Fail S1 S2 Dst
152
gc_bif2 Fail I u$bif:erlang:rem/2 S1 S2 Dst=d => int_rem Fail S1 S2 Dst
154
gc_bif2 Fail I u$bif:erlang:bsl/2 S1 S2 Dst=d => int_bsl Fail S1 S2 Dst
155
gc_bif2 Fail I u$bif:erlang:bsr/2 S1 S2 Dst=d => int_bsr Fail S1 S2 Dst
157
gc_bif2 Fail I u$bif:erlang:band/2 S1 S2 Dst=d => int_band Fail S1 S2 Dst
158
gc_bif2 Fail I u$bif:erlang:bor/2 S1 S2 Dst=d => int_bor Fail S1 S2 Dst
159
gc_bif2 Fail I u$bif:erlang:bxor/2 S1 S2 Dst=d => int_bxor Fail S1 S2 Dst
160
gc_bif1 Fail I u$bif:erlang:bnot/1 Src Dst=d => int_bnot Fail Src Dst
162
gc_bif1 Fail I u$bif:erlang:sminus/1 Src Dst=d => m_minus Fail i Src Dst
163
gc_bif1 Fail I u$bif:erlang:splus/1 Src Dst=d => m_plus Fail i Src Dst
165
m_plus Lbl S1 S2 D => i_fetch S1 S2 | i_plus Lbl D
166
m_minus Lbl S1 S2 D => i_fetch S1 S2 | i_minus Lbl D
167
m_times Lbl S1 S2 D => i_fetch S1 S2 | i_times Lbl D
168
m_div Lbl S1 S2 D => i_fetch S1 S2 | i_m_div Lbl D
169
int_div Lbl S1 S2 D => i_fetch S1 S2 | i_int_div Lbl D
170
int_rem Lbl S1 S2 D => i_fetch S1 S2 | i_rem Lbl D
171
int_bsl Lbl S1 S2 D => i_fetch S1 S2 | i_bsl Lbl D
172
int_bsr Lbl S1 S2 D => i_fetch S1 S2 | i_bsr Lbl D
173
int_band Lbl S1 S2 D => i_fetch S1 S2 | i_band Lbl D
174
int_bor Lbl S1 S2 D => i_fetch S1 S2 | i_bor Lbl D
175
int_bxor Lbl S1 S2 D => i_fetch S1 S2 | i_bxor Lbl D
177
int_bnot Fail Src Dst => i_int_bnot Fail Src Dst
198
gc_bif1 Fail I Bif=u$bif:erlang:length/1 Src Dst=d => bif1 Fail Bif Src Dst
199
gc_bif1 Fail I Bif=u$bif:erlang:size/1 Src Dst=d => bif1 Fail Bif Src Dst
200
gc_bif1 Fail I Bif=u$bif:erlang:abs/1 Src Dst=d => bif1 Fail Bif Src Dst
201
gc_bif1 Fail I Bif=u$bif:erlang:float/1 Src Dst=d => bif1 Fail Bif Src Dst
202
gc_bif1 Fail I Bif=u$bif:erlang:round/1 Src Dst=d => bif1 Fail Bif Src Dst
203
gc_bif1 Fail I Bif=u$bif:erlang:trunc/1 Src Dst=d => bif1 Fail Bif Src Dst
206
make_fun Lbl=f Uniq=u NumFree=u => gen_make_fun(Lbl, Uniq, NumFree)