Page MenuHomeFreeBSD

Introduce MACHINE_ABI as a list of ABI properties
ClosedPublic

Authored by brooks on Sep 1 2022, 10:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 21, 1:19 PM
Unknown Object (File)
Mar 8 2024, 6:31 PM
Unknown Object (File)
Mar 8 2024, 6:31 PM
Unknown Object (File)
Mar 8 2024, 6:31 PM
Unknown Object (File)
Mar 8 2024, 6:31 PM
Unknown Object (File)
Mar 8 2024, 6:31 PM
Unknown Object (File)
Mar 8 2024, 6:19 PM
Unknown Object (File)
Jan 29 2024, 12:16 PM

Details

Summary

MACHINE_ABI is a list of properties about the ABI used for MACHINE_ARCH.
It should be used in place of long conditionals on MACHINE_ARCH where
practical.

The following properties are indicated with one of the follow values:

Floating point ABI: soft-float, hard-float
Size of long (size_t, etc): long32, long64
Pointer type: ptr32, ptr64
Size of time_t: time32, time64

For example, i386 targets will be:
MACHINE_ABI= hard-float long32 ptr32 time32

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I'd be willing to entertain another name like MACHINE_ABI_PROPS to avoid the need for D36420, but we use MACHINE_ABI extensively in CheriBSD and I'm not convinced anyone uses the current variable.

For example, i386 targets will be:
MACHINE_ARCH= hard-float long32 ptr62 time32

s/ptr62/ptr32/ and s/ARCH/ABI/

For example, i386 targets will be:
MACHINE_ARCH= hard-float long32 ptr62 time32

s/ptr62/ptr32/ and s/ARCH/ABI/

That was creative of me... Fixed in https://github.com/freebsd/freebsd-src/compare/main...brooksdavis:freebsd:machine_abi

Generally, I quite like it.
Just one question, though...

share/mk/bsd.cpu.mk
376

powerpcspe too?

share/mk/bsd.cpu.mk
376

That's not soft-float, that's hard-float-in-integer-register-file?

share/mk/bsd.cpu.mk
376

That's what 'softfloat' means on arm too... though that's a bit squishy

share/mk/bsd.cpu.mk
376

The difference here is that powerpcspe's baseline includes floating-point instructions, and those instructions are defined to operate on the integer registers, i.e. the hardware has merged the two register files (and in fact the floating-point ones are 64-bit extensions of the integer ones). Whereas on arm it's "put your floating-point arguments in integer registers, and if you compile with floating-point instructions enabled then you can pull them out into floating-point registers and use native instructions".

Can you also add endianness?

We can revisit if we ever add something weird like aarch64be :).
But since that's at best speculative (and at worst manu / andy going hell no), we're good to go with this version.

This revision is now accepted and ready to land.Sep 27 2022, 6:08 PM

Add missing guard on CPUTYPE

This revision now requires review to proceed.Sep 27 2022, 6:24 PM
share/mk/bsd.cpu.mk
376

It is true though that the old CPUTYPE=soft thing for arm (which maybe we can just kill in 14.0 to make this less painful?) isn't really soft-float in that you want soft-float routines in libc or additional builtins in libcompiler_rt, at least IIRC.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 5 2022, 4:30 PM
This revision was automatically updated to reflect the committed changes.