cpu

What is a microcoded instruction?

孤街醉人 提交于 2019-11-27 03:24:24
问题 I have seen a lot of literature referencing microcoded instructions. What are these and why they are used? 回答1: A CPU reads machine code and decodes it into internal control signals that send the right data to the right execution units. Most instructions map to one internal operation, and can be decoded directly. (e.g. on x86, add eax, edx just sends eax and edx to the integer ALU for an ADD operation, and puts the result in eax.) Some other single instructions do much more work. e.g. x86's

Get CPU/GPU/memory information

人盡茶涼 提交于 2019-11-27 03:23:59
I need to get any information about the CPU/GPU/memory.The number of cores, memory value, memory and cpu usage... I found a way to do this for IE: How to Use JavaScript to Find Hardware Information solutions for other browsers I do not know. Any idea how to do it? maybe webgl has access to information about your computer? or flash? or any other technology? Thank you very much Thomas This code will print GPU infos an will list all info you can have with the performance object of this browser (there is no standard for the BOM so it changes for each browser). <html> <body> <canvas id="glcanvas"

x86 LOCK question on multi-core CPUs

余生颓废 提交于 2019-11-27 03:01:34
Is it true that the x86 ASM "LOCK" command prefix causes all cores to freeze while the instruction following "LOCK" is being executed? I read this in a blog post and it doesn't make sense. I can't find anything that indicates if this is true or not. It's about locking the memory bus for that address. The Intel 64 and IA-32 Architectures Software Developer's Manual - Volume 3A: System Programming Guide, Part 1 tells us: 7.1.4 Effects of a LOCK Operation on Internal Processor Caches. For the Intel486 and Pentium processors, the LOCK# signal is always asserted on the bus during a LOCK operation,

Strange JIT pessimization of a loop idiom

给你一囗甜甜゛ 提交于 2019-11-27 02:37:12
问题 While analyzing the results of a recent question here, I encountered a quite peculiar phenomenon: apparently an extra layer of HotSpot's JIT-optimization actually slows down execution on my machine. Here is the code I have used for the measurement: @OutputTimeUnit(TimeUnit.NANOSECONDS) @BenchmarkMode(Mode.AverageTime) @OperationsPerInvocation(Measure.ARRAY_SIZE) @Warmup(iterations = 2, time = 1) @Measurement(iterations = 5, time = 1) @State(Scope.Thread) @Threads(1) @Fork(2) public class

Out-of-order instruction execution: is commit order preserved?

点点圈 提交于 2019-11-27 02:27:00
问题 On the one hand, Wikipedia writes about the steps of the out-of-order execution: Instruction fetch. Instruction dispatch to an instruction queue (also called instruction buffer or reservation stations). The instruction waits in the queue until its input operands are available. The instruction is then allowed to leave the queue before earlier, older instructions. The instruction is issued to the appropriate functional unit and executed by that unit. The results are queued. Only after all older

How to get CPU frequency in c#

吃可爱长大的小学妹 提交于 2019-11-27 02:21:58
问题 How can I get in c# the CPU frequency (example : 2Ghz) ? It's simple but I don't find it in the environnement variables. Thanks :) 回答1: var searcher = new ManagementObjectSearcher( "select MaxClockSpeed from Win32_Processor"); foreach (var item in searcher.Get()) { var clockSpeed = (uint)item["MaxClockSpeed"]; } if you wish to get other fields look at class Win32_processor 回答2: Try this code using System.Management; uint currentsp , Maxsp; public void CPUSpeed() { using(ManagementObject Mo =

Difference between core and processor

孤街醉人 提交于 2019-11-27 02:21:20
What is the difference between a core and a processor? I've already looked for it on Google, but I'm just having multi-core and multi-processor definition, but it doesn't match what I am looking for. Leeor A core is usually the basic computation unit of the CPU - it can run a single program context (or multiple ones if it supports hardware threads such as hyperthreading on Intel CPUs), maintaining the correct program state, registers, and correct execution order, and performing the operations through ALUs . For optimization purposes, a core can also hold on-core caches with copies of

On 32-bit CPUs, is an 'integer' type more efficient than a 'short' type?

半腔热情 提交于 2019-11-27 02:01:33
On a 32-bit CPU, an integer is 4 bytes and a short integer is 2 bytes. If I am writing a C/C++ application that uses many numeric values that will always fit within the provided range of a short integer, is it more efficient to use 4 byte integers or 2 byte integers? I have heard it suggested that 4 byte integers are more efficient as this fits the bandwidth of the bus from memory to the CPU. However, if I am adding together two short integers, would the CPU package both values in a single pass in parallel (thus spanning the 4 byte bandwidth of the bus)? Yes, you should definitely use a 32 bit

How has CPU architecture evolution affected virtual function call performance?

岁酱吖の 提交于 2019-11-27 01:03:24
问题 Years ago I was learning about x86 assembler, CPU pipelining, cache misses, branch prediction, and all that jazz. It was a tale of two halves. I read about all the wonderful advantages of the lengthy pipelines in the processor viz instruction reordering, cache preloading, dependency interleaving, etc. The downside was that any deviation for the norm was enormously costly. For example, IIRC a certain AMD processor in the early-gigahertz era had a 40 cycle penalty every time you called a

How to read cpu frequency on android device [closed]

烈酒焚心 提交于 2019-11-27 00:52:51
Is there any Java API for that? How can I read this information. To have frequency on Android, just read these special files in /sys directory: #cat "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" #cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq" #cat "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" You will have current, min and max Frequency allowed. not MHz, but at least something. bogoMIPS value can be useful for you. private String ReadCPUinfo() { ProcessBuilder cmd; String result=""; try{ String[] args = {"/system/bin/cat", "/proc/cpuinfo"}; cmd = new