Posts

Project Stage 3

Goal:   After checking if the options are valid. Have to create a global array of afmv_targets and unsigned int of afmv_cnt. This is for others to consume. -fafmv="default" will have a count of 0. -fafmv="default, abc" will have a count of 1. Try to use the target_clone in GCC. Make a afmv.h for the global var I have to make. Header file: #ifndef GCC_AFMV_H #define GCC_AFMV_H /* Storage global variable for AFMV*/ #define AFMV_MAX_ARRAY_SIZE 100 extern unsigned int afmv_cnt; extern char* afmv_targets[AFMV_MAX_ARRAY_SIZE]; #endif /* GCC_AFMV_H */ add include header in opts.cc update count and array if all options passes the chceck. unsigned int afmv_cnt = 0; char* afmv_targets[AFMV_MAX_ARRAY_SIZE]; and      if (!is_found) {           error_at(loc, "Unsupported option '%s'", feature);           is_valid = false;      } else {           afmv_targets[afmv_cnt++] = feat...

Project Stage 2

 My task is: Command-line Parsing Description: Parse the GCC command line to pick up AFMV options, process the version list to validate the architectural feature specification. (example: -fafmv=var1,var2) One of the places to see how others did it is on GitHub of other class that did similar project task. I could also go on GCC's git to see pass commit that is could be related to my task of adding a pass. Most of my work will be done in the  .opt file writing. We will be using slack as a communication tool. Link: other class: https://github.com/seneca-cdot/gcc GCC: https://gcc.gnu.org/onlinedocs/gccint/ GitHub: https://github.com/seneca-cdot/gcc (I work in the branch " 2024-S-command-line-parsing ") GitHub branch: https://github.com/Seneca-CDOT/gcc/tree/2024-S-command-line-parsing I will be using the class server. I don think I want to spend time on trying to do it on my local device. This term of SPO600 they cut the time in half. We are very time limited. This stage we...

Week4

 Makefile   A Makefile is a text file used with the GNU Make utility to automate the compilation process in GCC. It specifies the instructions for building an executable or library from your source code files. This is like building a LEGO set. makefile takes all the different pieces and put them together. One of the benefits is when rebuilding makefile only update the part that need to. so it just switch out a small part of the LEGO set, no need to start from stretch. Reduce time of building a new version speed up developing time.  On the project I will be

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   ...