Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jpegqs
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
jpegqs
5y ago
So far I've got these results: Allwinner H616 (Cortex-A53) 64-bit mode linux-5.15.7.tar.xz : 25.12 --> 24.43 (+3%) linux-firmware-20211027.tar.xz : 22.80 --> 21.63 (+5%) Maybe on more complex ARM processors the
32.
▲
by
jpegqs
5y ago
Cool, but it doesn't generate SBB in real code, but instead gives me something like this: xorl %r11d, %r11d cmpl %r12d, %eax seta %r11b And if I do both of these, side by side: tmp = rc.code < rc_bound ? ~0 :
33.
▲
by
jpegqs
5y ago
I tried it and realized that predicated instructions are removed from aarch64, which I was not aware of (because I rarely work with ARM). That sucks. But I'll try to do it without them.
34.
▲
by
jpegqs
5y ago
Can be done, ARM has better support for predicated instructions. May be done without using inline assembly. But I guess ARM CPUs can also have a smaller branch penalty, which means less speedup from such a patch. You can try it by replacing
35.
▲
by
jpegqs
5y ago
It would be great to have builtin for CMOV. But I also want GCC to utilize the hack with the SBB instruction when I write something like: (unsigned)a < (unsigned)b ? ~0 : 0 Instead of three instructions what it generates.
36.
▲
by
jpegqs
5y ago
LZMA compression (used in 7-zip, XZ, LZMA2) is known as one of the best, but it has a noticeable drawback - it's slow. I tried to improve the decompression speed by removing excessive branching at decoding of every bit from the compres
37.
▲
Show HN: 10-40% faster LZMA decoder using x86 CMOVcc
(gist.github.com)
205 points
by
jpegqs
5y ago
|
68 comments
38.
▲
by
jpegqs
5y ago
I'm porting Linux packages that compile for GCC/Clang to an EDG frontend based compiler and I need to remove forced -Werror from build scripts because different compilers have different warnings (and even false warnings due to com
39.
▲
by
jpegqs
5y ago
I made a windows port on github, you can try exploit that. ".//machine:foo/bar/baz" - will it work if the dot is added at the beginning?
40.
▲
by
jpegqs
5y ago
And now it compiles on Windows, at least with Msys2. I'm updating the code on github.
41.
▲
by
jpegqs
5y ago
It won't be a problem in this code because "%" is not handled. But could be a vulnerability for more implemented HTTP servers, and a few days ago I got this idea too.
42.
▲
by
jpegqs
5y ago
Yes, that's a vulnerability, I have fixed it on github.
43.
▲
by
jpegqs
5y ago
Thanks for noticing this, I fixed it on github. However, it seems that browsers are simply ignoring CRs. So that "\n\n" is enough.
44.
▲
by
jpegqs
5y ago
Thanks, I forgot about that. It would be very helpful to have some extra space for fixes.
45.
▲
by
jpegqs
5y ago
Good point, I need add something like b[3]='.', an then use b+3 as a path, not b+5, to fix that vulnerability. Update: I fixed this on github.
46.
▲
by
jpegqs
5y ago
I can explain it: m = n ? /* if (n != 0) */ /* adds index.html if path ends with "/" (means the filename is omitted), otherwise copies zero */ strcpy(b+i-1,b[i-2]-'/'?&qu
47.
▲
by
jpegqs
5y ago
It's calculated that strcpy() should never cause a buffer overflow here.
48.
▲
by
jpegqs
5y ago
I tried to make it secure and protect from such things. If someone finds vulnerabilities, please let me know.
49.
▲
by
jpegqs
5y ago
I have provided protection against this.
50.
▲
by
jpegqs
5y ago
It's cool if you can read code like this without issue. I'm chasing Kolmogorov complexity, rather than obfuscation. I add things like this to fill gaps in a specific shape.
51.
▲
by
jpegqs
5y ago
This is what I am arguing about with another IOCCC winner. What can be called obfuscation, and where are its boundaries.
52.
▲
Show HN: Micro HTTP server in 22 lines of C
(twitter.com)
223 points
by
jpegqs
5y ago
|
100 comments
53.
▲
by
jpegqs
5y ago
Can be both, a string and a function: char main [/*x86*/] __attribute__ ((section(".text")) )="WTYH)9Zj8_j7H)9]R" "H)9^\350\0\0\0\0H)1^R" "H))Z8<2u\366j&
54.
▲
Fitting a FORTH in 512 bytes
(niedzejkob.p4.team)
190 points
by
jpegqs
5y ago
|
57 comments
55.
▲
POKEGB: A gameboy emulator that only plays Pokemon Blue, in 62 lines of C++
(twitter.com)
2 points
by
jpegqs
5y ago
|
0 comments
56.
▲
by
jpegqs
6y ago
Location: Novosibirsk, Russia Remote: Yes Willing to relocate: Probably not Technologies: C/Assembly, SIMD (SSE/AVX/NEON/HVX and others), OpenCL, OpenMP Résumé/CV: https://www.linkedin.com/in/il
57.
▲
Show HN: Obfuscated C code (IOCCC style) that I wrote last year
(github.com)
4 points
by
jpegqs
6y ago
|
0 comments
58.
▲
IOCCC 2020 Source Code Released
(ioccc.org)
5 points
by
jpegqs
6y ago
|
0 comments
59.
▲
by
jpegqs
6y ago
The better way to check for buffer overflow here is "((unsigned T)i < n)". But the "(i >= 0 && i < n)" way that I used in this example - I have seen many times. So hackers can scan open source software c
60.
▲
by
jpegqs
6y ago
Thank you, I didn't know about this compiler option. Checked that the code works as expected with this option.
More ›