comparison graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAssembler.java @ 11896:280f97f13d54

Fixes to PTX control flow logic
author Morris Meyer <morris.meyer@oracle.com>
date Sat, 05 Oct 2013 16:51:42 -0400
parents c7abc8411011
children 1f82cda83ced
comparison
equal deleted inserted replaced
11895:8e15a8b570e1 11896:280f97f13d54
306 return name; 306 return name;
307 } 307 }
308 } 308 }
309 } 309 }
310 310
311 public static class BinarySingleOperandFormat extends SingleOperandFormat {
312
313 public BinarySingleOperandFormat(Variable dst, Value src) {
314 super(dst, src);
315 }
316
317 @Override
318 public String typeForKind(Kind k) {
319 switch (k.getTypeChar()) {
320 case 's':
321 return "b16";
322 case 'i':
323 return "b32";
324 case 'j':
325 return "b64";
326 default:
327 throw GraalInternalError.shouldNotReachHere();
328 }
329 }
330 }
331
311 public static class ConversionFormat extends SingleOperandFormat { 332 public static class ConversionFormat extends SingleOperandFormat {
312 333
313 public ConversionFormat(Variable dst, Value src) { 334 public ConversionFormat(Variable dst, Value src) {
314 super(dst, src); 335 super(dst, src);
315 } 336 }
488 } 509 }
489 } 510 }
490 511
491 // Checkstyle: stop method name check 512 // Checkstyle: stop method name check
492 public final void bra(String tgt, int pred) { 513 public final void bra(String tgt, int pred) {
493 emitString((pred >= 0) ? "" : ("@%p" + pred + " ") + "bra" + " " + tgt + ";" + ""); 514 System.err.println("BRA: " + tgt + " pred: " + pred);
515 assert pred >= 0;
516
517 emitString("@%p" + pred + " " + "bra" + " " + tgt + ";");
494 } 518 }
495 519
496 public final void bra_uni(String tgt) { 520 public final void bra_uni(String tgt) {
497 emitString("bra.uni" + " " + tgt + ";" + ""); 521 emitString("bra.uni" + " " + tgt + ";" + "");
498 } 522 }
534 public void emit(PTXAssembler asm) { 558 public void emit(PTXAssembler asm) {
535 asm.emitString("neg." + super.emit()); 559 asm.emitString("neg." + super.emit());
536 } 560 }
537 } 561 }
538 562
539 public static class Not extends SingleOperandFormat { 563 public static class Not extends BinarySingleOperandFormat {
540 564
541 public Not(Variable dst, Variable src) { 565 public Not(Variable dst, Variable src) {
542 super(dst, src); 566 super(dst, src);
543 } 567 }
544 568