computer-architecture

Dummy operations handling of Intel processor

自古美人都是妖i 提交于 2019-12-01 09:19:16
问题 Admittedly, I have a bit silly question. Basically, I am wondering if there are some special mechanisms provided by Intel processors to efficiently execute a series of dummy, i.e., NOP instructions? For instance,I could imagine there could be some kind of pre-fetch mechanism that identifies NOPS, discards them and tries to fetch some useful instructions instead. Or are these NOPS dispatched to the execution unit as normal instructions, meaning that i can roughly process 5 nops each cycle

Interconnect between per-core L2 and L3 in Core i7

柔情痞子 提交于 2019-12-01 06:39:29
The Intel core i7 has per-core L1 and L2 caches, and a large shared L3 cache. I need to know what kind of an interconnect connects the multiple L2s to the single L3. I am a student, and need to write a rough behavioral model of the cache subsystem. Is it a crossbar? A single bus? a ring? The references I came across mention structural details of the caches, but none of them mention what kind of on-chip interconnect exists. Thanks, -neha Modern i7's use a ring. From Tom's Hardware : Earlier this year, I had the chance to talk to Sailesh Kottapalli, a senior principle engineer at Intel, who

Analyse code for spatial and temporal locality

て烟熏妆下的殇ゞ 提交于 2019-11-30 09:53:18
Hi have some question regarding spatial and temporal locality. I have read in the course theory that spatial locality If one item is referenced, the likelihood of other address close by will be referenced soon temporal locality One item that is referenced at one point in time it tend to be referenced soon again. Ok, but how do I see that in the code? I think I understood the concept for temporal locality but I don't understand spatial locality yet. For instance in this loop for(i = 0; i < 20; i++) for(j = 0; j < 10; j++) a[i] = a[i]*j; The inner loop will call same memory address when

Are Golang binaries portable?

依然范特西╮ 提交于 2019-11-30 07:53:11
Suppose I'm a primarily Linux user, but I'm developing an application in Go that I want to be cross platform. I've searched around, but I can't seem to find information to absolve the following: If I go install a binary on my amd64 Ubuntu system, will it also work on anyone else's 64-bit Ubuntu/Debian system? How can I use go install to build an x86_64 binary that will also run out-of-the-box on 32-bit Debianlikes? If I must use Windows to make a binary which will run on Windows, how can I also ensure that even if my Windows system is 64-bit the executable will be built for x86_64? My

Time sources in x86 processors

南楼画角 提交于 2019-11-30 07:16:43
问题 Does anybody know x86 instructions that can be used to measure time? Is the timer that leads to task switches accessible by software? 回答1: Ways to measure time on an x86 platform: Real Time Clock - The source of time and date for your OS. 1 second precision. The only time source in a standard PC that can be used to measure absolute time. 8254 Counter/Timers - A standard counter/timer chip that has been present on motherboards since the dawn of PC (now a functional block inside the chipset).

How much time does it take to fetch one word from memory?

烈酒焚心 提交于 2019-11-30 06:58:52
Taking Peter Norvig's advice , I am pondering on the question: How much time does it take to fetch one word from memory, with and without a cache miss? (Assume standard hardware and architecture. To simplify calculations assume 1Ghz clock) Seems like Norvig answers this himself : execute typical instruction 1/1,000,000,000 sec = 1 nanosec fetch from L1 cache memory 0.5 nanosec branch misprediction 5 nanosec fetch from L2 cache memory 7 nanosec Mutex lock/unlock 25 nanosec fetch from main memory 100 nanosec send 2K bytes over 1Gbps network 20,000 nanosec read 1MB sequentially from memory 250

Where are variables in C++ stored?

北城以北 提交于 2019-11-30 06:53:40
Where are variables in C++ stored? Inside the RAM or the processor's cache? Variables are stored: on the stack, if they're auto -matic function-local variables on the heap, if they're allocated with new or malloc , etc. (details of what it means to say "a variable is stored in the heap" in the comments) in a per-process data area if they are global or static This is all in RAM, of course. Caching is transparent to userspace processes, though it may visibily affect performance. Compilers may optimize code to store variables in registers. This is highly compiler and code-dependent, but good

Big Endian and Little Endian

为君一笑 提交于 2019-11-30 05:14:09
问题 Given is the snap shot of memory of a byte-addressable computer. What would be loaded into register $16 after execution of instruction lw $16, 24($17) if machine is big endian and when Little Endian. Register $17 contains 200 . Now according to me, four bytes would be copied from the memory (224-227) irrespective of Little Endian or Big Endian,then if the machine is Big Endian then they will be copied to the register as they are. If the machine is Little Endian then will be reversed and then

Understanding word alignment

让人想犯罪 __ 提交于 2019-11-30 05:02:36
I understand what it means to access memory such that it is aligned but I don’t understand why this is necessary. For instance, why can I access a single byte from an address 0x…1 but I cannot access a half word (two bytes) from the same address. Again, I understand that if you have an address A and an object of size s that the access is aligned if A mod s = 0 . But I just don’t understand why this is important at the hardware level. Hardware is complex; this is a simplified explanation. A typical modern computer might have a 32-bit data bus. This means that any fetch that the CPU needs to do

What memory address spaces are there?

让人想犯罪 __ 提交于 2019-11-30 04:46:20
What forms of memory address spaces have been used? Today, a large flat virtual address space is common. Historically, more complicated address spaces have been used, such as a pair of a base address and an offset, a pair of a segment number and an offset, a word address plus some index for a byte or other sub-object, and so on. From time to time, various answers and comments assert that C/C++ pointers are essentially integers. That is an incorrect model for C/C++, since the variety of address spaces is undoubtedly the cause of some of the C rules about pointer operations. For example, not