Replies: 5 comments 10 replies
-
Can test.processors be run command line with gradle or other? I've always just right clicked run as->junit |
Beta Was this translation helpful? Give feedback.
-
We have looked at using crosstools, and may pivot to that in the near future. And yes, for gcc we use Those function definitions definitely need to be corrected. I can look into correcting those and re-running the tests. |
Beta Was this translation helpful? Give feedback.
-
Was gonna try detecting overflow/underflow but gave up on that after a quick glance. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/mumbel/ghidra/tree/pcode-tests Added a few hundred tests, maybe in the thousand range, lots of redundancy trying to trick compiler into different instructions and register usage. still needs some rounding out in some of them, but finally got some results. Have not triaged. Looks like sparc has some issue with swap operations either in sleigh or gcc-ism as it passed on native, x86-32, PPC, MIPS, ARM, AARCH ASSERTU4(u4_swapRef(0x00000001), 0x01000000);
ASSERTU4(u4_swapRef(I1_MAX), 0x7f000000);
ASSERTU4(u4_swapRef(I2_MAX), 0xff7f0000);
ASSERTU4(u4_swapRef(U1_MAX), 0xff000000);
ASSERTU4(u4_swapRef(U2_MAX), 0xffff0000);
ASSERTU4(u4_swapRef(0x80000000), 0x00000080);
ASSERTU4(u4_swapRef(0x00800000), 0x00008000);
ASSERTU4(u4_swapRef(0x00008000), 0x00800000);
ASSERTU4(u4_swapRef(0x00000080), 0x80000000); ASSERTI4(i4_swapRef(0x00000001), 0x01000000);
ASSERTI4(i4_swapRef(I1_MAX), 0x7f000000);
ASSERTI4(i4_swapRef(I1_MIN), 0x80ffffff);
ASSERTI4(i4_swapRef(U1_MAX), 0xff000000);
ASSERTI4(i4_swapRef(I2_MAX), 0xff7f0000);
ASSERTI4(i4_swapRef(I2_MIN), 0x80ffff);
ASSERTI4(i4_swapRef(U2_MAX), 0xffff0000);
ASSERTI4(i4_swapRef(I4_MAX), 0xffffff7f);
ASSERTI4(i4_swapRef(I4_MIN), 0x00000080); i4 i4_swapRef(i4 val)
{
i4 z;
u1 *x = (u1 *)&val;
z = (x[0] << 24) |
(x[1] << 16) |
(x[2] << 8) |
(x[3] << 0);
return z;
}
u4 u4_swapRef(u4 val)
{
u4 z;
u1 *x = (u1 *)&val;
z = (x[0] << 24) |
(x[1] << 16) |
(x[2] << 8) |
(x[3] << 0);
return z;
} |
Beta Was this translation helpful? Give feedback.
-
had 4 errors on 68000. 1 swap and 3 min/max (maybe new repro for #8396 or sleigh bug handling 64-bit math?) #define PCODE_BIOP_MIN(typ) \
typ typ##_minimumNew( \
typ lhs, \
typ rhs) \
{ \
typ z; \
z = lhs < rhs ? lhs : rhs; \
return z; \
}
#define PCODE_BIOP_MAX(typ) \
typ typ##_maximumNew( \
typ lhs, \
typ rhs) \
{ \
typ z; \
z = lhs > rhs ? lhs : rhs; \
return z; \
} \
typ typ##_maximum( \
typ lhs, \
typ rhs) \
{ \
typ z; \
z = lhs >= rhs ? lhs : rhs; \
return z; \
}
PCODE_BIOP_MIN(i8);
PCODE_BIOP_MAX(i8); ASSERTI8(i8_minimumNew(1, I8_MIN), I8_MIN);
ASSERTI8(i8_maximumNew(1, I8_MIN), 1);
ASSERTI8(i8_maximum(I8_MIN, 1), 1); |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Was looking at pcodetests to see if there was easy improvements there and at my old/previous pcodetest branch to see if i can get that updated/going again
One quick idea was increase optimizations, currently
O0
andO3
, but could also addO1
,O2
,Os
,Og
,Oz
, andOfast
. At least for 32 BE MIPS and PowerPC none of these produced the same md5.Only thing of note after a quick test:
ghidra/Ghidra/Extensions/SleighDevTools/pcodetest/c_src/BIOPS.test
Line 337 in 1ca9e32
This passed PPC
O0
, but failedOs
, nothing wrong with SLEIGH, just copypasta maybe in test. Why return signed?same looking issue here (again, why difference in signed/unsigned), but didnt fail junit:
ghidra/Ghidra/Extensions/SleighDevTools/pcodetest/c_src/BIOPS2.test
Line 379 in 1ca9e32
and I haven't messed with ARM pcodetest too much but did see this with grep:
ghidra/Ghidra/Extensions/SleighDevTools/pcodetest/c_src/arm/arm.test
Line 35 in 1ca9e32
for the compilers, did ghidra team use crosstools-ng or anything. based on the "toolchain" args/config items these are at weird locations, so not a typical
apt-get install gcc-powerpc
type location. I guess this is the--sysroot
?Beta Was this translation helpful? Give feedback.
All reactions