Page MenuHomeFreeBSD

amd64: micro-optimize vptopte()/vtopde() further
ClosedPublic

Authored by kib on Jan 8 2022, 5:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 28, 11:08 AM
Unknown Object (File)
Dec 20 2023, 8:08 AM
Unknown Object (File)
Dec 13 2023, 10:59 PM
Unknown Object (File)
Aug 31 2023, 6:32 AM
Unknown Object (File)
Aug 5 2023, 5:05 AM
Unknown Object (File)
Aug 5 2023, 5:05 AM
Unknown Object (File)
Aug 5 2023, 5:02 AM
Unknown Object (File)
Aug 5 2023, 4:55 AM
Subscribers

Details

Summary
Eliminate shlq $3,address shift after masking of the va is done, which
is needed to convert pt_entry_t[] array index into byte offset.
Do it by preshifting the mask, and compensating the right shift of va.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Jan 8 2022, 5:16 AM

I'll take a look at this tomorrow.

As an aside, have you seen how the compiler implements the static variable pg_g? It's implementing pg_g using a single byte of storage and performing a size extending load of the byte followed by a left shift by 8 wherever the variable is used to recreate a value of the declared type, pt_entry. Removing static from the variable definition reduces the code size by 240 bytes.

In D33786#764217, @alc wrote:

As an aside, have you seen how the compiler implements the static variable pg_g? It's implementing pg_g using a single byte of storage and performing a size extending load of the byte followed by a left shift by 8 wherever the variable is used to recreate a value of the declared type, pt_entry. Removing static from the variable definition reduces the code size by 240 bytes.

Will you commit the change? Or do you want me to add it to the series?

In D33786#764218, @kib wrote:
In D33786#764217, @alc wrote:

As an aside, have you seen how the compiler implements the static variable pg_g? It's implementing pg_g using a single byte of storage and performing a size extending load of the byte followed by a left shift by 8 wherever the variable is used to recreate a value of the declared type, pt_entry. Removing static from the variable definition reduces the code size by 240 bytes.

Will you commit the change? Or do you want me to add it to the series?

Ping?

This revision is now accepted and ready to land.Feb 1 2022, 3:06 PM
This revision was automatically updated to reflect the committed changes.