[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] configure tests?
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] configure tests? |
Date: |
Fri, 26 May 2006 17:52:34 -0700 |
User-agent: |
Mutt/1.5.9i |
On Fri, May 26, 2006 at 03:58:42PM -0400, Michael Dickens wrote:
> I think I've got the issue with gr-audio-osx running on Intel
> Macs ... it's about endianness in the float stream. Which means, if
> I'm correct, that I need to add a #ifdef to select on whether the CPU
> is big (PPC) or little (Intel) endian. Anyone know if this is
> already available for configure, or will I need to add one? If the
> latter, I'm sure it's straight forward (e.g. `uname -a | grep
> powerpc` == ""), but why reinvent the wheel?
There's already a test in the usrp and gr-usrp code for this.
See configure.ac, AC_C_BIGENDIAN.
See also usrp/host/lib/usrp_bytesex.h
I believe that the gr-usrp code already handles this properly.
See gr-usrp/usrp1_{sink,source}_{c,s}.cc.
Search for host_to_usrp_short and usrp_to_host_short
> Also, it looks like Apple's GCC implements the ".align X" in assembly
> as a log2 based number (for either PPC or Intel) while others use
> ".align Y" where X = log2 (Y) .. a linear number. I really doubt
> that this is available for configure, but it's worth checking. I've
> already started writing this one ("config/gr_asm_dot_align.m4"), but
> again why reinvent the wheel?
I don't know of a test for this.
How are you planning on implementing the test?
I'd suggest something like:
in test.asm (syntax could be wrong...)
.globl _start_test, _end_test
.align 16
_start_test:
.db 1
.align 4
_end_test:
Then use nm to extract the resulting symbol values, followed by some
python, etc to compute difference. Or I guess your test code could
just write the difference to stdout, then you could parse that.
Eric