Commit Graph

74 Commits

Author SHA1 Message Date
David Nadlinger
4118cddd1f Cleanup: GCC warning fixes. 2012-12-20 01:21:10 +01:00
David Nadlinger
0cd78dd579 Cleanup: Clang warning fixes.
No warnings left on a '-Wall' build except for a single tautological
compare in gen/asm-x86-32.h, which indeed seems like a bug.
2012-12-20 01:00:55 +01:00
David Nadlinger
289bb57adf Cleanup: Fix "braces around initializaion of subobject" warnings.
The two ASM implementations should really be merged, as they
are very similar except for the added registers/instructions.
2012-12-20 01:00:51 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
kai
7d1ec52c68 Implement the xgetbv opcode.
This solves a FIXME in core.cpuid.
2012-09-14 21:10:39 +02:00
kai
9b93382417 Some fixes in the operands of 64bit assembler. 2012-09-07 23:45:45 +02:00
David Nadlinger
6fea7358dc Fixed several asm-related error message formats. 2012-09-07 03:51:32 +02:00
kai
6e427fe818 Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-03 06:36:35 +02:00
David Nadlinger
72d510cb5e Emit floating-point integer quad word instructions with ll suffix.
The LLVM MC backend doesn't recognize the q suffix, which was previously used.

See llvm.org/bugs/show_bug.cgi?id=11935.

If this turns out to be a speed problem, it could be done using char[3].
2012-02-09 00:53:28 +01:00
kai
6726b5da13 Compile LDC2 with VS2010 64bit (LDC changes only).
Contains all changes necessary to LDC specific source to compile LDC2 with VS2010. See https://github.com/D-Programming-Language/dmd/pull/516 for necessary changes to DMDFE.
2012-01-11 07:49:21 +01:00
David Nadlinger
3ba3b683af Restore alphabetical order to opcode table.
This fixes #57 and a few related issues.
2011-12-22 02:40:22 +01:00
David Nadlinger
fe19ee84f5 Merge branch 'llvm3.0' into merge-3.0
Conflicts:
	gen/configfile.cpp
2011-12-04 18:16:36 +01:00
David Nadlinger
5458ebb0b2 Merge branch 'master' into merge-3.0 2011-12-04 18:15:21 +01:00
David Nadlinger
d0ea856024 Emit all D inline asm labels as local labels.
On OS X, there is an actual significance to the distinction, which before lead e.g. to exception throwing in the below example being broken:

---
import core.exception;

void main() {
  asm {
    jmp Lfoo;
Lfoo:
    ;
  }
  throw cast(OutOfMemoryError)cast(void*)OutOfMemoryError.classinfo.init;
  assert(0);
}
---
2011-12-04 18:13:33 +01:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00
David Nadlinger
1afc01df72 Whitespace cleanup. 2011-11-14 21:25:56 +01:00
Robert Clipsham
4add11b78f Fix bug #22. 2011-11-13 14:14:19 +00:00
David Nadlinger
21a05aa971 Merge branch 'default' into 'merge'. 2011-07-29 00:37:30 +02:00
Alexey Prokhin
2220dd0559 'even' opcode on x86_64 2011-07-19 19:20:40 +04:00
Alexey Prokhin
462cdda4ae Merge dmdfe 2.053beta 2011-07-19 10:14:04 +04:00
Kelly Wilson
5d0f918e9e Fix cmpxchg16b instruction for asm blocks. Thanks to wolfwood from the Xomb project for this fix. 2011-05-05 20:56:46 -06:00
David Nadlinger
882e81ec1c Explicitly add %st as second argument to fucomip.
It should really be assumed implicitly, but the GNU as shipping with Mac OS X 10.6 (Apple Inc version cctools-800~26, GNU assembler version 1.38) chokes on the instruction otherwise.
2011-05-01 01:16:36 +02:00
Alexey Prokhin
e21fbc26e8 Fix imul and mul asm opcodes on X86_64 2011-02-25 22:29:34 +03:00
Alexey Prokhin
e921998d75 A few fixes for 64bit 2011-02-23 12:49:57 +03:00
Robert Clipsham
3afe5bae25 Added in a missing opcode from the last commit. 2010-12-09 22:31:31 +00:00
Robert Clipsham
496a87e452 Merged Iain Buclaw's AMD 3dNow! asm changes. 2010-12-09 22:27:14 +00:00
Moritz Warning
93f0672450 fixes #415: 'swapgs' inline asm opcode mistakenly demands 2 arguments; thanks wolfwood 2010-07-31 21:26:05 +02:00
Kelly Wilson
05c466fc4a Fix typo for iretq 2010-02-25 17:12:54 -07:00
Robert Clipsham
d6a6b7c797 Fixed ticket #365. Thanks wilkie. 2009-09-19 00:44:35 +01:00
Kelly Wilson
5d0cdd6157 Fixed iretq problem reported by wilkie of the XomB project 2009-08-17 13:42:19 -06:00
Tomas Lindquist Olsen
df82d09206 Fixed bug #349 , now emits error. 2009-08-02 17:56:30 +02:00
Robert Clipsham
02e7bb26fc Fixed Op_Shift asm instructions on x86-64. 2009-07-19 23:52:07 +01:00
Frits van Bommel
ba72e39d24 Add syscall to the x86-64 asm parser, and both syscall and sysret to the
x86 one. Fixes #316.
2009-06-01 23:42:42 +02:00
Kelly Wilson
16a2512808 remove extra 'test' instructions and fix 'test' properly 2009-05-19 12:28:44 -06:00
Kelly Wilson
8941b6960c fix missing 'test' mnemonic and add several variations 2009-05-19 11:58:54 -06:00
Christian Kamm
06108db87e Yet another fdiv/fsub special case. 2009-05-09 20:13:05 +02:00
Christian Kamm
968e1148d8 Restrict second arg of certain floating-point stores to ST. Fix type postfix
for the two argument form of fistp and fisttp.
2009-05-09 08:58:41 +02:00
Christian Kamm
37edd5add6 Fix certain cases of floating point instruction mistranslation. 2009-05-07 21:01:44 +02:00
Christian Kamm
108309a579 Ignore short/long prefix of labels instead of ignoring the whole branch
instruction!
2009-05-06 19:56:33 +02:00
Christian Kamm
c57f6212a6 Make the no-operand versions of floating point inline asm instructions always
pop the floating point stack - like dmd does.
2009-05-06 18:54:20 +02:00
Christian Kamm
8a8818104b Translate fsub/fdiv correctly. See #256. 2009-05-06 18:08:44 +02:00
Kelly Wilson
c60ce29bde fix wrong arg order for fmul/fadd 2009-05-05 11:51:00 -06:00
Kelly Wilson
7a1052a2fc Some more fixups for mingw -- missing underscores 2009-04-02 17:27:53 -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
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
Kelly Wilson
6e44efb9d2 Logic error fix 2009-03-11 13:54:29 -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