Skip to content

Commit 64867cc

Browse files
committed
armv6m: optimize and 0xFFFFFF
Signed-off-by: Paul Guyot <pguyot@kallisys.net>
1 parent 0d7a384 commit 64867cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/jit/src/jit_armv6m.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,6 +2482,11 @@ get_module_index(
24822482
%% JIT currentl calls this with two values: ?TERM_PRIMARY_CLEAR_MASK (-4) to
24832483
%% clear bits and ?TERM_BOXED_TAG_MASK (0x3F). We can avoid any literal pool
24842484
%% by using BICS for -4.
2485+
and_(#state{stream_module = StreamModule, stream = Stream0} = State0, Reg, 16#FFFFFF) ->
2486+
I1 = jit_armv6m_asm:lsls(Reg, Reg, 8),
2487+
I2 = jit_armv6m_asm:lsrs(Reg, Reg, 8),
2488+
Stream1 = StreamModule:append(Stream0, <<I1/binary, I2/binary>>),
2489+
State0#state{stream = Stream1};
24852490
and_(
24862491
#state{stream_module = StreamModule, available_regs = [Temp | AT]} = State0,
24872492
Reg,

0 commit comments

Comments
 (0)