Better HN
topnewbestaskshowjobs
Log inSign up

npendleton

21 karma · joined Dec 17, 2017 (8y ago) · 14 submissions

Submissions

comment 1y ago · link · parent

Hah, great point!

comment 1y ago · link · parent

This is so cool!

Terrible nitpick, but this is actually 3 operations, not instructions. On x86 you get 4:

  is_leap_year_fast:
        imul    eax, edi, 1073750999
        and     eax, -1073614833
        cmp     eax, 126977
        setb    al
        ret
On ARM you get a bit more due to instruction encoding:

  is_leap_year_fast:
        ldr     r1, .LCPI0_0
        mul     r0, r0, r1
        ldr     r1, .LCPI0_1
        and     r1, r0, r1
        mov     r0, #0
        cmp     r1, #126976
        movwls  r0, #1
        bx      lr
  .LCPI0_0:
        .long   1073750999
  .LCPI0_1:
        .long   3221352463
Compiler explorer reference: https://godbolt.org/z/7ajYqbT9z

comment 1y ago · link · parent

Whoa, it looks like my old patch is getting fixed up properly now! We might be getting this feature https://lore.kernel.org/git/20250501214057.371711-4-gitster@...

comment 1y ago · link · parent

I agree! Unfortunately the best information appears to be in the individual series datasheets, however I did find this page to be helpful: https://products.espressif.com/#/product-selector

comment 2y ago · link · parent

Update, it's back! 2024-04-11T18:02Z

comment 2y ago · link · parent

The GitHub mirror for git is currently 404'ing (2024-04-11T17:55Z). Here it is yesterday: https://web.archive.org/web/20240410011924/https://github.co...

7.

GitHub Git Mirror Down(github.com ↗)

1 points · by npendleton · 2y ago · 2 comments

comment 3y ago · link · parent

Might be worth a look at remake, it can help a ton when debugging complex Make setups: https://github.com/rocky/remake

comment 5y ago · link · parent

Post author here, you're correct! thanks for spotting it, I'll fix it now.

comment 6y ago · link · parent

https://groupgets.com/manufacturers/good-stuff-department/pr... Open source by the talented Greg Davill

comment 7y ago · link · parent

Thanks Gregory, that's really good info! Appreciate you taking the time to reply (and for all your work on this software, too!).

comment 7y ago · link · parent

A few bits of trivia for anyone considering NuttX:

  - uses a pure software interrupt and redirects to your ISR's, so you incur additional overhead for all interrupts in your system
  - ships with a homegrown c stdlib, which has several functional/security bugs (ex: vscanf will overflow if you use format specifiers other than [l]i/u), and neglects to provide gcc attributes for arg checking for the printf family functions
  - build system issues $(MAKE) calls in every folder you're building, which makes it terrifically slow (especially noticeable on incremental builds)
  - architecture makes it difficult to write custom drivers without building them into the kernel (eg if you want to use the kernel as a module in your project)

comment 8y ago · link · parent

binwalk is a good tool to use for this, especially early analysis: https://github.com/ReFirmLabs/binwalk

comment 8y ago · link · parent

My favorite flavor, plantuml, available with a cheesy (but very convenient) cli wrapper via npm- https://www.npmjs.com/package/node-plantuml The --unicode mode is particularly delightful