1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
593 cores_per_cpu(); |
593 cores_per_cpu(); |
594 } |
594 } |
595 return (result == 0 ? 1 : result); |
595 return (result == 0 ? 1 : result); |
596 } |
596 } |
597 |
597 |
598 static intx prefetch_data_size() { |
598 static intx L1_line_size() { |
599 intx result = 0; |
599 intx result = 0; |
600 if (is_intel()) { |
600 if (is_intel()) { |
601 result = (_cpuid_info.dcp_cpuid4_ebx.bits.L1_line_size + 1); |
601 result = (_cpuid_info.dcp_cpuid4_ebx.bits.L1_line_size + 1); |
602 } else if (is_amd()) { |
602 } else if (is_amd()) { |
603 result = _cpuid_info.ext_cpuid5_ecx.bits.L1_line_size; |
603 result = _cpuid_info.ext_cpuid5_ecx.bits.L1_line_size; |
604 } |
604 } |
605 if (result < 32) // not defined ? |
605 if (result < 32) // not defined ? |
606 result = 32; // 32 bytes by default on x86 and other x64 |
606 result = 32; // 32 bytes by default on x86 and other x64 |
607 return result; |
607 return result; |
|
608 } |
|
609 |
|
610 static intx prefetch_data_size() { |
|
611 return L1_line_size(); |
608 } |
612 } |
609 |
613 |
610 // |
614 // |
611 // Feature identification |
615 // Feature identification |
612 // |
616 // |