Page MenuHomeFreeBSD

libm: Implement femode_t, fegetmode(), and fesetmode() as per C23
Needs ReviewPublic

Authored by kfv on Mon, Aug 31, 12:51 PM.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76348
Build 73231: arc lint + arc unit

Event Timeline

kfv requested review of this revision.Mon, Aug 31, 12:51 PM

This should be reviewed by kib, andy (for ARM), jrtc27 (for riscv64), jhibbits (for ppc), and kargl (for msun). Please contact kargl by e-mail, he does not have a phabricator account.

lib/msun/arm/fenv.c
324

We don't support softfloat ARM anymore, so this can be omitted.

This should be reviewed by kib, andy (for ARM), jrtc27 (for riscv64), jhibbits (for ppc), and kargl (for msun).

Updating reviewers. Thanks!

Please contact kargl by e-mail, he does not have a phabricator account.

Sure, I will do.

Is it reasonable to provide the inline versions of these methods for complicated cases, like x86? Could it be always a function call?

lib/msun/amd64/fenv.c
45

Please use designated initializers.

lib/msun/i387/fenv.c
45

Can we use designated initializers please?

lib/msun/man/fegetmode.3
31

Why 'attempts'? There is no error defined for the implementation. I would say directly 'function stores the current control modes'.
Same for fesetmode.

I suspect that the language was directly copied from the standard.

Also, it is the standard' requirement that fesetmode() can only be called on the result of the call to fegetmode(). Do we need to say that? We expose the structure, there is no hidden members.

lib/msun/x86/fenv.h
429

Why this cannot be __fldcw(&__modep->__control)?