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
Frits van Bommel
958ad381db
Fix to make sure to create gen/ in build dir and unbreak build with older perl
2009-03-08 16:37:55 +01:00
Christian Kamm
c49642a08f
Make CompileUnit linkage compatible with llvm trunk.
2009-03-08 16:30:39 +01:00
Christian Kamm
fc5f35c410
Automated merge with http://hg.dsource.org/projects/ldc
2009-03-08 16:22:06 +01:00
Christian Kamm
13e83bf1c1
Improved template emission control for singleobj building.
2009-03-08 16:21:56 +01:00
Christian Kamm
520bc229ea
Give compile units LinkOnceLinkage to circumvent duplicate symbols with LLVM linking.
2009-03-08 16:21:11 +01:00
Frits van Bommel
622a93a810
Make LDC work with LLVM trunk (s/LinkOnceLinkage/LinkOnceOdrLinkage/)
...
Also moved the #defines for linkage types into a separate header instead of
mars.h so we can #include revisions.h without having to rebuild the entire
frontend every time we update.
(I'm using revisions.h to get the LLVM revision for use in preprocessor
conditionals. It should work with LLVM release 2.5, old trunk and new trunk)
2009-03-08 16:13:10 +01:00
Frits van Bommel
532cccbd3a
Fixed some #includes to be correct for both D1 and D2
2009-03-08 12:13:22 +01:00
Frits van Bommel
cc12db505e
Make error message on assembler failure more informative (hopefully)
2009-03-08 11:46:55 +01:00
Frits van Bommel
dc20834473
Update runtime CMakeList.txt for new command line syntax regarding PIC
2009-03-08 09:58:26 +01:00
Frits van Bommel
302990a0ba
Remove a dead variable from ldmd.
...
(It used to be used to pass an extra -help to ldc when no files were
specified, but we handle that in ldc itself now)
2009-03-08 09:57:20 +01:00
Tomas Lindquist Olsen
d8c89ce681
really fixed fstp a, b; on x86-64
2009-03-08 04:23:44 +01:00
Tomas Lindquist Olsen
9a5350afb1
Applied rev two operand form fstp fix to x86-64 asm
2009-03-08 02:46:37 +01:00
Tomas Lindquist Olsen
341dfe7a9f
Merge
2009-03-08 02:36:45 +01:00
Tomas Lindquist Olsen
16668d1508
Fixed two operand form of X86 fstp instruction. (throw away second operand!)
2009-03-08 02:36:09 +01:00
Frits van Bommel
59f677c7ae
Apply [1053] to x86-32 asm as well.
2009-03-08 02:07:53 +01:00
Frits van Bommel
941ccdfdc3
Future-proof the code to classify static array members of structs.
...
I made sure to create a merge conflict with the code attached to ticket #229
(which comments this code out due to changes in the DMD 'Type' type hierarchy)
so that if it gets committed as-is there will be a human looking at it.
2009-03-08 01:26:30 +01:00
Frits van Bommel
2687d58198
Always pass an address expression (not a var expression) to asm operands of
...
type Arg_Memory.
This fixes the following code:
{{{
void f(real x) { asm { fld x[RBP]; } }
void g(int x) { asm { mov EAX, x[RBP]; } }
}}}
2009-03-08 00:57:58 +01:00
Christian Kamm
95f12f04f1
Add '-singleobj' command line switch that will tell LDC to link LLVM modules internally and only emit a single object file.
...
The switch allows the optimizer and inliner to run on all modules at once and opens the door for template instantiation improvements that should lower compile time and executable size.
2009-03-07 19:38:00 +01:00
Christian Kamm
ed9591d81f
Make IrFuncTy a member of TypeFunction. Reset between modules compiled in the
...
same LDC call.
2009-03-07 14:25:30 +01:00
Frits van Bommel
5af82ee8d3
Fix a bug in the X86 ABI. The size of a struct is different from the size of a
...
pointer to that struct...
2009-03-06 21:15:13 +01:00
Frits van Bommel
1c6c4bc361
Two small bugfixes:
...
- See through typedefs and enums in passByVal
- Don't depend on TypeFunction::parameters->dim being the actual number of
parameters; it contains unexpanded tuples as single elements.
2009-03-06 19:12:48 +01:00
Frits van Bommel
3e15c659d1
Fix a typo
2009-03-06 17:00:34 +01:00
Frits van Bommel
27d3ab4546
Some calling convention work for x86-64:
...
- Implement x86-64 extern(C), hopefully correctly.
- Tried to be a bit smarter about extern(D) while I was there.
Interestingly, this code seems to be generating more efficient code than
gcc and llvm-gcc in some edge cases, like returning a `{ [7 x i8] }` loaded from
a stack slot from an extern(C) function. (gcc generates 7 1-byte loads, while
this code generates a 4-byte, a 2-byte and a 1-byte load)
I also added some changes to make sure structs being returned from functions or
passed in as parameters are stored in memory where the rest of the backend seems
to expect them to be. These should be removed when support for first-class
aggregates improves.
2009-03-06 16:00:47 +01:00
Frits van Bommel
79bc6230df
Add 'testversion=Tango' to rebuild profile.
2009-03-05 21:32:18 +01:00
Tomas Lindquist Olsen
b8e9d554e5
Fixed lazy arguments again.
2009-03-05 18:33:20 +01:00
Frits van Bommel
cc612c7290
Fix hasUnalignedFields(): take static arrays into account too.
2009-03-04 23:17:32 +01:00
Frits van Bommel
d257890e29
Fix bug in default implementation of ABIRewrite::getL.
2009-03-04 23:06:23 +01:00