Skip to content

py/nlraarch64: Fix clobber list for nlr_jump(). - #11716

Closed
djlowther wants to merge 1 commit into
micropython:masterfrom
glasgowPLI:master
Closed

djlowther wants to merge 1 commit into
micropython:masterfrom
glasgowPLI:master

Conversation

@djlowther

Copy link
Copy Markdown
Contributor

Registers x19-x29 are loaded by the inline asm but were not in the clobber list. If the compiler
allocates the top' variable to one of these registers all following ldp' instructions will break.

Registers x19-x29 should therefore added to clobber list.

Comment thread py/nlraarch64.c Outdated

@dlech dlech Jun 11, 2023 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to put these in numerical order.

Also could add a comment to explain why x29 is omitted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Numerical would make sense, I just threw them in the order they appeared. X29 is omitted because as the frame pointer, it (a) won't be allocated to hold top by the compiler and (b) will throw a compile error (at least on clang) if listed as clobbered.

I'll fix it tomorrow morning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've now incorporated those suggestions into the PR.

Registers x19-x29 are loaded by the inline asm
but were not in the clobber list. If the compiler
allocates the `top' variable to one of these registers
all following `ldp' instructions will break.

Registers x19-x29 accordingly added to clobber list.

Signed-off-by: Duncan Lowther <[email protected]>
@dpgeorge

Copy link
Copy Markdown
Member

Thanks for the contribution. But I think #11762 fixes the issue in a better way that's more consistent with how the other native NLR jumps are implemented.

@codecov

codecov Bot commented Jun 14, 2023

Copy link
Copy Markdown

Codecov Report

Merging #11716 (3bd5416) into master (fd27770) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #11716   +/-   ##
=======================================
  Coverage   98.40%   98.40%           
=======================================
  Files         155      155           
  Lines       20539    20539           
=======================================
  Hits        20211    20211           
  Misses        328      328           

@github-actions

Copy link
Copy Markdown

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% PICO
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS

@djlowther

Copy link
Copy Markdown
Contributor Author

As #11762 has been merged, this pull request is no longer needed.

@djlowther djlowther closed this Jun 15, 2023
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