ack/lang/cem/cemcom.ansi
George Koehler 007a63d529 Begin to add long long to C compiler for linux386.
Add long long type, but without literals; you can't say '123LL' yet.
You can try constant operations, like `(long long)123 + 1`, but the
compiler's `arith` type might not be wide enough.  Conversions,
shifts, and some other operations don't work in i386 ncg; I am using a
union instead of conversions:

	union q {
		long long ll;
		unsigned long long ull;
		int i[2];
	};

Hack plat/linux386/descr to enable long long (size 8, alignment 4)
only for this platform.  The default for other platforms is to disable
long long (size -1).

In lang/cem/cemcom.ansi,

 - BigPars, SmallPars: Add default size, alignment of long long.
 - align.h: Add lnglng_align.
 - arith.c: Convert arithmetic operands to long long or unsigned long
   long when necessary; avoid conversion from long long to long.
   Allow long long as an arithmetic, integral, or logical operand.
 - ch3.c: Handle long long like int and long when erroneously applying
   a selector, like `long long ll; ll.member` or `ll->member`.  Add
   long long to integral and arithmetic types.
 - code.c: Add long long to type stabs for debugging.
 - conversion.c: Add long long to integral conversions.
 - cstoper.c: Write masks up to full_mask[8].  Add FIXME comment.
 - declar.g: Parse `long long` in code.
 - decspecs.c: Understand long long in type declarations.
 - eval.c: Add long long to operations, to generate code like `adi 8`.
   Don't use `ldc` with constant over 4 bytes.
 - ival.g: Allow long long in initializations.
 - main.c: Set lnglng_type and related values.
 - options.c: Add option like `-Vq8.4` to set long long to size 8,
   alignment 4.  I chose 'q', because Perl's pack and Ruby's
   Array#pack use 'q' for 64-bit or long long values; it might be a
   reference to BSD's old quad_t alias for long long.
 - sizes.h: Add lnglng_size.
 - stab.c: Allow long long when writing the type stab for debugging.
   Switch from calculating the ranges to hardcoding them in strings;
   add 8-byte ranges as a special case.  This also hardcodes the
   unsigned 4-byte range as "0;-1".  Before it was either "0;-1" or
   "0;4294967295", depending on sizeof(long) in the compiler.
 - struct.c: Try long long bitfield, but it will probably give the
   error, "bit field type long long does not fit in a word".
 - switch.c: Update comment.
 - tokenname.c: Define LNGLNG (long long) like LNGDBL (long double).
 - type.c, type.str: Add lnglng_type and ulnglng_type.  Add function
   no_long_long() to check if long long is disabled.
2019-09-02 11:24:44 -04:00
..
align.h Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
arith.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
arith.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
atw.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
BigPars Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
blocks.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
blocks.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
build.lua Rip out the built-in preprocessor from cemcom.ansi, now it's no longer used. 2018-09-02 12:50:50 +02:00
cemcom.ansi.1 Add missing C compiler command line option. 2019-05-11 01:07:33 +08:00
ch3.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
ch3.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3bin.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3bin.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3mon.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
ch3mon.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
char.tab We can build our first C file. 2016-08-07 21:56:53 +02:00
class.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
code.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
code.str * Remove some more compiler warnings. 2019-02-24 00:46:05 +08:00
conversion.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
conversion.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
cstoper.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
cstoper.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dataflow.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dataflow.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
declar.g Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
declar.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
declarator.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
declarator.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
decspecs.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
decspecs.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
def.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
domacro.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
domacro.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
dumpidf.c + Have the DEBUG version compile 2019-03-17 22:46:31 +08:00
error.c Fix issue again with wrong macro on error. 2019-02-26 00:46:10 +08:00
error.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
estack.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
eval.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
eval.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
expr.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
expr.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
expression.g Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
field.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
field.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
file_info.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
fltcstoper.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
fltcstoper.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
idf.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
idf.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
input.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
input.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
interface.h Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
ival.g Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
l_brace.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_class.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_comment.c First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
l_comment.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_em.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_ev_ord.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
l_lint.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
l_lint.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_misc.c First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
l_outdef.c bts2str(), long2str() are in <ack_string.h> 2017-11-10 18:00:00 -05:00
l_outdef.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_state.str fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
l_states.c Delete old "assert.h" files; use libc <assert.h>. 2017-11-09 22:22:13 -05:00
label.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
label.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
level.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
LLlex.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
LLlex.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
LLmessage.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
macro.str Rip out the built-in preprocessor from cemcom.ansi, now it's no longer used. 2018-09-02 12:50:50 +02:00
main.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
make.allocd Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-18 16:45:57 +00:00
make.hfiles Now avoids piping shell scripts into a new instance of sh, instead 2006-07-26 12:29:47 +00:00
make.next First milestone of replacing the build system. 2013-05-12 20:45:55 +01:00
make.tokcase Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-19 10:30:26 +00:00
make.tokfile Added the appropriate #! magic at the beginning of shell scripts. (Some modern shells don't like scripts to be without it.) 2006-07-19 10:30:26 +00:00
mes.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
next.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
options fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
options.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
options.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
pragma.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
pragma.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
program.g Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
proto.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
proto.main fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
proto.make fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
proto.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
sizes.h Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
skip.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
skip.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
SmallPars Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
specials.h fixup commit for tag 'llgen-1-0' 2006-02-04 00:57:05 +00:00
stab.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
stab.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stack.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stack.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
statement.g Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stb.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
stmt.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
struct.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
struct.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
switch.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
switch.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokcase.sed Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokcasee.in Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokcaseh.in Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
tokenname.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
tokenname.h Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
type.c Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
type.str Begin to add long long to C compiler for linux386. 2019-09-02 11:24:44 -04:00
util.c Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00
util.str Better ANSI C compatibility and portability: 2019-02-19 00:54:23 +08:00