Gast
#2873167
Guten Morgen allerseits, Ich probiere derzeit die CMSIS DSP_lib von ARM mit Hilfe des GCC Compilers zu komipilieren. Das funktioniert auch alles wunderbar. Allerdings werden mir keine DSP Instruktionen erzeugt. Es wird stink normaler FPU Code erzeugt :-( Als Hardware kommt das STM32F4 Discovery Board zum Einsatz (StM32F407VG). Spezielle Toolchains verwende Ich keine sondern habe direkt die neuesten Compiler und Libs von hier verwendet: https://launchpad.net/gcc-arm-embedded Meine Compiler Einstellungen sehen so aus: CFLAGS = -g3 -O0 -Wall CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork CFLAGS += -mfloat-abi=softfp -mfpu=fpv4-sp-d16 CFLAGS += -ffunction-sections #gprof might not function CFLAGS += -ffreestanding -nostdlib CFLAGS += -fsingle-precision-constant #Treat floating-point constants as single precision instead of implicitly converting them to double-precision constants. CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" Meine Frage ist ob den schon jemand die DSP Lib zusammen mit dem GCC kompiliert hat und ein Assembly mit den passenden SIMDs bekommen hat? Mir geht es hier speziell um Matrizen Multiplikation und die Inverse. Hier mal ein Code Beispiel: while(colCnt > 0u) { /* c(m,n) = a(1,1)*b(1,1) + a(1,2) * b(2,1) + .... + a(m,p)*b(p,n) */ sum += *pIn1++ * (*pIn2); pIn2 += numColsB; sum += *pIn1++ * (*pIn2); pIn2 += numColsB; sum += *pIn1++ * (*pIn2); pIn2 += numColsB; sum += *pIn1++ * (*pIn2); pIn2 += numColsB; /* Decrement the loop count */ colCnt--; } erzeugt folgenden Code (nur ein Ausschnitt) 142 sum += *pIn1++ * (*pIn2); 0801b88c: ldr\tr3, [r7, #60]\t; 0x3c 0801b88e: vldr\ts14, [r3] 0801b892: ldr\tr3, [r7, #56]\t; 0x38 0801b894: vldr\ts15, [r3] 0801b898: vmul.f32\ts15, s14, s15 0801b89c: vldr\ts14, [r7, #44]\t; 0x2c 0801b8a0: vadd.f32\ts15, s14, s15 0801b8a4: vstr\ts15, [r7, #44]\t; 0x2c 0801b8a8: ldr\tr3, [r7, #60]\t; 0x3c 0801b8aa: add.w\tr3, r3, #4 0801b8ae: str\tr3, [r7, #60]\t; 0x3c Dabei würde Ich in dem Code eher etwas wie folgendes erwarten: 32 ± (32 x 32) = 32 MLA, MLS Was läuft hier falsch? Was muss Ich anders machen? Oder ist der GCC derzeit nicht in der Lage DSP zu erzeugen? Grüße vom Bodensee (es regnet), Jan