Pages: [1]
  Print  
Author Topic: Have the engine always used SSE2?  (Read 11190 times)
sago007
Posts a lot
*

Cakes 62
Posts: 1664


Open Arena Developer


WWW
« on: June 21, 2016, 11:20:05 AM »

Yesterday I worked on creating an automatic build of the Windows version.
Apart from libcurl and libxmp I got the version compiled with a MXE installation.

However there was one thing that hit me.
I had to add the following flags:
Code:
BASE_CFLAGS += -mmmx -msse2

Otherwise errors from the inline assembly:
Code:
LD build/release-mingw32-x86/oa_ded.x86.exe
code/asm/ftola.c: In function 'qvmftolsse':
code/asm/ftola.c:49:3: error: unknown register name '%xmm0' in 'asm'
   __asm__ volatile
   ^
code/asm/snapvector.c: In function 'qsnapvectorsse':
code/asm/snapvector.c:38:2: error: unknown register name '%xmm2' in 'asm'
  __asm__ volatile
  ^
code/asm/snapvector.c:38:2: error: unknown register name '%xmm1' in 'asm'
code/asm/snapvector.c:38:2: error: unknown register name '%xmm0' in 'asm'
lto-wrapper: i686-w64-mingw32.static-gcc returned 1 exit status

The code in question seems to be original idtech3 code.
I wonder why I never had this problem before...

Anybody knows?
Logged

There are nothing offending in my posts.
fromhell
Administrator
GET A LIFE!
**********

Cakes 35
Posts: 14520



WWW
« Reply #1 on: June 21, 2016, 02:39:43 PM »

The original engine does use SSE/SIMD but in a non-restrictive way that doesn't leave out non-SSE targets.  I can still run the latest OA SDL1 engine build on a non-MMX, non-SSE Pentium target Smiley

However the (engine-master) makefile does need sse2 exposed to the inline assembler, which is why it specifies the AMD64 architecture (the first on the AMD side to feature SSE2)
Code:
# k8 so inline assembler knows about SSE
$(B)/ded/%.o: $(ASMDIR)/%.c
$(DO_CC) -march=k8
« Last Edit: June 21, 2016, 03:21:17 PM by fromhell » Logged

asking when OA3 will be done won't get OA3 done.
Progress of OA3 currently occurs behind closed doors alone

I do not provide technical support either.

new code development on github
Pages: [1]
  Print  
 
Jump to: