@@ -68,9 +68,6 @@ def bytesBE(n: Int, width: Int): Unit / emit[Byte] = {
68
68
/// emit bytes of the given int as a 4 bytes in big-endian byte order
69
69
def bytesBE(n: Int): Unit / emit[Byte] = bytesBE(n, 4)
70
70
71
- /// emit bytes of the given int as a 4 bytes in big-endian byte order
72
- def bytes(n: Int): Unit / emit[Byte] = bytesBE(n)
73
-
74
71
/// emit bytes of the given int as width bytes (in 2s-complement) in little-endian byte order
75
72
def signedBytesLE(int: Int, width: Int): Unit / emit[Byte] =
76
73
if (int < 0) {
@@ -178,9 +175,6 @@ def bitsBE(byte: Byte): Unit / emit[Bit] = {
178
175
}
179
176
}
180
177
181
- /// emit bits of the given Byte as 8 Bits in big-endian bit order
182
- def bits(byte: Byte): Unit / emit[Bit] = bitsBE(byte)
183
-
184
178
/// emit bits of the given Byte as width Bits in little-endian bit order
185
179
def bitsLE(v: Int, width: Int): Unit / emit[Bit] = {
186
180
var mask = 1
@@ -222,8 +216,8 @@ def collectBitsBE{ body: => Unit / emit[Bit] }: Int = {
222
216
}
223
217
224
218
/// split emitted bytes and emit the individual bits in big-endian bit order
225
- def ungroupBytes { body: => Unit / emit[Byte] }: Unit / emit[Bit] =
226
- for[Byte]{body}{ b => bits (b) }
219
+ def ungroupBytesBE { body: => Unit / emit[Byte] }: Unit / emit[Bit] =
220
+ for[Byte]{body}{ b => bitsBE (b) }
227
221
228
222
/// streaming negation in 2s-complement for little-endian bitstreams
229
223
def twoscomplementLE{ body: => Unit / emit[Bit] }: Unit / emit[Bit] = {
@@ -273,11 +267,6 @@ def groupBytesLE{ body: => Unit / emit[Bit] }: Unit / emit[Byte] = {
273
267
}
274
268
}
275
269
276
- /// group 8 bits into a byte each, big-endian bit order.
277
- /// NOTE: The remainder is dropped.
278
- def groupBytes{ body: => Unit / emit[Bit] }: Unit / emit[Byte] =
279
- groupBytesBE{body}
280
-
281
270
// Literals/splices
282
271
// ----------------
283
272
/// Splices allowed in bit stream literals
@@ -293,7 +282,7 @@ effect BitSplices = {
293
282
/// Ignores whitespace
294
283
def bit{ body: => Unit / { literal, BitSplices } }: Unit / emit[Bit] = {
295
284
try {
296
- ungroupBytes {
285
+ ungroupBytesBE {
297
286
try {
298
287
body()
299
288
}
@@ -317,7 +306,7 @@ def bit{ body: => Unit / { literal, BitSplices } }: Unit / emit[Bit] = {
317
306
}
318
307
with splice[Unit] { _ => resume(()) }
319
308
with splice[Bit] { b => do emit(b); resume(()) }
320
- with splice[Byte] { b => bits (b); resume(()) }
309
+ with splice[Byte] { b => bitsBE (b); resume(()) }
321
310
with splice[OfWidth[LE[Int]]] { i =>
322
311
bitsLE(i.raw.raw, i.width)
323
312
resume(())
0 commit comments