Skip to content

Const materialisation - #121

Open
lxq015 wants to merge 3 commits into
go1.25.6-zte-devfrom
const_materialisation
Open

lxq015 wants to merge 3 commits into
go1.25.6-zte-devfrom
const_materialisation

Conversation

@lxq015

@lxq015 lxq015 commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

…ation

Change-Id: Ia7fedd934ecc2b11cb0de445f299dc5c6004e7b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/748960
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Mark Ryan <markdryan@meta.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Pull the constant materialisation code out into its own function, which
reduces indentation and improves readability.

Change-Id: Ia06baefa99c8f1a738c1b13d1a8b27111fa948b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/748961
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Ryan <markdryan@meta.com>
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Currently, we only materialise 32 bit signed constants - a 32 unsigned
value that exceeds the 32 bit signed maximum value is loaded from rodata.
A 32 bit unsigned value can be materialized by loading and zero extending,
which requires four instructions on rva20u64 - on rva22u64 and above only
three instructions are required.

Change-Id: I874a457f329ac75c2a0fb59b453cf8ef17df2972
Reviewed-on: https://go-review.googlesource.com/c/go/+/748962
Reviewed-by: Mark Ryan <markdryan@meta.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
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.

2 participants