[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] adding SSE opcodes to TCC assembler

From: Anaël Seghezzi
Subject: [Tinycc-devel] adding SSE opcodes to TCC assembler
Date: Fri, 18 Sep 2015 18:26:44 +0200

Hi all,

I would like to add SSE opcodes to TCC assembler,
is it enough to add the opcodes at the end of "X86_64-asm.h" ?

I added this as a test, to load and add two (unaligned) vectors :

        DEF_ASM_OP2(movups, 0x0f10, 0, OPC_MODRM, OPT_EA | OPT_REG32, OPT_SSE )
ALT(DEF_ASM_OP2(movups, 0x0f11, 0, OPC_MODRM, OPT_SSE, OPT_EA | OPT_REG32 ))
        DEF_ASM_OP2(addps, 0x0f58, 0, OPC_MODRM, OPT_EA | OPT_SSE, OPT_SSE )

That I tested with :

asm (
    "movups %0, %%xmm0;"
    "movups %1, %%xmm1;"
    "addps %%xmm1, %%xmm0;"
    "movups %%xmm0, %2\"
    : "g" (v1), "g" (v2), "g" (v3)

This exemple seems to work, but is it enough ?


> On Thu, Sep 10, 2015 at 12:32:00PM +0200, Anaël Seghezzi wrote:
> > Hi all,
> > 
> > what would it take to add SSE2 opcodes to tcc assembler, at least
> for x64 ?
> > 
> > I'm working on a small interactive sandbox to play with C in
> realtime to create small demos/games with graphics and sounds,
> > a sort of mix of "ShaderToy" and "Pico8". I'm using TCC and it's
> all very effective, it could just gain some speed with a bit of SSE2
> instructions.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]