mescc: Tinycc support: Support bit-fields.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 May 2018 15:05:28 +0000 (17:05 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 13 May 2018 15:05:28 +0000 (17:05 +0200)
commit0f874731056431449cd51fcb1a9d1feb56f403cf
tree6bdfe0222eee620a4f322c404b376fce8e57ac04
parentdae4a30417c3edae2f7fa8de5a678d595d5a983b
mescc: Tinycc support: Support bit-fields.

* module/language/c99/compiler.mes (struct->fields): Support bit-fields.
  (ast->type):
  (field-field):
  (field-offset):
  (expr->accu*):
  (expr->accu):
  (struct-field):
  (->size):
* module/language/c99/info.scm (<bit-field>): New type.
* stage0/x86.M1 (and____$i32,%eax, and____(%edx),%eax,
  mov____(%edx),%eax, or____(%edx),%eax): New macro.
* module/mes/as-i386.mes (i386:base-mem->accu): Use
  it.
  (i386:accu-and, i386:accu-and-base-mem, i386:accu-or-base-mem): New
  function.
* module/mes/as-i386.scm: Export them.
* scaffold/tests/7q-bit-field.c: Test it.
* build-aux/check-mescc.sh (tests): Run it.
build-aux/check-mescc.sh
module/language/c99/compiler.mes
module/language/c99/info.scm
module/mes/as-i386.mes
module/mes/as-i386.scm
scaffold/tests/7q-bit-field.c [new file with mode: 0644]
stage0/x86.M1