Skip to content

Commit 0258879

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

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
@@ -2400,6 +2400,11 @@ get_module_index(
24002400
%% JIT currentl calls this with two values: ?TERM_PRIMARY_CLEAR_MASK (-4) to
24012401
%% clear bits and ?TERM_BOXED_TAG_MASK (0x3F). We can avoid any literal pool
24022402
%% by using BICS for -4.
2403+
and_(#state{stream_module = StreamModule, stream = Stream0} = State0, Reg, 16#FFFFFF) ->
2404+
I1 = jit_armv6m_asm:lsls(Reg, Reg, 8),
2405+
I2 = jit_armv6m_asm:lsrs(Reg, Reg, 8),
2406+
Stream1 = StreamModule:append(Stream0, <<I1/binary, I2/binary>>),
2407+
State0#state{stream = Stream1};
24032408
and_(
24042409
#state{stream_module = StreamModule, available_regs = [Temp | AT]} = State0,
24052410
Reg,

0 commit comments

Comments
 (0)