On 09/19/2015 04:29 PM, Gavin Wraith wrote:
> [...]
> The Acorn C manual had a useful chapter "Implementation Details"
> that assured me that ints and longs were 32-bit and so on.
> Where do I find something similar for the RISC OS implementation
> of 4.7.4? There is a dizzying range of possibilities for
> what numbers are in Lua. New to Lua 5.3 is a distinction
> (in the C code) between the types LUA_NUMBER and LUA_INTEGER
> so I need to check out what GCC is producing.
gcc defines a bunch of __* preprocessor defines which can be used by the
runtime library headers to define useful types. To reveal such
implementation details, I would use:
arm-unknown-riscos-gcc -dM -E -x c /dev/null | sort
This might work on RISC OS native compiler as well when you replace
"/dev/null | sort" by "null:$.foo or" specifying an empty c.foo file
instead.
Probably the most interesting info is that int/long/wchar_t/wint_t are
signed 32 bit, char is unsigned, long long/long double 8 bytes wide,
short 2 bytes wide. AFAIK all in sync with Norcroft C implementation
details.
> Does GCC look
> after coercions/restrictions integers to/from floats when
> the flag -mfpu=vfp is used, or do I have to code those myself?
Not 100% sure what details you're after here but -mfpu=vfp does not
matter when the compiler is doing int/float type conversions. It
follows C89 (or whatever standard you specify with -std=) standard. If
you do type conversions at runtime (say, ceil()) then it is a matter of
the runtime library (unless you feed it with constant data, then gcc can
optimize such calls). But then again -mfpu=vfp should not matter
(ignoring possible bugs).
Is this what you want to know ?
John.
_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK
No comments:
Post a Comment