Page MenuHomeFreeBSD

alexandre.yamashita_eldorado.org.br (Alexandre Yukio Yamashita)
User

Projects

User does not belong to any projects.

User Details

User Since
Apr 25 2018, 6:55 PM (90 w, 3 d)

Recent Activity

May 24 2018

alexandre.yamashita_eldorado.org.br added a comment to D15220: strcmp optimization for powerpc64.

Hi. Could someone review my patch please?
Basically, this code loads and compares the chars by byte until their addresses are aligned.
After, we load and compare the chars by double word until a \0 or a difference in the chars is found.
Finally, we compute the differences between the chars.

Hi Alexandre,
The code looks fine to me, but I do have one question.
Not to diminish the work you put into this, but has any effort been put into finding just how often strcmp() is run over strings longer than 64 characters, in the wild? If the vast majority of the comparisons are on "short" strings, the performance improvements seem less effective. But, if it does turn out that moderate to large strings are often compared, then this is certainly a big win.

May 24 2018, 8:20 PM · PowerPC
alexandre.yamashita_eldorado.org.br added a comment to D15220: strcmp optimization for powerpc64.

My question was a little bit more naive, I don't know a lot about industrial compilers. I wondered if for the compiler/rtlib hosted its own builtins for things like this and how that worked. After digging through llvm I think the answer to that is no. llvm was a bit easier to digest than gcc, with what it calls builtins it will simplify library calls and can do other things like inline them with MI and MD information, but I believe it would fall back to the OS libc like this for the machine dependent implementation.

I implemented a vectorized version of this code, but I could not obtain significant improvements in the performance rates.
I shared this version on https://github.com/PPC64/freebsd/blob/41388369cb7db55b995debd99c2a514409edd56a/lib/libc/powerpc64/string/strcmp.S .
Could you review this code without vectorization?

May 24 2018, 4:53 PM · PowerPC

May 18 2018

alexandre.yamashita_eldorado.org.br added a comment to D15220: strcmp optimization for powerpc64.

My question was a little bit more naive, I don't know a lot about industrial compilers. I wondered if for the compiler/rtlib hosted its own builtins for things like this and how that worked. After digging through llvm I think the answer to that is no. llvm was a bit easier to digest than gcc, with what it calls builtins it will simplify library calls and can do other things like inline them with MI and MD information, but I believe it would fall back to the OS libc like this for the machine dependent implementation.

May 18 2018, 3:20 PM · PowerPC
alexandre.yamashita_eldorado.org.br updated the diff for D15220: strcmp optimization for powerpc64.

Replace spaces by tabs

May 18 2018, 3:09 PM · PowerPC

May 9 2018

alexandre.yamashita_eldorado.org.br added a project to D15220: strcmp optimization for powerpc64: PowerPC.
May 9 2018, 3:53 PM · PowerPC

May 7 2018

alexandre.yamashita_eldorado.org.br added a comment to D15220: strcmp optimization for powerpc64.

One thing I am wondering if newer compilers have intrinsic heuristics for common lib calls like this? Do you see the same performance delta with gcc8 from ports?

May 7 2018, 12:33 PM · PowerPC
alexandre.yamashita_eldorado.org.br updated the diff for D15220: strcmp optimization for powerpc64.

Improve optimization

May 7 2018, 12:19 PM · PowerPC

Apr 27 2018

alexandre.yamashita_eldorado.org.br added reviewers for D15220: strcmp optimization for powerpc64: jhibbits, nwhitehorn, breno.leitao_gmail.com.
Apr 27 2018, 9:04 PM · PowerPC
alexandre.yamashita_eldorado.org.br updated subscribers of D15220: strcmp optimization for powerpc64.
Apr 27 2018, 9:03 PM · PowerPC
alexandre.yamashita_eldorado.org.br updated the summary of D15220: strcmp optimization for powerpc64.
Apr 27 2018, 9:01 PM · PowerPC
alexandre.yamashita_eldorado.org.br created D15220: strcmp optimization for powerpc64.
Apr 27 2018, 8:55 PM · PowerPC