Posts

Showing posts from May, 2024

Week4 - SIMD, SVE, SVE2

In the newer processor due to backwards compatibility, it must use some of its space for it to store code or logic for it to work. There are flags in every platform, and they are all different. It shows what the CPU capabilities is. Flags are group into level 0,1,2,3. The higher level the more capabilities. You can choice what level to target when developing. On and off are like 1 and 0, it has a flow of electricity to a component than it’s on, but this requires a flow of electricity, and it can be more efficient to use state. It charges up a component and if it has a charge than it’s a 1. It will be recharge if the charge it is getting low. The method is better way to use power than having a flow. The smaller the component the less power it uses. There is a limit of how small it can be, too small that we can’t tell it’s a 0 or 1. Autovectorization - The complier will do most of the work for us to use vectors. It will look for user case that can apply using ve...

Project Stage 1

GCC install and build with version Before diving into the code, let's set up a local GCC installation. Head over to the official installation guide https://gcc.gnu.org/install/ for detailed instructions. Here's a quick rundown: Clone the Source: Use git clone git://gcc.gnu.org/git/gcc.git to grab the latest GCC source code. Build Directory: Create a directory "mkdir" for your build and navigate to it using "cd" . you can create different versions for different use case, but keep in mind GCC is not small. Once you are done with the build, you can simply delete the build files . We create different directory for different build so it would have a cleaner workflow. mkdir ./gcc-build-001 cd ./gcc-build-001 Local Installation: In your newly made build folder. Specify a custom installation path with "../configure --prefix=/path/to/install/gcc ". Replace "/path/to/install/gcc " with your desired location. This will create a make file fo...

Week 3

Compiler Compiler is like a translator. Human type things they better understand (more human friendly), than it will change it to what the machine understands. There is few steps on translating code. (pre-processing | compiling | assembling | linking). Pre-prcessing is to prepare the human typed code for the next step. It can be removing your comments. compiling this is the step that the code is being translated to assembly language so it's one step closer to what machine can read. Assembling is taking those assembly language and making them in to machine code which computer can read and run. Linking, is other code or set of instructions and combine it with your code for the program to work. Knowing how compilers improve your code lets you trust them to make your easy-to-read code run faster. This lets you focus on more important stuff, like picking the best ways to solve problems and how to store your data. The compiler we focus on is GCC. GCC options: -o flag: (the strictest of...

Lab 3

In AArch64, We are trying to get it to print "loop" 10 times:  .text  .globl _start  min = 0                          /* starting value for the loop index; **note that this is a symbol (constant)**, not a variable */  max = 10                         /* loop exits when the index hits this number (loop condition is i<max) */  _start:      mov     x19, min  loop:     mov     x0, 1           /* file descriptor: 1 is stdout */     adr     x1, msg       /* message location (memory address) */     mov   ...

Lab2

Image
Goal:      - get user input number only     - generate random number using $FE range from 0 to 1024, but will start with a number range 0 - 255 first     - user can input number to guess the number     - if user input an number that is not the target, on display it will mark as red. Mark green if the user input match the target   setup:    ; ROM routines define        SCINIT        $ff81 ; initialize/clear screen define        CHRIN        $ffcf ; input character from keyboard define        CHROUT        $ffd2 ; output character to screen define        SCREEN        $ffed ; get screen size define        PLOT        $ff...