-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement emit_apply_fun_shared #12
base: arm32-jit
Are you sure you want to change the base?
Conversation
b079779
to
51e6f17
Compare
Only the else case is needed now
cadf9a0
to
83b6c88
Compare
Use ldmia to Increase the pointer AFTER each read, first word goes in TMP, second in ARG1
5318ced
to
c2f65f7
Compare
this looks like an argument for an error or exception
@@ -113,7 +113,7 @@ void BeamGlobalAssembler::emit_apply_fun_shared() { | |||
emit_ptr_val(ARG1, ARG1); | |||
a.sub(ARG1, ARG1, imm(TAG_PRIMARY_LIST)); | |||
a.ldmia(arm::Mem(ARG1), a32::GpList({TMP, ARG1})); | |||
//a.str(TMP3, arm::Mem(TMP2).post(sizeof(Eterm))); | |||
a.str(TMP, x_register); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fails emission....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing a Mem object is fine and emission succeeds wiht getXRef(0) but it fails if the operand has been setup with setIndex and setShift.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to ChatGPT we need another register to use STR
:
; Load the address of 'var' into r1 (or any free register).
LDR r1, =var ; r1 now has the address of var
; Store r0 (32 bits) into [r1].
STR r0, [r1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this code the register used as base register is inside x_register memory object operator. It is defined at creation using one of the available constructors of class arm::Mem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the steps anyway. The return of getCARRef is type arm:mem and x_register is type arm:mem. Can we just directly put the return of getCARRef in x_register?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails because getXReg adds an offset and we want to use a scale and an index register. We cannot use everything.
A correct initialization would be auto x_register = arm::Mem(scheduler_registers);
On arm32 we will have an Eterm Size of 32 bit (unsigned long), so to address the next Eterm we need to scale with x4 instead of x8
|
||
ERTS_CT_ASSERT(_TAG_PRIMARY_MASK - TAG_PRIMARY_LIST == (1 << 1)); | ||
a.tst(ARG1, imm(1)), | ||
a.b_ne(malformed_list), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there commas and not semicolon at the end of the two lines above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
omg... just my erlang braincells adding chaos
getXRef would also add an offset and this is not compatible with Index * Scale
Implementation line by line