~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to erts/emulator/beam/frag_ops.tab

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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/.
 
6
 
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
 
10
# under the License.
 
11
 
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.''
 
15
 
16
#     $Id$
 
17
#
 
18
 
 
19
#
 
20
# This file contains obsolete instructions that may implicitly build
 
21
# heap fragments.
 
22
#
 
23
 
 
24
# ================================================================
 
25
# Old bit syntax construction.
 
26
# ================================================================
 
27
 
 
28
%macro: i_bs_put_integer BsPutInteger
 
29
i_bs_put_integer j s I s
 
30
 
 
31
%macro: i_bs_put_float BsPutFloat
 
32
i_bs_put_float j s I s
 
33
 
 
34
%macro: i_bs_put_binary BsPutBinary
 
35
i_bs_put_binary j s I s
 
36
 
 
37
%macro: i_bs_put_binary_all BsPutBinaryAll
 
38
i_bs_put_binary_all j s
 
39
 
 
40
bs_put_string Len String => i_bs_put_string Len String
 
41
i_bs_put_string I I
 
42
 
 
43
 
 
44
# ================================================================
 
45
# Old bit syntax matching.
 
46
# ================================================================
 
47
 
 
48
#
 
49
# Matching binaries: Getting started.
 
50
#
 
51
%cold
 
52
%macro: bs_start_match BsStartMatch -fail_action
 
53
bs_start_match f x
 
54
bs_start_match f y
 
55
bs_start_match f r
 
56
bs_start_match Fail=f icwoa => jump Fail
 
57
 
 
58
bs_save I
 
59
bs_restore I
 
60
 
 
61
#
 
62
# Fetching integers from binaries.
 
63
#
 
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
 
68
 
 
69
#
 
70
# Fetching integers from binaries.
 
71
#
 
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
 
80
 
 
81
#
 
82
# Fetching floats from binaries.
 
83
#
 
84
bs_get_float Fail=f Sz=s Unit=u Flags=u Dst=d => \
 
85
                        gen_get_float(Fail, Sz, Unit, Flags, Dst)
 
86
 
 
87
%macro: i_bs_get_float BsGetFloat -fail_action -gen_dest
 
88
i_bs_get_float f s I d
 
89
 
 
90
#
 
91
# Skipping uninteresting bits.
 
92
#
 
93
bs_skip_bits Fail=f Sz=s Unit=u Flags=u => gen_skip_bits(Fail, Sz, Unit, Flags)
 
94
 
 
95
%macro: i_bs_skip_bits_imm BsSkipBitsImm -fail_action
 
96
i_bs_skip_bits_imm f I
 
97
 
 
98
%macro: i_bs_skip_bits BsSkipBits -fail_action
 
99
i_bs_skip_bits f x I
 
100
i_bs_skip_bits f r I
 
101
i_bs_skip_bits f y I
 
102
 
 
103
%macro: i_bs_skip_bits_all BsSkipBitsAll -fail_action
 
104
i_bs_skip_bits_all f
 
105
 
 
106
#
 
107
# Testing the tail.
 
108
#
 
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
 
111
bs_test_zero_tail f
 
112
bs_test_tail_imm f I
 
113
 
 
114
#
 
115
# Some optimisations.
 
116
#
 
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
 
119
 
 
120
#
 
121
# Old bit syntax construction.
 
122
#
 
123
bs_init Size Flags | old_bs_instructions() => i_bs_init_old
 
124
bs_need_buf Bits =>
 
125
 
 
126
bs_final Fail Dst => i_bs_final Fail Dst
 
127
 
 
128
i_bs_init_old
 
129
i_bs_final j d
 
130
 
 
131
 
 
132
#
 
133
# Old floating point instructions.
 
134
#
 
135
fmove FR=l Dst=d  => fmove_old FR Dst
 
136
 
 
137
# The old instruction for moving a float out of a floating point register.
 
138
# (Allocates a heap fragment.)
 
139
 
 
140
fmove_old l d
 
141
 
 
142
 
 
143
#
 
144
# Old arithmetic instructions.
 
145
#
 
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
 
150
 
 
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
 
153
 
 
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
 
156
 
 
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
 
161
 
 
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
 
164
 
 
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
 
176
 
 
177
int_bnot Fail Src Dst => i_int_bnot Fail Src Dst
 
178
 
 
179
i_plus j d
 
180
i_minus j d
 
181
i_times j d
 
182
i_m_div j d
 
183
i_int_div j d
 
184
i_rem j d
 
185
 
 
186
i_bsl j d
 
187
i_bsr j d
 
188
 
 
189
i_band j d
 
190
i_bor j d
 
191
i_bxor j d
 
192
 
 
193
i_int_bnot j s d
 
194
 
 
195
#
 
196
# Guard BIFs.
 
197
#
 
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
 
204
 
 
205
 
 
206
make_fun Lbl=f Uniq=u NumFree=u => gen_make_fun(Lbl, Uniq, NumFree)