Commit graph

98 commits

Author SHA1 Message Date
Martin Kinkelin
a3716c0044 Initialize new TargetC fields 2022-04-26 23:47:15 +02:00
Martin Kinkelin
599f563fe4 Implement new Target::supportsLinkerDirective() properly 2022-02-24 03:59:43 +01:00
Martin Kinkelin
78681e12e1 Sync with dmd/target.d
Mainly, initialize splitVBasetable, crucial for MSVC targets.
2022-02-19 05:57:07 +01:00
Martin Kinkelin
5a2f3ed87f Upgrade frontend & libs to v2.099.0-beta.1+ (dlang/dmd@1c31d85613) 2022-02-16 20:52:07 +01:00
Martin Kinkelin
4967565ed5 [refactor getRealType()] 2022-01-15 21:27:29 +01:00
Luís Ferreira
3b175db8af
gen/target: make real 128bit on RISC-V targets
RISC-V ILP32/LP64 ABI defines `long double` as 128bit.

Reference: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#cc-type-details
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-01-07 01:06:20 +00:00
Martin Kinkelin
18d819cd83 Don't allocate frontend Arrays and OutBuffers on the C++ heap
That's just begging for trouble with -lowmem, as they contain roots to
(potentially GC-managed) D arrays.

After a rather superficial grep-check for `new ` in the *.{cpp,h} files,
these should be about all occurrences of frontend stuff previously
allocated on the C++ heap.
2021-09-17 03:49:28 +02:00
Martin Kinkelin
9858cfb01c Simplify dmd/ldcbindings.{d,h} 2021-09-17 03:49:28 +02:00
Martin Kinkelin
33a95021d8 Initialize new Target::osMajor 2021-09-07 19:17:39 +02:00
Martin Kinkelin
43dd834310 Initialize new TargetC::bitFieldStyle 2021-09-07 16:51:19 +02:00
Martin Kinkelin
369cfd13ce Adapt to TY enum class 2021-09-07 16:51:19 +02:00
Martin Kinkelin
7c8df8012a Set target C long size to 4 for 64-bit targets with 32-bit pointer size
Which is correct for mips64el-linux-gnuabin32 and x86_64-linux-gnux32
at least.
2021-08-14 18:59:24 +02:00
Martin Kinkelin
1814c177b4 Move target real selection from ir/irtype.cpp to gen/target.cpp
Long overdue, and now required since initializing `Target` before
`Type`.
2021-05-31 03:13:57 +02:00
Martin Kinkelin
2ffe09ddbc Merge upstream stable (dlang/dmd@2adf6ff4f6) 2021-05-31 02:44:42 +02:00
Martin Kinkelin
1e00f63045 Adapt to upstream global.params.* -> target.* shuffling 2021-05-29 00:19:22 +02:00
Martin Kinkelin
bfa3cead08 Upgrade frontend & libs to early v2.097.0 (dlang/dmd@cb0457daf3) 2021-05-29 00:19:22 +02:00
Martin Kinkelin
879c8ba465 Upgrade frontend & libs to v2.096.0-beta.1+ (dlang/dmd@0c2d8bd2ab) 2021-02-28 17:40:11 +01:00
Martin Kinkelin
bdc317e648
Implement ABI stuff for -preview=in (#3578)
I.e., the ABI-specific decision for which parameter types to prefer
passing a ref over a value.

The x86_64 and AArch64 ABIs are pretty clear - use a ref if the POD type
cannot be passed in registers. For all others, use a simple default
heuristic based on the type size - if larger than 2 machine words, use a
ref. Note that this includes x87 `real` for the 32-bit x86 ABI.
2021-01-08 17:42:08 +01:00
Martin Kinkelin
0ae530f966 Merge upstream stable (dlang/dmd@ebd5e81dc9) 2021-01-06 23:34:36 +01:00
Martin Kinkelin
079858f3b2 Upgrade frontend & libs to early v2.095.0 (dlang/dmd@a4274b3c39) 2020-11-27 17:45:13 +01:00
Martin Kinkelin
711fdcca42 Populate new Target::architectureName for JSON output 2020-09-22 16:32:48 +02:00
Martin Kinkelin
f202c851ae Upgrade frontend & libs to v2.094.0-beta.1 2020-09-22 00:06:19 +02:00
Martin Kinkelin
834f666ce5
Raise min LLVM version to 6.0 (#3493) 2020-07-13 20:42:50 +02:00
Martin Kinkelin
c29e734878 CMake: Use -linkonce-templates when compiling ldc2/ldmd2/ldc-build-runtime... all-at-once
When compiling with an LDMD host compiler, to speed-up optimization.
2020-06-29 00:24:08 +02:00
Martin Kinkelin
5870b41c1d Upgrade frontend & libs to early v2.093.0 (dlang/dmd@eee9185638) 2020-06-21 05:31:24 +02:00
Martin Kinkelin
c6430a32e4
Merge pull request #3415 from kinke/vsoptions
Adopt DMD's MSVC toolchain detection
2020-05-04 20:31:38 +02:00
Martin Kinkelin
3786614967 Merge upstream stable (dlang/dmd@2dc6c9d619) 2020-05-03 13:36:07 +02:00
Martin Kinkelin
6d7819f8c6 AArch64: Populate a struct's argTypes
The only observable effect for now is that non-Apple AArch64
TypeInfo_Struct emissions might contain a populated m_arg1, which is
a prerequisite for TypeInfo-based core.vararg.va_arg().
2020-05-02 03:31:22 +02:00
Martin Kinkelin
18406bcc06 Adopt DMD's MSVC toolchain detection
This reduces the overhead for auto-detecting and setting up an MSVC
toolchain from a very rough 1 second to about 8 milliseconds on my box.
Enabling the auto-detection by default (and so preferring MSVC over the
'internal' toolchain if there's a Visual C++ installation) is now
possible, fixing issues like #3402.

The MSVC setup now consists of the bare minimum - prepending 3
directories to the LIB env var and 1-2 directories to PATH.
2020-04-30 21:45:56 +02:00
Martin Kinkelin
ff36be2c01
Do not fallback to host for critical section size of unknown targets (#3389)
Instead, error out whenever requested by an expression-less
`synchronized` statement, including source LoC to track it down.

This is safer, especially since the previous initial warning may likely
be suppressed, and makes this host-agnostic.

Also suppress previous warnings about unknown `` and `none` OS, treating
these like `unknown`.
2020-03-30 21:26:51 +02:00
Jacob Carlborg
bcb013274b Fix warning about critical section size for Apple ARM 2020-01-19 20:57:23 +01:00
Martin Kinkelin
ecaa413ccc Upgrade frontend & libs to v2.090.0-beta.1 2019-12-22 16:29:29 +01:00
Martin Kinkelin
1662406231 Upgrade front-end & libs to v2.088.0-beta.1 2019-08-25 00:36:15 +02:00
Martin Kinkelin
8da4e6f9cf
Merge pull request #3093 from kinke/merge-2.087
Upgrade front-end & libs to v2.087.1+
2019-08-06 22:21:18 +02:00
skoppe
b593dda535 return 0 in getCriticalSectionSize for wasm (#3119) 2019-07-26 21:42:01 +02:00
Martin Kinkelin
e52199469f Upgrade front-end & libs to v2.087.0-beta.1 2019-06-21 15:39:45 +02:00
Nicholas Wilson
b750ce0c27
add __traits(getTargetInfo, "dcomputeTargets") (#3090) 2019-06-14 10:49:46 +08:00
Martin Kinkelin
a44c78fb88 Disallow some vector ops and fix integral vector identity comparisons
Bail out on unsupported vector ops (not checking the rhs type for binops
though) in the frontend instead of causing LLVM errors.

Also precompute the target's critical section size once at startup, like
DMD.
2019-05-26 05:11:16 +02:00
Martin Kinkelin
6c3d8b952e Add cmdline option -extern-std=c++{98,11,14,17} 2019-03-01 18:19:00 +01:00
Martin Kinkelin
5e93ed0dfd Upgrade front-end & libs to v2.085.0-beta.1 2019-03-01 18:19:00 +01:00
Martin Kinkelin
8a87cadf62 Resync gen/target.cpp with dmd/target.d 2018-12-12 12:19:17 +05:30
Joakim
1c82d12cd0 Android: change long double mangling on Android/x64 to g 2018-12-12 12:19:17 +05:30
Martin Kinkelin
22166c81b2 Add proper toArgTypes() for System V x86_64 ABI
Make the existing 64-bit code in argtypes.d DMD-specific (required due
to codegen issues) and add a new separate implementation for the SysV
x86_64 ABI to be used by LDC/GDC, closely following the algorithm laid
out in the spec [1].
Also don't needlessly compute a struct's argtypes for Win64 and
non-x86[_64] targets.

This fixes LDC ABI issues wrt. C[++] compatibility on Posix x86_64,
e.g., https://issues.dlang.org/show_bug.cgi?id=13957.

I went with signed integers to represent GP registers, and float/double/
__vector(double[N]) for vector registers (SSE + AVX); integer signedness
and vector element type are arbitrary.

[1] https://www.uclibc.org/docs/psABI-x86_64.pdf
2018-11-02 17:19:25 +01:00
Martin Kinkelin
4a23399236 Aim for consistent #includes (order + dir prefix)
I surely missed a few.
2018-10-20 16:19:46 +02:00
Martin Kinkelin
0bd9a10234 Add LDC-specific support for __traits(getTargetInfo) 2018-10-20 16:19:46 +02:00
Martin Kinkelin
7776c4081b Upgrade frontend & libs to v2.083.0-beta.1 2018-10-20 16:19:46 +02:00
Martin Kinkelin
40cf784cbe Misc. merge fixes, minor adaptions 2018-08-17 21:31:53 +02:00
Martin Kinkelin
3da5a12f4a Use 80-bit compile-time reals on Windows/MSVC hosts
Consistent with DMD and enabling seamless cross-compilation to Posix
x86(_64) targets.
2018-06-24 03:59:14 +02:00
Martin Kinkelin
acf7de3ce6 Initialize new Target::twoDtorInVtable appropriately 2018-06-20 01:52:38 +02:00
Martin Kinkelin
a133ffad56 MSVC: Port Rainer's upstream extern(C++) method ABI fixes
From https://github.com/dlang/dmd/pull/8330.
2018-06-19 20:13:02 +02:00