Re: Conditional compile if 64-bit cpu, in .xs ?
- From: "Sisyphus" <sisyphus1@xxxxxxxxxxxxxxxxx>
- Date: Tue, 29 Aug 2006 12:57:54 +1000
"Peter Billam" <peter@xxxxxxxxxxxxxxxxxxxx>
..
..
OK, I think I get it...
You mean in Makefile.PL have, if ($Config{use64bitint}) then
DEFINE => '-DMY_64bit_FIX_NEEDED',
and then put
#ifdef MY_64bit_FIX_NEEDED
v0 &= 0xffffffff;
#endif
in the .xs ?
Yep - that's what he means.
..
..
Presumably in this case I'd be looking for $Config{use64bitint} ?
I think you can configure a perl with 'use64bitint' on a 32-bit architecture
iff the compiler supports the 'long long' type.
Maybe that doesn't matter wrt what you're trying to do (though your original
post specified 64-bit architectures) .... or maybe there's a need to also
check $Config{longsize} ... or maybe something else .
I found this in config.h:
---------------------------------------
/* USE_64_BIT_INT:
* This symbol, if defined, indicates that 64-bit integers should
* be used when available. If not defined, the native integers
* will be employed (be they 32 or 64 bits). The minimal possible
* 64-bitness is used, just enough to get 64-bit integers into Perl.
* This may mean using for example "long longs", while your memory
* may still be limited to 2 gigabytes.
*/
/* USE_64_BIT_ALL:
* This symbol, if defined, indicates that 64-bit integers should
* be used when available. If not defined, the native integers
* will be used (be they 32 or 64 bits). The maximal possible
* 64-bitness is employed: LP64 or ILP64, meaning that you will
* be able to use more than 2 gigabytes of memory. This mode is
* even more binary incompatible than USE_64_BIT_INT. You may not
* be able to run the resulting executable in a 32-bit CPU at all or
* you may need at least to reboot your OS to 64-bit mode.
*/
--------------------------------------------
Cheers,
Rob
.
- Follow-Ups:
- Re: Conditional compile if 64-bit cpu, in .xs ?
- From: Peter Billam
- Re: Conditional compile if 64-bit cpu, in .xs ?
- References:
- Conditional compile if 64-bit cpu, in .xs ?
- From: Peter Billam
- Re: Conditional compile if 64-bit cpu, in .xs ?
- From: Ilya Zakharevich
- Re: Conditional compile if 64-bit cpu, in .xs ?
- From: Peter Billam
- Conditional compile if 64-bit cpu, in .xs ?
- Prev by Date: Re: explain code section please...
- Next by Date: Re: Conditional compile if 64-bit cpu, in .xs ?
- Previous by thread: Re: Conditional compile if 64-bit cpu, in .xs ?
- Next by thread: Re: Conditional compile if 64-bit cpu, in .xs ?
- Index(es):
Relevant Pages
|