I have started to work with risc-v few days ago, but yesterday I had a problem. The problem is the following:
I want to compile code for example for the RV32I base integer instruction set and I want to add too the "M" Standard Extension.
When I compile the C code I use the following command
riscv64-unknown-elf-gcc Program.c -o Program.o -m32 -march=RV32IM
Now if for example I want to see assembler code, I use
riscv64-unknown-elf-objdump -d Program.c > Program.dump
Now, if I explore the dump file "Program.dump" . I have noticed that sometimes appear assembly instructions as:
10c6c: 00a12427 fsw fa0,8(sp)
10dd0: 00a42023 sd a0,8(sp)
among many other cases.
If I see the "RISC-V Instruction Set Manual, Volume I: User-Level ISA, Version 2.0" at page 52 I observe that the fsw instruction belongs a RV32F Standard Extension and the sd instruction , it belongs to RV64I.
For this reason, I am confused I don't know if my problem is that I am not compiling well.
My question is: How can I compile C code only for the RV32I base integer instruction and the extension M?