Commit Graph

1120 Commits

Author SHA1 Message Date
Frits van Bommel
80e8ea4792 Fix -g with default ldc.conf 2009-03-14 22:44:52 +01:00
Frits van Bommel
3ffaa5c914 Make this test a bit more meaningful 2009-03-14 22:29:31 +01:00
Frits van Bommel
b237079854 Fun with parameter attributes: For several of the "synthetic" parameters added
to D functions, we can apply noalias and nocapture. They are sret parameters,
'nest' pointers passed to nested functions, and _argptr:
Nocapture:
 - Sret and nest are nocapture because they don't represent D-level variables,
   and thus the callee can't (validly) obtain a pointer to them, let alone keep
   it around after it returns.
 - _argptr is nocapture because although the callee has access to it as a
   pointer, that pointer is invalidated when it returns.

All three are noalias because they're function-local variables
 - Sret and _argptr are noalias because they're freshly alloca'd memory only
   used for a single function call that's not allowed to keep an aliasing
   pointer to it around (since the parameter is nocapture).
 - 'Nest' is noalias because the callee only ever has access to one such pointer
   per parent function, and every parent function has a different one.

This commit also ensures attributes set on sret, _arguments and _argptr are
propagated to calls to such functions.

It also adds one exception to the general rule that attributes on function types
should propagate to calls: the type of a delegate's function pointer has a
'nest' parameter, but this can either be a true 'nest' (for delegates to nested
functions) or a 'this' (for delegates to member functions). Since 'this' is
neither noalias nor nocapture, and there's generally no way to tell which one it
is, we remove these attributes at the call site if the callee is a delegate.
2009-03-14 22:15:31 +01:00
Frits van Bommel
457ccf751a Disable this for -release, -disable-boundscheck, etc. 2009-03-14 01:32:10 +01:00
Frits van Bommel
85a3433791 Call _d_array_bounds when an associative array is indexed with a non-existent
key (unless it's being assigned to). Closes #233.
2009-03-14 01:22:05 +01:00
Frits van Bommel
1e6bd8f8e8 Hopefully fix #232 2009-03-13 19:22:40 +01:00
Frits van Bommel
ad46ec8bd0 Split out LLVM_REV into separate header, to reduce rebuilding when only the LDC
revision has changed.
2009-03-13 16:18:43 +01:00
Frits van Bommel
a23861d3c1 Updating revisions.pl.in:
- Change the way the LLVM SVN revision is detected, using `svn info` instead
   of `svnversion`. This speeds it up significantly on my machine (especially
   when the LLVM SVN checkout isn't in disk cache).
 - Add "last changed date" to SVN checkouts too, not just unpacked tarballs
 - No longer rely on SVN revision to detect release vs trunk checkouts, treat
   release checkout the same as unpacked release tarball. (Except for date
   determination, which uses SVN date instead of filesystem date)
2009-03-13 16:18:01 +01:00
Kelly Wilson
2a396614ad Fix 32bit "+2" typo for Outbuffer::reserve 2009-03-13 07:17:29 -06:00
Kelly Wilson
ff33ed6d74 Revert removal of "+2" from Outbuffer::reserve function for x64. Unless
somone can fix this properly, then the "+2" must stay in or tango won't
build.
2009-03-12 17:10:24 -06:00
Frits van Bommel
8b185b8b6a Fix field access from inline asm. See tests/mini/asm10.d 2009-03-12 23:48:43 +01:00
Frits van Bommel
ed9af11856 Apply r1106 to x86-64 asm too 2009-03-12 23:31:26 +01:00
Frits van Bommel
3fe4cfb0fa Unquote ${LIBCONFIG_LDFLAGS} in target_link_libraries().
Without this change, LDC fails to link for me.
2009-03-12 23:30:58 +01:00
Tomas Lindquist Olsen
4399ff3700 Corrected bad asm match for fstp on x86-32 2009-03-12 23:12:36 +01:00
Tomas Lindquist Olsen
269e37dc88 - Fixed building tango-user-ldc on x86-32.
- Added CMake option for extra LLVM components to be linked in.
2009-03-12 22:30:30 +01:00
Tomas Lindquist Olsen
43a070b0d3 Removed plain wrong note from ldc.conf.in, I never implemented that! 2009-03-12 21:04:27 +01:00
Tomas Lindquist Olsen
8b751cce0e - Updated to DMD frontend 1.041.
- Removed dmd/inifile.c , it's not under a free license, replaced with libconfig based config file.
2009-03-12 20:37:27 +01:00
Frits van Bommel
ff354d59b2 Use stringstream in asm generation instead of OutBuffer.
Besides looking better, this should reduce allocations and copying.
2009-03-12 14:08:57 +01:00
Frits van Bommel
c1bd2234a9 Clean up asm code a bit.
- Use vector instead of Array, reducing allocations.
 - Use vectors instead of deques since we only push_back and index.
 - Remove redundant typedefs of iterators.
 - Comment out unused variable (used only in commented-out GDC code).
 - A few whitespace changes.
2009-03-12 14:08:57 +01:00
Frits van Bommel
723ae9f9d5 Fix an error in the ASM tables introduced by the recent fistp fixes.
(There are only 3 fields for operands)
2009-03-12 14:08:57 +01:00
Frits van Bommel
557345ac2a Delete tango.patch, it has been applied in the Tango repository. 2009-03-11 19:04:51 +01:00
Kelly Wilson
6e44efb9d2 Logic error fix 2009-03-11 13:54:29 -04:00
Kelly Wilson
e5a4e4cb41 Fix FS:4 problem for x32 2009-03-11 12:13:41 -04:00
Kelly Wilson
15a19c738f Fix FS:4 miswrite due to earlier changes for a constant displacement 2009-03-11 09:16:41 -06:00
Frits van Bommel
8bb206447f Add missing EBX clobber to CPUID asm instruction. 2009-03-11 14:17:13 +01:00
Kelly Wilson
cff2c92fd3 Change faulty offset for asm in Cache.d (ie. change "-20(%rbp)+4)" to
"4+-20(%rbp)")
2009-03-11 00:08:45 -04:00
Kelly Wilson
85090ef9c9 Change x64 asm in Cache.d from a positive offset from after rbp "-20(%rbp)+4" to before
"4+-20(%rbp)"
2009-03-10 22:02:11 -06:00
Kelly Wilson
40887efe59 Fix for x32 fmul/div/add/sub with no operands. 2009-03-10 20:40:22 -04:00
Kelly Wilson
58d34a9660 Fix for fmul/div/add/sub with no operands. Revert explicit ST0 definition since a typo
had caused the need for that.
2009-03-10 18:34:19 -06:00
Frits van Bommel
475061ffeb Merge 2009-03-11 01:01:40 +01:00
Kelly Wilson
2d11484649 fix fistp properly for x32 2009-03-10 13:59:50 -04:00
Kelly Wilson
d13e841511 Merging 2009-03-10 11:08:35 -06:00
Kelly Wilson
e59c7db637 Properly fix fistp for x64 2009-03-10 11:06:38 -06:00
Unknown
5bb81ac3d2 Fix 32bit version of "jle short Label;" for 'short' or 'long'. 2009-03-10 09:13:13 -04:00
Kelly Wilson
0d2e665fc4 Fix for dual operand form of fistp, also make reg ST(0) explicit and fix lindquists
previous code that allowed dual operand form of fstp but dissallowed the single
operand form accidently
2009-03-10 06:23:26 -06:00
Frits van Bommel
3f89a04f27 Make sure instantiations of template intrinsics are marked as intrinsics. 2009-03-10 12:12:24 +01:00
Frits van Bommel
5e95a6640e Move "invalid intrinsic name" error to declaration, not instantiation. 2009-03-10 11:30:51 +01:00
Frits van Bommel
d1bea3d6c0 Update testcase broken by intrinsics changes. 2009-03-10 10:46:15 +01:00
Frits van Bommel
99aefd93c5 Oops, had some unsaved changes 2009-03-10 04:56:28 +01:00
Frits van Bommel
613a3b71fd Automated merge with http://hg.dsource.org/projects/ldc 2009-03-10 04:48:54 +01:00
Frits van Bommel
5d9bd5d139 Intrinsics overhaul:
- More error checking for pragma(intrinsic)
 - Properly handle templating for real (use actual nr of bits, not .sizeof * 8)
 - Template all .i* and .f* intrinsics
   - The old names are deprecated aliases now

I also added a preliminary patch to make tango.math.Math use the new versions.
(I think it looks a lot nicer now)
2009-03-10 04:45:32 +01:00
Kelly Wilson
da7fdb94f7 Fix for asm { jle short Lret; }, used by Tango since dmd accepts the 'short'. We just
throw the 'short/long' away right now.
2009-03-09 20:11:42 -06:00
Frits van Bommel
9bbab8a342 Change the way imports are copied to the (Tango) runtime dir. 2009-03-09 21:38:31 +01:00
Frits van Bommel
545d85a057 Reformat intrinsics.di a bit. 2009-03-09 21:38:24 +01:00
Frits van Bommel
7ccbe58e08 Factor out some common code between X86 and X86_64, and supply *_real versions
of all floating point intrinsics that exist whether reals are 80-bit or 64-bit.
2009-03-09 21:38:06 +01:00
Frits van Bommel
a2bb3ce6a2 Make sure revisions.pl always runs so revisions.h doesn't get out of date. 2009-03-09 16:25:45 +01:00
Frits van Bommel
c1d9694494 Work around llvm bug #3749 better, or not at all if using a fixed llvm revision. 2009-03-09 13:29:25 +01:00
Frits van Bommel
0182641f85 Ignore the ABI some more for intrinsics 2009-03-09 03:44:11 +01:00
Christian Kamm
c5c0a01044 Fix out of source build by adding the build dir to the include path. 2009-03-08 17:57:34 +01:00
Christian Kamm
f05ee632bb Automated merge with http://hg.dsource.org/projects/ldc 2009-03-08 17:51:45 +01:00