Skip to content

Commit

Permalink
native_pbc: float 4 fixes, mk_native_pbc
Browse files Browse the repository at this point in the history
floattype_4 needs some prev. undefined helpers
improve mk_native_pbc
regenerate 32-bit le pbc's
  • Loading branch information
Reini Urban committed Sep 9, 2012
1 parent d8f0aae commit 013d63e
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/packfile/pf_items.c
Expand Up @@ -355,7 +355,6 @@ Tested ok.
*/

#if (NUMVAL_SIZE == 8)
static void
cvt_num10_num8(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
{
Expand Down Expand Up @@ -445,6 +444,7 @@ First variant ok, 2nd not ok.
*/

#if (NUMVAL_SIZE == 8)
static void
cvt_num16_num8(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
{
Expand Down Expand Up @@ -729,7 +729,6 @@ cvt_num4_num16(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
}
#endif

#if (NUMVAL_SIZE == 4)
static void
cvt_num8_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
{
Expand All @@ -740,10 +739,11 @@ cvt_num8_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
memcpy(dest, &f, 4);
}

#if (NUMVAL_SIZE == 4)
static void
cvt_num10_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
{
#if (__I86__ || defined(__INTEL__) || defined(_M_IA64) || defined(__ia64__))
#if (defined(__I86__) || defined(__INTEL__) || defined(_M_IA64) || defined(__ia64__))
# if NUMVAL_SIZE == 12
/* i386 only */
float f;
Expand All @@ -760,8 +760,8 @@ cvt_num10_num4(ARGOUT(unsigned char *dest), ARGIN(const unsigned char *src))
memcpy(dest, &f, 4);
# endif
#else
cvt_num10_num8();
cvt_num8_num4();
cvt_num10_num8(dest, src);
cvt_num8_num4(dest, src);
#endif
}

Expand Down
Binary file removed t/native_pbc/integer_4_be.pbc
Binary file not shown.
Binary file modified t/native_pbc/integer_4_le.pbc
Binary file not shown.
Binary file removed t/native_pbc/number_4_12_le.pbc
Binary file not shown.
Binary file removed t/native_pbc/number_4_16_be.pbc
Binary file not shown.
Binary file removed t/native_pbc/number_4_8_be.pbc
Binary file not shown.
Binary file modified t/native_pbc/number_4_8_le.pbc
Binary file not shown.
Binary file modified t/native_pbc/number_8_16_le.pbc
Binary file not shown.
Binary file modified t/native_pbc/number_8_8_le.pbc
Binary file not shown.
Binary file removed t/native_pbc/string_4_be.pbc
Binary file not shown.
Binary file modified t/native_pbc/string_4_le.pbc
Binary file not shown.
20 changes: 12 additions & 8 deletions tools/dev/mk_native_pbc
Expand Up @@ -23,6 +23,7 @@ exe=
targets="parrot parrot_config pbc_dump"

initconfig () {
test -e parrot_config || exit
byteorder=$(./parrot_config byteorder)
ptrsize=$(./parrot_config ptrsize)
intvalsize=$(./parrot_config intvalsize)
Expand Down Expand Up @@ -53,17 +54,19 @@ createpbc () {
done
}

echo ""
tail -n4 myconfig
echo make -s $targets
make -s $targets || exit 1

initconfig

if [ "$(./parrot_config osname)" = "cygwin" ]; then exe=.exe; fi
if [ "$ptrsize" = "4" -a "$intvalsize" != "4" ]; then
echo "Sorry, unsupported perl - probably using use64bitint. ptrsize/intvalsize mismatch."
exit
fi

echo ""
tail myconfig
make -s $targets || exit 1

initconfig
createpbc

#make pbc_dump$exe
Expand All @@ -76,9 +79,10 @@ reconfig () {
floatval="$1"
shift
make -s prog-clean
echo perl Configure.pl --floatval=\"$floatval\" --nomanicheck $@
perl Configure.pl --floatval=\"$floatval\" $conf --nomanicheck $@
tail myconfig
echo perl Configure.pl --floatval="$floatval" --nomanicheck $@
perl Configure.pl --floatval="$floatval" $conf --nomanicheck $@
tail -n4 myconfig
echo make -s $targets
make -s $targets || return
initconfig
./parrot -o t/native_pbc/number_${n_id}.pbc t/native_pbc/testdata/number.pasm \
Expand Down

0 comments on commit 013d63e

Please sign in to comment.