Mercurial > hg > truffle
comparison src/cpu/ppc/vm/assembler_ppc.cpp @ 17807:71a71b0bc844
8037915: PPC64/AIX: Several smaller fixes
Reviewed-by: kvn
author | goetz |
---|---|
date | Thu, 20 Mar 2014 11:03:06 +0100 |
parents | ec28f9c041ff |
children | 327e7269f90d |
comparison
equal
deleted
inserted
replaced
17806:9200402b42d5 | 17807:71a71b0bc844 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright 2012, 2013 SAP AG. All rights reserved. | 3 * Copyright 2012, 2014 SAP AG. All rights reserved. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * | 5 * |
6 * This code is free software; you can redistribute it and/or modify it | 6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as | 7 * under the terms of the GNU General Public License version 2 only, as |
8 * published by the Free Software Foundation. | 8 * published by the Free Software Foundation. |
22 * questions. | 22 * questions. |
23 * | 23 * |
24 */ | 24 */ |
25 | 25 |
26 #include "precompiled.hpp" | 26 #include "precompiled.hpp" |
27 #include "asm/assembler.hpp" | |
28 #include "asm/assembler.inline.hpp" | 27 #include "asm/assembler.inline.hpp" |
29 #include "gc_interface/collectedHeap.inline.hpp" | 28 #include "gc_interface/collectedHeap.inline.hpp" |
30 #include "interpreter/interpreter.hpp" | 29 #include "interpreter/interpreter.hpp" |
31 #include "memory/cardTableModRefBS.hpp" | 30 #include "memory/cardTableModRefBS.hpp" |
32 #include "memory/resourceArea.hpp" | 31 #include "memory/resourceArea.hpp" |
35 #include "runtime/interfaceSupport.hpp" | 34 #include "runtime/interfaceSupport.hpp" |
36 #include "runtime/objectMonitor.hpp" | 35 #include "runtime/objectMonitor.hpp" |
37 #include "runtime/os.hpp" | 36 #include "runtime/os.hpp" |
38 #include "runtime/sharedRuntime.hpp" | 37 #include "runtime/sharedRuntime.hpp" |
39 #include "runtime/stubRoutines.hpp" | 38 #include "runtime/stubRoutines.hpp" |
39 #include "utilities/macros.hpp" | |
40 #if INCLUDE_ALL_GCS | 40 #if INCLUDE_ALL_GCS |
41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" | 41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
42 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" | 42 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" |
43 #include "gc_implementation/g1/heapRegion.hpp" | 43 #include "gc_implementation/g1/heapRegion.hpp" |
44 #endif // INCLUDE_ALL_GCS | 44 #endif // INCLUDE_ALL_GCS |
382 xa = (x >> 48) & 0xffff; | 382 xa = (x >> 48) & 0xffff; |
383 xb = (x >> 32) & 0xffff; // No sign compensation, we use lis+ori or li to allow usage of R0. | 383 xb = (x >> 32) & 0xffff; // No sign compensation, we use lis+ori or li to allow usage of R0. |
384 bool load_xa = (xa != 0) || (xb < 0); | 384 bool load_xa = (xa != 0) || (xb < 0); |
385 bool return_xd = false; | 385 bool return_xd = false; |
386 | 386 |
387 if (load_xa) lis(tmp, xa); | 387 if (load_xa) { lis(tmp, xa); } |
388 if (xc) lis(d, xc); | 388 if (xc) { lis(d, xc); } |
389 if (load_xa) { | 389 if (load_xa) { |
390 if (xb) ori(tmp, tmp, xb); // No addi, we support tmp == R0. | 390 if (xb) { ori(tmp, tmp, (unsigned short)xb); } // No addi, we support tmp == R0. |
391 } else { | 391 } else { |
392 li(tmp, xb); // non-negative | 392 li(tmp, xb); // non-negative |
393 } | 393 } |
394 if (xc) { | 394 if (xc) { |
395 if (return_simm16_rest && xd >= 0) { return_xd = true; } // >= 0 to avoid carry propagation after insrdi/rldimi. | 395 if (return_simm16_rest && xd >= 0) { return_xd = true; } // >= 0 to avoid carry propagation after insrdi/rldimi. |
407 xa = rem & 0xFFFF; // Highest 16-bit chunk. | 407 xa = rem & 0xFFFF; // Highest 16-bit chunk. |
408 | 408 |
409 // opt 4: avoid adding 0 | 409 // opt 4: avoid adding 0 |
410 if (xa) { // Highest 16-bit needed? | 410 if (xa) { // Highest 16-bit needed? |
411 lis(d, xa); | 411 lis(d, xa); |
412 if (xb) addi(d, d, xb); | 412 if (xb) { addi(d, d, xb); } |
413 } else { | 413 } else { |
414 li(d, xb); | 414 li(d, xb); |
415 } | 415 } |
416 sldi(d, d, 32); | 416 sldi(d, d, 32); |
417 if (xc) addis(d, d, xc); | 417 if (xc) { addis(d, d, xc); } |
418 } | 418 } |
419 | 419 |
420 // opt 5: Return offset to be inserted into following instruction. | 420 // opt 5: Return offset to be inserted into following instruction. |
421 if (return_simm16_rest) return xd; | 421 if (return_simm16_rest) return xd; |
422 | 422 |
423 if (xd) addi(d, d, xd); | 423 if (xd) { addi(d, d, xd); } |
424 return 0; | 424 return 0; |
425 } | 425 } |
426 | 426 |
427 #ifndef PRODUCT | 427 #ifndef PRODUCT |
428 // Test of ppc assembler. | 428 // Test of ppc assembler. |
694 fcmpu( CCR7, F24, F25); | 694 fcmpu( CCR7, F24, F25); |
695 | 695 |
696 tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end()); | 696 tty->print_cr("\ntest_asm disassembly (0x%lx 0x%lx):", code()->insts_begin(), code()->insts_end()); |
697 code()->decode(); | 697 code()->decode(); |
698 } | 698 } |
699 | |
699 #endif // !PRODUCT | 700 #endif // !PRODUCT |