gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > DS Assembly - Select processor does not support.....SMLAWx

#139695 - DiscoStew - Sat Sep 08, 2007 11:51 pm

At the end of my thread of glRestoreMatrix in the DS Development section, I ended with the problem involving the use of 'smlawb', saying that the select processor does not support it.

An example...
Code:
c:/My_Projects/DS_Projects/Test_Project/arm9/src/BoneVertMult_asm.s(38): Error: selected processor does not support `smlawb r0,r8,r5,r0'


Any thoughts? Perhaps I'm not doing something correctly with the Make file?
_________________
DS - It's all about DiscoStew

#139698 - DekuTree64 - Sun Sep 09, 2007 12:43 am

Hmm, I remember back in the early days that you had to compile for arm9tdmi instead of arm946e-s, due to some floating point library conflict or something. I just tried it though, and it seems to be ok now.

In your makefile, where it defines CFLAGS, change -mcpu=arm9tdmi to -mcpu=arm946e-s and see if that works.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#139701 - DiscoStew - Sun Sep 09, 2007 1:30 am

Well, I tried making the change, but nothing changed as far as compiling. I'm still getting the unsupported errors.

This is the Make file for the arm9 of the combined arm9/arm7 Make file I use (which includes the change you suggested). I even tried changing -mtune also (and tried all 4 combos with -mcpu) to see if it worked, but it didn't.

Code:
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif

include $(DEVKITARM)/ds_rules

#---------------------------------------------------------------------------------
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
# DATA is a list of directories containing binary files
# all directories are relative to this makefile
#---------------------------------------------------------------------------------
BUILD      :=   build
SOURCES      :=   src
INCLUDES   :=   header
DATA      :=   data

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH   :=   -mthumb-interwork

# note: arm9tdmi isn't the correct CPU arch, but anything newer and LD
# *insists* it has a FPU or VFP, and it won't take no for an answer!
CFLAGS   :=   -g -Wall -O3\
          -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer\
         -ffast-math \
         $(ARCH)

CFLAGS      +=   $(INCLUDE) -DARM9
CXXFLAGS   :=   $(CFLAGS) -fno-rtti -fno-exceptions

ASFLAGS   :=   -g $(ARCH)
LDFLAGS   =   -specs=ds_arm9.specs -g $(ARCH) -mno-fpu -Wl,-Map,$(notdir $*.map)

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS   := -lnds9
 
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS   :=   $(LIBNDS)
 
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
 
export ARM9BIN   :=   $(TOPDIR)/$(TARGET).arm9
export ARM9ELF   :=   $(CURDIR)/$(TARGET).arm9.elf
export DEPSDIR   := $(CURDIR)/$(BUILD)

export VPATH   :=   $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
               $(foreach dir,$(DATA),$(CURDIR)/$(dir))
 
CFILES      :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES   :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES      :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES   :=   $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
 
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
   export LD   :=   $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
   export LD   :=   $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------

export OFILES   :=   $(addsuffix .o,$(BINFILES)) \
               $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
 
export INCLUDE   :=   $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
         $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
         -I$(CURDIR)/$(BUILD)
 
export LIBPATHS   :=   $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
 
.PHONY: $(BUILD) clean
 
#---------------------------------------------------------------------------------
$(BUILD):
   @[ -d $@ ] || mkdir -p $@
   @make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
 
#---------------------------------------------------------------------------------
clean:
   @echo clean ...
   @rm -fr $(BUILD) *.elf *.nds* *.bin
 
 
#---------------------------------------------------------------------------------
else
 
DEPENDS   :=   $(OFILES:.o=.d)
 
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(ARM9BIN)   :   $(ARM9ELF)
   @$(OBJCOPY) -O binary $< $@
   @echo built ... $(notdir $@)

$(ARM9ELF)   :   $(OFILES)
   @echo linking $(notdir $@)
   @$(LD)  $(LDFLAGS) $(OFILES) $(LIBPATHS) $(LIBS) -o $@

#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
#---------------------------------------------------------------------------------
%.bin.o   :   %.bin
#---------------------------------------------------------------------------------
   @echo $(notdir $<)
   @$(bin2o)

#---------------------------------------------------------------------------------
%.pcx.o   :   %.pcx
#---------------------------------------------------------------------------------
   @echo $(notdir $<)
   @$(bin2o)

#---------------------------------------------------------------------------------
%.mod.o   :   %.mod
#---------------------------------------------------------------------------------
   @echo $(notdir $<)
   @$(bin2o)

   
-include $(DEPENDS)

-include $(DEPENDS)
 
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------

_________________
DS - It's all about DiscoStew

#139703 - DekuTree64 - Sun Sep 09, 2007 2:41 am

Hmm, maybe try adding -mcpu=arm946e-s to ASFLAGS too
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#139859 - DiscoStew - Mon Sep 10, 2007 11:39 pm

Yep, that did it. Now the project can compile, but I'm not getting anything on the screen anymore. I'll have to tinker with assembly a little to figure out what's going on with it. Maybe trying individual commands first with some data given to them to check on the results.
_________________
DS - It's all about DiscoStew