comparison dmd/mars.c @ 220:ccc2e6898a78 trunk

[svn r236] added initial codegen of inline asm, pretty buggy and incomplete still. see the tangotests/asm1.d test for a sample of what does work!
author lindquist
date Fri, 06 Jun 2008 20:14:51 +0200
parents 761c8352f494
children a168a2c3ea48
comparison
equal deleted inserted replaced
219:761c8352f494 220:ccc2e6898a78
213 -vv very verbose (does not include -v)\n\ 213 -vv very verbose (does not include -v)\n\
214 -v1 D language version 1\n\ 214 -v1 D language version 1\n\
215 -version=level compile in version code >= level\n\ 215 -version=level compile in version code >= level\n\
216 -version=ident compile in version code identified by ident\n\ 216 -version=ident compile in version code identified by ident\n\
217 -w enable warnings\n\ 217 -w enable warnings\n\
218 -fp80 enable 80bit reals on x86 32bit (EXPERIMENTAL)\n\ 218 \n\
219 Experimental features:\n\
220 -inlineasm allow use of inline asm\n\
221 -fp80 enable 80bit reals on x86 32bit\n\
219 ", 222 ",
220 #if WIN32 223 #if WIN32
221 " @cmdfile read arguments from cmdfile\n" 224 " @cmdfile read arguments from cmdfile\n"
222 #else 225 #else
223 "" 226 ""
318 #else 321 #else
319 #error 322 #error
320 #endif /* linux */ 323 #endif /* linux */
321 324
322 //VersionCondition::addPredefinedGlobalIdent("D_Bits"); 325 //VersionCondition::addPredefinedGlobalIdent("D_Bits");
323 VersionCondition::addPredefinedGlobalIdent("D_InlineAsm");
324 VersionCondition::addPredefinedGlobalIdent("D_InlineAsm_X86");
325 VersionCondition::addPredefinedGlobalIdent("all"); 326 VersionCondition::addPredefinedGlobalIdent("all");
326 327
327 #if _WIN32 328 #if _WIN32
328 inifile(argv[0], "llvmdc.ini"); 329 inifile(argv[0], "llvmdc.ini");
329 #endif 330 #endif
399 global.params.disassemble = 1; 400 global.params.disassemble = 1;
400 else if (strcmp(p + 1, "annotate") == 0) 401 else if (strcmp(p + 1, "annotate") == 0)
401 global.params.llvmAnnotate = 1; 402 global.params.llvmAnnotate = 1;
402 else if (strcmp(p + 1, "fp80") == 0) 403 else if (strcmp(p + 1, "fp80") == 0)
403 global.params.useFP80 = 1; 404 global.params.useFP80 = 1;
405 else if (strcmp(p + 1, "inlineasm") == 0)
406 global.params.useInlineAsm = 1;
404 else if (p[1] == 'o') 407 else if (p[1] == 'o')
405 { 408 {
406 switch (p[2]) 409 switch (p[2])
407 { 410 {
408 case '-': 411 case '-':
750 753
751 if (global.params.is64bit) { 754 if (global.params.is64bit) {
752 VersionCondition::addPredefinedGlobalIdent("LLVM64"); 755 VersionCondition::addPredefinedGlobalIdent("LLVM64");
753 } 756 }
754 757
758 if (!is_x86 && (global.params.useFP80 || global.params.useInlineAsm)) {
759 error("the -fp80 option is only valid for the x86 32bit architecture");
760 fatal();
761 }
762
755 if (global.params.useFP80) { 763 if (global.params.useFP80) {
756 if (!is_x86) {
757 error("the -fp80 option is only valid for the x86 32bit architecture");
758 fatal();
759 }
760 VersionCondition::addPredefinedGlobalIdent("LLVM_X86_FP80"); 764 VersionCondition::addPredefinedGlobalIdent("LLVM_X86_FP80");
765 }
766 if (global.params.useInlineAsm) {
767 VersionCondition::addPredefinedGlobalIdent("D_InlineAsm");
768 VersionCondition::addPredefinedGlobalIdent("D_InlineAsm_X86");
761 } 769 }
762 770
763 assert(tt_arch != 0); 771 assert(tt_arch != 0);
764 assert(tt_os != 0); 772 assert(tt_os != 0);
765 assert(data_layout != 0); 773 assert(data_layout != 0);