Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
94252cf
Update to LLVM 19
savannahostrowski Sep 14, 2024
f8dc236
update syntax in disabled gil ci
savannahostrowski Sep 14, 2024
80a3b40
📜🤖 Added by blurb_it.
blurb-it[bot] Sep 14, 2024
ba02d7c
Merge branch 'main' into jit-llvm-19
savannahostrowski Sep 25, 2024
7a1133e
Update readme
savannahostrowski Sep 25, 2024
d8e38db
fix free-threaded by pseudo-pinning version
savannahostrowski Sep 25, 2024
b8ae218
Add check to see that registers match in stencil generation
savannahostrowski Sep 26, 2024
4368d5f
Appease linters
savannahostrowski Sep 26, 2024
12fc5cd
Remove devcontainer instructions from readme
savannahostrowski Sep 26, 2024
7f9fe5a
Update README
savannahostrowski Sep 26, 2024
8c21729
Merge branch 'main' into jit-llvm-19
savannahostrowski Oct 1, 2024
a597ea5
Remove ghccc
savannahostrowski Oct 13, 2024
4df5efc
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 13, 2024
85b858d
add back cpu_count
savannahostrowski Oct 13, 2024
9209651
Appease linter
savannahostrowski Oct 13, 2024
a842f90
Add sys import
savannahostrowski Oct 13, 2024
73c725b
Move preserve_none
savannahostrowski Oct 13, 2024
4d8a012
define jit_func_preserve_none
savannahostrowski Oct 15, 2024
994af97
add comment
savannahostrowski Oct 15, 2024
0d86727
add comment
savannahostrowski Oct 15, 2024
98f0535
Fix whitespace
savannahostrowski Oct 15, 2024
9a20a2e
Move header to separate file
savannahostrowski Oct 15, 2024
4a2f3c4
Add newline
savannahostrowski Oct 15, 2024
4c4ca2f
Add newline
savannahostrowski Oct 15, 2024
7d1745a
Address PR comments
savannahostrowski Oct 16, 2024
c8d4692
Replace entry_symbol with string
savannahostrowski Oct 16, 2024
72d5ed0
Appease linter
savannahostrowski Oct 16, 2024
a96af70
Add newline
savannahostrowski Oct 16, 2024
9827ade
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 16, 2024
4e32743
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 18, 2024
ed29ae2
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 18, 2024
3a2ecee
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 21, 2024
3259994
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 22, 2024
5ef69e6
📜🤖 Added by blurb_it.
blurb-it[bot] Oct 22, 2024
709bb08
Rephrase
savannahostrowski Oct 22, 2024
5ca8d61
Run pre-commit
savannahostrowski Oct 22, 2024
24d9143
Add newline
savannahostrowski Oct 22, 2024
b351303
Add line to remove symlink
savannahostrowski Oct 23, 2024
53ec962
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 23, 2024
fe58a12
Fix typo
savannahostrowski Oct 23, 2024
a4b2d3e
Merge branch 'remove-ghccc' of https://github.com/savannahostrowski/c…
savannahostrowski Oct 23, 2024
0f88955
Fix wording
savannahostrowski Oct 23, 2024
4e16dd6
Merge branch 'main' into remove-ghccc
savannahostrowski Oct 25, 2024
bb1e650
Update Misc/NEWS.d/next/Core_and_Builtins/2024-10-22-04-18-53.gh-issu…
savannahostrowski Oct 29, 2024
5f3ec52
Apply suggestions from code review
savannahostrowski Oct 29, 2024
46cee93
Address PR comments
savannahostrowski Oct 29, 2024
c119a5d
Fix whitespace
savannahostrowski Oct 29, 2024
cbb0ddf
Add newline to jit.h
savannahostrowski Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add check to see that registers match in stencil generation
  • Loading branch information
savannahostrowski committed Sep 26, 2024
commit b8ae2183dc4d24aff8a6f38c8618b37da2cf20d8
9 changes: 8 additions & 1 deletion Tools/jit/_stencils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,22 @@ class Hole:
def __post_init__(self) -> None:
self.func = _PATCH_FUNCS[self.kind]

def fold(self, other: typing.Self) -> typing.Self | None:
def fold(self, other: typing.Self, body: bytes) -> typing.Self | None:
"""Combine two holes into a single hole, if possible."""
instruction_a = int.from_bytes(body[self.offset : self.offset + 4], byteorder=sys.byteorder)
instruction_b = int.from_bytes(body[other.offset : other.offset + 4], byteorder=sys.byteorder)
reg_a = instruction_a & 0b11111
reg_b1 = instruction_b & 0b11111
reg_b2 = (instruction_b >> 5) & 0b11111

if (
self.offset + 4 == other.offset
and self.value == other.value
and self.symbol == other.symbol
and self.addend == other.addend
and self.func == "patch_aarch64_21rx"
and other.func == "patch_aarch64_12x"
and reg_a == reg_b1 == reg_b2
):
# These can *only* be properly relaxed when they appear together and
# patch the same value:
Expand Down
2 changes: 1 addition & 1 deletion Tools/jit/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _dump_stencil(opname: str, group: _stencils.StencilGroup) -> typing.Iterator
if skip:
skip = False
continue
if pair and (folded := hole.fold(pair)):
if pair and (folded := hole.fold(pair, stencil.body)):
skip = True
hole = folded
yield f" {hole.as_c(part)}"
Expand Down