comparison runtime/llvmdc.diff @ 663:6aaa3d3c1183

First part of rename to LDC.
author Christian Kamm <kamm incasoftware de>
date Mon, 06 Oct 2008 22:46:55 +0200
parents 669a2c84f4e4
children
comparison
equal deleted inserted replaced
662:88e23f8c2354 663:6aaa3d3c1183
18 +++ lib/common/tango/core/BitManip.d (working copy) 18 +++ lib/common/tango/core/BitManip.d (working copy)
19 @@ -171,6 +171,10 @@ 19 @@ -171,6 +171,10 @@
20 */ 20 */
21 uint outpl( uint port_address, uint value ); 21 uint outpl( uint port_address, uint value );
22 } 22 }
23 +else version( LLVMDC ) 23 +else version( LDC )
24 +{ 24 +{
25 + public import llvmdc.bitmanip; 25 + public import ldc.bitmanip;
26 +} 26 +}
27 else 27 else
28 { 28 {
29 public import std.intrinsic; 29 public import std.intrinsic;
30 Index: lib/common/tango/core/Thread.d 30 Index: lib/common/tango/core/Thread.d
34 @@ -244,8 +244,29 @@ 34 @@ -244,8 +244,29 @@
35 } 35 }
36 body 36 body
37 { 37 {
38 - version( D_InlineAsm_X86 ) 38 - version( D_InlineAsm_X86 )
39 + version( LLVMDC) 39 + version( LDC)
40 { 40 {
41 + version(X86) 41 + version(X86)
42 + { 42 + {
43 + uint eax,ecx,edx,ebx,ebp,esi,edi; 43 + uint eax,ecx,edx,ebx,ebp,esi,edi;
44 + asm 44 + asm
65 @@ -297,8 +318,12 @@ 65 @@ -297,8 +318,12 @@
66 } 66 }
67 } 67 }
68 68
69 - version( D_InlineAsm_X86 ) 69 - version( D_InlineAsm_X86 )
70 + version( LLVMDC) 70 + version( LDC)
71 { 71 {
72 + // nothing to pop 72 + // nothing to pop
73 + } 73 + }
74 + else version( D_InlineAsm_X86 ) 74 + else version( D_InlineAsm_X86 )
75 + { 75 + {
171 run unittest runner through a debugger. 171 run unittest runner through a debugger.
172 - dmd: Builds unittests for dmd 172 - dmd: Builds unittests for dmd
173 - gdc: Builds unittests for gdc 173 - gdc: Builds unittests for gdc
174 + dmd: Builds unittests for dmd 174 + dmd: Builds unittests for dmd
175 + gdc: Builds unittests for gdc 175 + gdc: Builds unittests for gdc
176 + llvmdc: Builds unittests for llvmdc 176 + ldc: Builds unittests for ldc
177 177
178 <none>: Builds unittests for all known compilers.' 178 <none>: Builds unittests for all known compilers.'
179 exit 0 179 exit 0
180 @@ -86,7 +87,7 @@ 180 @@ -86,7 +87,7 @@
181 void main() {} 181 void main() {}
188 tango/io/vfs/*.d tango/io/vfs/model/*.d \ 188 tango/io/vfs/*.d tango/io/vfs/model/*.d \
189 @@ -125,6 +126,9 @@ 189 @@ -125,6 +126,9 @@
190 gdc) 190 gdc)
191 GDC=1 191 GDC=1
192 ;; 192 ;;
193 + llvmdc) 193 + ldc)
194 + LLVMDC=1 194 + LDC=1
195 + ;; 195 + ;;
196 *) 196 *)
197 usage 197 usage
198 ;; 198 ;;
199 @@ -132,10 +136,11 @@ 199 @@ -132,10 +136,11 @@
200 shift 200 shift
201 done 201 done
202 202
203 -if [ ! "$DMD" -a ! "$GDC" ] 203 -if [ ! "$DMD" -a ! "$GDC" ]
204 +if [ ! "$DMD" -a ! "$GDC" -a ! "$LLVMDC" ] 204 +if [ ! "$DMD" -a ! "$GDC" -a ! "$LDC" ]
205 then 205 then
206 DMD=1 206 DMD=1
207 GDC=1 207 GDC=1
208 + LLVMDC=1 208 + LDC=1
209 fi 209 fi
210 210
211 if [ "$DMD" = "1" ] 211 if [ "$DMD" = "1" ]
212 @@ -146,4 +151,7 @@ 212 @@ -146,4 +151,7 @@
213 then 213 then
214 compile gdc runUnitTest_gdc 214 compile gdc runUnitTest_gdc
215 fi 215 fi
216 - 216 -
217 +if [ "$LLVMDC" = "1" ] 217 +if [ "$LDC" = "1" ]
218 +then 218 +then
219 + compile llvmdc runUnitTest_llvmdc 219 + compile ldc runUnitTest_ldc
220 +fi 220 +fi
221 Index: lib/gc/basic/gcx.d 221 Index: lib/gc/basic/gcx.d
222 =================================================================== 222 ===================================================================
223 --- lib/gc/basic/gcx.d (revision 3954) 223 --- lib/gc/basic/gcx.d (revision 3954)
224 +++ lib/gc/basic/gcx.d (working copy) 224 +++ lib/gc/basic/gcx.d (working copy)
252 252
253 @@ -2178,6 +2178,28 @@ 253 @@ -2178,6 +2178,28 @@
254 __builtin_unwind_init(); 254 __builtin_unwind_init();
255 sp = & sp; 255 sp = & sp;
256 } 256 }
257 + else version(LLVMDC) 257 + else version(LDC)
258 + { 258 + {
259 + version(X86) 259 + version(X86)
260 + { 260 + {
261 + uint eax,ecx,edx,ebx,ebp,esi,edi; 261 + uint eax,ecx,edx,ebx,ebp,esi,edi;
262 + asm 262 + asm
281 asm 281 asm
282 @@ -2191,6 +2213,10 @@ 282 @@ -2191,6 +2213,10 @@
283 { 283 {
284 // nothing to do 284 // nothing to do
285 } 285 }
286 + else version(LLVMDC) 286 + else version(LDC)
287 + { 287 + {
288 + // nothing to do 288 + // nothing to do
289 + } 289 + }
290 else 290 else
291 { 291 {
296 +++ lib/gc/basic/gcbits.d (working copy) 296 +++ lib/gc/basic/gcbits.d (working copy)
297 @@ -39,6 +39,10 @@ 297 @@ -39,6 +39,10 @@
298 { 298 {
299 // use the unoptimized version 299 // use the unoptimized version
300 } 300 }
301 +else version(LLVMDC) 301 +else version(LDC)
302 +{ 302 +{
303 + // ditto 303 + // ditto
304 +} 304 +}
305 else version (D_InlineAsm_X86) 305 else version (D_InlineAsm_X86)
306 { 306 {
311 +++ tango/text/convert/Layout.d (working copy) 311 +++ tango/text/convert/Layout.d (working copy)
312 @@ -47,6 +47,12 @@ 312 @@ -47,6 +47,12 @@
313 alias void* Arg; 313 alias void* Arg;
314 alias va_list ArgList; 314 alias va_list ArgList;
315 } 315 }
316 +else version(LLVMDC) 316 +else version(LDC)
317 + { 317 + {
318 + private import tango.core.Vararg; 318 + private import tango.core.Vararg;
319 + alias void* Arg; 319 + alias void* Arg;
320 + alias va_list ArgList; 320 + alias va_list ArgList;
321 + } 321 + }
325 @@ -197,9 +203,18 @@ 325 @@ -197,9 +203,18 @@
326 assert (formatStr, "null format specifier"); 326 assert (formatStr, "null format specifier");
327 assert (arguments.length < 64, "too many args in Layout.convert"); 327 assert (arguments.length < 64, "too many args in Layout.convert");
328 328
329 - version (GNU) 329 - version (GNU)
330 + version (LLVMDC) 330 + version (LDC)
331 { 331 {
332 Arg[64] arglist = void; 332 Arg[64] arglist = void;
333 + foreach (i, arg; arguments) 333 + foreach (i, arg; arguments)
334 + { 334 + {
335 + arglist[i] = args; 335 + arglist[i] = args;
348 +++ tango/core/Vararg.d (working copy) 348 +++ tango/core/Vararg.d (working copy)
349 @@ -15,6 +15,10 @@ 349 @@ -15,6 +15,10 @@
350 { 350 {
351 public import std.stdarg; 351 public import std.stdarg;
352 } 352 }
353 +else version( LLVMDC ) 353 +else version( LDC )
354 +{ 354 +{
355 + public import llvmdc.vararg; 355 + public import ldc.vararg;
356 +} 356 +}
357 else 357 else
358 { 358 {
359 /** 359 /**
360 Index: tango/core/Atomic.d 360 Index: tango/core/Atomic.d
363 +++ tango/core/Atomic.d (working copy) 363 +++ tango/core/Atomic.d (working copy)
364 @@ -270,6 +270,167 @@ 364 @@ -270,6 +270,167 @@
365 365
366 366
367 //////////////////////////////////////////////////////////////////////////////// 367 ////////////////////////////////////////////////////////////////////////////////
368 +// LLVMDC Atomics Implementation 368 +// LDC Atomics Implementation
369 +//////////////////////////////////////////////////////////////////////////////// 369 +////////////////////////////////////////////////////////////////////////////////
370 + 370 +
371 + 371 +
372 +else version( LLVMDC ) 372 +else version( LDC )
373 +{ 373 +{
374 + import llvmdc.intrinsics; 374 + import ldc.intrinsics;
375 + 375 +
376 + 376 +
377 + //////////////////////////////////////////////////////////////////////////// 377 + ////////////////////////////////////////////////////////////////////////////
378 + // Atomic Load 378 + // Atomic Load
379 + //////////////////////////////////////////////////////////////////////////// 379 + ////////////////////////////////////////////////////////////////////////////
535 +++ tango/math/Math.d (working copy) 535 +++ tango/math/Math.d (working copy)
536 @@ -76,6 +76,14 @@ 536 @@ -76,6 +76,14 @@
537 version = DigitalMars_D_InlineAsm_X86; 537 version = DigitalMars_D_InlineAsm_X86;
538 } 538 }
539 } 539 }
540 +else version(LLVMDC) 540 +else version(LDC)
541 +{ 541 +{
542 + import llvmdc.intrinsics; 542 + import ldc.intrinsics;
543 + version(X86) 543 + version(X86)
544 + { 544 + {
545 + version = LLVMDC_X86; 545 + version = LDC_X86;
546 + } 546 + }
547 +} 547 +}
548 548
549 /* 549 /*
550 * Constants 550 * Constants
551 @@ -298,6 +306,24 @@ 551 @@ -298,6 +306,24 @@
552 * Bugs: 552 * Bugs:
553 * Results are undefined if |x| >= $(POWER 2,64). 553 * Results are undefined if |x| >= $(POWER 2,64).
554 */ 554 */
555 +version(LLVMDC) 555 +version(LDC)
556 +{ 556 +{
557 + alias llvm_cos_f32 cos; 557 + alias llvm_cos_f32 cos;
558 + alias llvm_cos_f64 cos; 558 + alias llvm_cos_f64 cos;
559 + version(X86) 559 + version(X86)
560 + { 560 + {
583 unittest { 583 unittest {
584 @@ -333,6 +360,24 @@ 584 @@ -333,6 +360,24 @@
585 * Bugs: 585 * Bugs:
586 * Results are undefined if |x| >= $(POWER 2,64). 586 * Results are undefined if |x| >= $(POWER 2,64).
587 */ 587 */
588 +version(LLVMDC) 588 +version(LDC)
589 +{ 589 +{
590 + alias llvm_sin_f32 sin; 590 + alias llvm_sin_f32 sin;
591 + alias llvm_sin_f64 sin; 591 + alias llvm_sin_f64 sin;
592 + version(X86) 592 + version(X86)
593 + { 593 + {
618 { 618 {
619 version (GNU) { 619 version (GNU) {
620 return tanl(x); 620 return tanl(x);
621 - } else { 621 - } else {
622 + } 622 + }
623 + else version(LLVMDC) { 623 + else version(LDC) {
624 + return tango.stdc.math.tanl(x); 624 + return tango.stdc.math.tanl(x);
625 + } 625 + }
626 + else { 626 + else {
627 asm 627 asm
628 { 628 {
629 fld x[EBP] ; // load theta 629 fld x[EBP] ; // load theta
630 @@ -947,6 +997,25 @@ 630 @@ -947,6 +997,25 @@
631 * <tr> <td> +&infin; <td> +&infin; <td> no 631 * <tr> <td> +&infin; <td> +&infin; <td> no
632 * ) 632 * )
633 */ 633 */
634 +version(LLVMDC) 634 +version(LDC)
635 +{ 635 +{
636 + alias llvm_sqrt_f32 sqrt; 636 + alias llvm_sqrt_f32 sqrt;
637 + alias llvm_sqrt_f64 sqrt; 637 + alias llvm_sqrt_f64 sqrt;
638 + version(X86) 638 + version(X86)
639 + { 639 + {
665 @@ -1477,7 +1548,14 @@ 665 @@ -1477,7 +1548,14 @@
666 } 666 }
667 } 667 }
668 } 668 }
669 - return tango.stdc.math.powl(x, y); 669 - return tango.stdc.math.powl(x, y);
670 + version(LLVMDC_X86) 670 + version(LDC_X86)
671 + { 671 + {
672 + return llvm_pow_f80(x, y); 672 + return llvm_pow_f80(x, y);
673 + } 673 + }
674 + else 674 + else
675 + { 675 + {
684 +++ tango/stdc/stdlib.d (working copy) 684 +++ tango/stdc/stdlib.d (working copy)
685 @@ -94,6 +94,11 @@ 685 @@ -94,6 +94,11 @@
686 { 686 {
687 void* alloca(size_t size); 687 void* alloca(size_t size);
688 } 688 }
689 +else version( LLVMDC ) 689 +else version( LDC )
690 +{ 690 +{
691 + pragma(alloca) 691 + pragma(alloca)
692 + void* alloca(size_t size); 692 + void* alloca(size_t size);
693 +} 693 +}
694 else version( GNU ) 694 else version( GNU )
700 +++ tango/stdc/stdarg.d (working copy) 700 +++ tango/stdc/stdarg.d (working copy)
701 @@ -13,6 +13,10 @@ 701 @@ -13,6 +13,10 @@
702 { 702 {
703 public import std.c.stdarg; 703 public import std.c.stdarg;
704 } 704 }
705 +else version( LLVMDC ) 705 +else version( LDC )
706 +{ 706 +{
707 + public import llvmdc.cstdarg; 707 + public import ldc.cstdarg;
708 +} 708 +}
709 else 709 else
710 { 710 {
711 alias void* va_list; 711 alias void* va_list;