vex-3.39/lib/ccom core dump

Usage of VEX tools

vex-3.39/lib/ccom core dump

Postby ppy » Thu Mar 01, 2007 4:49 am

when I define a SIMD style custom instruction like this

__MAC4(result0, result1, result2, result3, acc0, acc1, acc2, acc3, a0, a1, a2, a3, b0, b1, b2, b3)

the sementic is
resulti = acci + ai * bi;

the __MAC4 macro is defined as follow:

#define __MAC4(result0, result1, result2, result3, acc0, acc1, acc2, acc3, a0, a1, a2, a3, b0, b1, b2, b3) { \
__vexasm4 __mac_r ; \
__mac_r = _asm4(VEX_MAC4_ASMOP, acc0, acc1, acc2, acc3, a0, a1, a2, a3, b0, b1, b2, b3); \
result0 = __mac_r.n0; \
result1 = __mac_r.n1; \
result2 = __mac_r.n2; \
result3 = __mac_r.n3; \
}

the implementation of VEX_MAC4_ASMOP is omitted here.
when I compile the application C file,with option "
-ms -mas_G -fmm=risc.mm "

the compiler error message is
cc: /vex-3.39/lib/ccom: Core dump
cc: Fatal error in /vex-3.39/lib/ccom
cc: Terminated by segementation violation

------------------------------------
while I can define a MAC2 in same sementics but with less arguments, and compiled it correctly.

------------------------------------
is there any clue to solve this problem, or vex has some limitation on this kind of customization?

Thanks
ppy
 
Posts: 2
Joined: Tue Dec 13, 2005 5:09 am

Postby frb » Thu Mar 01, 2007 5:22 pm

The _asm4() intrinsic only supports (up to) 8 inputs and 4 outputs.
The assumption in VEX is that you can only have 2 in / 1 out operation per issue "lane" and the current version only support ASM intrinsics up to 4 lanes.

[ Yes, the compiler message could have been a bit more explicit ]

You could define your MAC4 macro this way

Code: Select all
#define __MAC4(r0, r1, r2, r3, \
                         a0, a1, a2, a3, \
                         b0, b1, b2, b3) { \
    __vexasm4 __mac_r = _asm4(0x22, a0, a1, a2, a3, b0, b1, b2, b3); \
    r0 += __mac_r.n0; \
    r1 += __mac_r.n1; \
    r2 += __mac_r.n2; \
    r3 += __mac_r.n3; \
}


Howver, this will generate 1 ASM operation and 4 adds, so it may not be what you want.

-- Paolo
frb
 
Posts: 62
Joined: Thu Nov 12, 2009 3:44 pm


Return to VEX Tools



Who is online

Users browsing this forum: No registered users and 0 guests

cron