Page MenuHomeFreeBSD

libc/string/memset.c: Use unsigned long for stores
ClosedPublic

Authored by arichardson on Apr 1 2021, 2:38 PM.
Tags
None
Referenced Files
F144430748: D29536.id87763.diff
Sun, Feb 8, 10:04 AM
F144400751: D29536.id87689.diff
Sun, Feb 8, 6:12 AM
F144299576: D29536.id87691.diff
Sat, Feb 7, 5:34 PM
Unknown Object (File)
Sat, Jan 31, 6:07 AM
Unknown Object (File)
Jan 6 2026, 6:58 PM
Unknown Object (File)
Dec 29 2025, 2:03 AM
Unknown Object (File)
Dec 4 2025, 12:02 AM
Unknown Object (File)
Nov 24 2025, 10:36 PM
Subscribers

Details

Summary

While most 64-bit architectures have an assembly implementation of this
file, RISC-V does not. As we now store 8 bytes instead of 4 it should speed
up RISC-V.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38253
Build 35142: arc lint + arc unit

Event Timeline

Would (u)intptr_t make more sense so it's faster on CHERI? Doesn't make a difference upstream but does to us.

Would (u)intptr_t make more sense so it's faster on CHERI? Doesn't make a difference upstream but does to us.

I thought about that, but that would require additional changes to create an all-ones capability register.

Would (u)intptr_t make more sense so it's faster on CHERI? Doesn't make a difference upstream but does to us.

I thought about that, but that would require additional changes to create an all-ones capability register.

Oh, right, memset not bzero, never mind then

kib added inline comments.
lib/libc/string/memset.c
88

Did you considered lowering 3 to e.g. 2?

This revision is now accepted and ready to land.Apr 15 2021, 11:34 AM
lib/libc/string/memset.c
88

This might make sense but I feel uncomfortable making that change without benchmarks.

Drop #undef and add a TODO comment for the threshold

This revision now requires review to proceed.Apr 19 2021, 10:50 AM
This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2021, 12:47 AM
This revision was automatically updated to reflect the committed changes.