Skip to content
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

Arm large stack #677

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Arm large stack #677

merged 1 commit into from
Jan 11, 2024

Conversation

bgregoir
Copy link
Contributor

@bgregoir bgregoir commented Jan 8, 2024

Fix the generate code for arm when stack is large.

@@ -26,6 +26,9 @@ module Arm_core = struct

let known_implicits = ["NF", "_nf_"; "ZF", "_zf_"; "CF", "_cf_"; "VF", "_vf_"]

let alloc_stack_need_extra sz =
not (Arm_decl.is_expandable (Conv.cz_of_z sz))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this check corresponds to whether we can allocate/free stack with SUB sp, sp, #imm and ADD sp, sp, #imm, we can also allow 12-bit immediates. We should have is_expandable || is_w12_encoding (this corresponds to encodings T3 and T4 from the manual, e.g. A7.7.5 for ADD).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now use is_arith_small

@@ -79,12 +79,18 @@ Section LINEARIZATION.
Notation vtmpi := (mk_var_i (to_var R12)).

(* TODO_ARM: This assumes 0 <= sz < 4096. *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have remove the comment.

if tmp is Some aux then
arm_cmd_large_subi_tmp rspi aux sz
else
[:: arm_op_subi rspi rspi sz].

(* TODO_ARM: This assumes 0 <= sz < 4096. *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, what do you means here ? What is not longer true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@bgregoir bgregoir force-pushed the arm-large-stack branch 2 times, most recently from fec6d2c to 190eeee Compare January 9, 2024 16:57
@vbgl vbgl mentioned this pull request Jan 10, 2024
9 tasks
@vbgl vbgl force-pushed the arm-large-stack branch 2 times, most recently from 77007ea to 00731a3 Compare January 10, 2024 10:06
Copy link
Member

@vbgl vbgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thanks.

@vbgl vbgl merged commit 01b11ca into main Jan 11, 2024
@vbgl vbgl deleted the arm-large-stack branch January 11, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants