Browse Source

Use align-by-8 on all platforms by default

pull/1784/head
Sami Vaarala 7 years ago
parent
commit
de7ae8a2ec
  1. 3
      config/architectures/architecture_arm32.h.in
  2. 3
      config/architectures/architecture_arm64.h.in
  3. 3
      config/architectures/architecture_emscripten.h.in
  4. 3
      config/architectures/architecture_m68k.h.in
  5. 3
      config/architectures/architecture_mips32.h.in
  6. 3
      config/architectures/architecture_mips64.h.in
  7. 3
      config/architectures/architecture_powerpc32.h.in
  8. 3
      config/architectures/architecture_powerpc64.h.in
  9. 3
      config/architectures/architecture_sparc32.h.in
  10. 3
      config/architectures/architecture_sparc64.h.in
  11. 6
      config/architectures/architecture_superh.h.in
  12. 6
      config/architectures/architecture_x32.h.in
  13. 6
      config/architectures/architecture_x64.h.in
  14. 6
      config/architectures/architecture_x86.h.in
  15. 4
      config/examples/low_memory.yaml
  16. 7
      config/header-snippets/alignment_fillin.h.in

3
config/architectures/architecture_arm32.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "arm32"
/* Byte order varies, so rely on autodetect. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 4
#endif
#define DUK_USE_PACKED_TVAL

3
config/architectures/architecture_arm64.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "arm64"
/* Byte order varies, so rely on autodetect. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#undef DUK_USE_PACKED_TVAL

3
config/architectures/architecture_emscripten.h.in

@ -2,7 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 1
#endif
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#undef DUK_USE_PACKED_TVAL

3
config/architectures/architecture_m68k.h.in

@ -2,7 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 3
#endif
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#define DUK_USE_PACKED_TVAL

3
config/architectures/architecture_mips32.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "mips32"
/* MIPS byte order varies so rely on autodetection. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#define DUK_USE_PACKED_TVAL

3
config/architectures/architecture_mips64.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "mips64"
/* MIPS byte order varies so rely on autodetection. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#undef DUK_USE_PACKED_TVAL

3
config/architectures/architecture_powerpc32.h.in

@ -2,7 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 3
#endif
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#define DUK_USE_PACKED_TVAL

3
config/architectures/architecture_powerpc64.h.in

@ -2,7 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 3
#endif
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#undef DUK_USE_PACKED_TVAL

3
config/architectures/architecture_sparc32.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "sparc32"
/* SPARC byte order varies so rely on autodetection. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#define DUK_USE_PACKED_TVAL

3
config/architectures/architecture_sparc64.h.in

@ -1,6 +1,3 @@
#define DUK_USE_ARCH_STRING "sparc64"
/* SPARC byte order varies so rely on autodetection. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif
#undef DUK_USE_PACKED_TVAL

6
config/architectures/architecture_superh.h.in

@ -1,9 +1,3 @@
#define DUK_USE_ARCH_STRING "sh"
/* Byte order varies, rely on autodetection. */
/* Based on 'make checkalign' there are no alignment requirements on
* Linux SH4, but align by 4 is probably a good basic default.
*/
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 4
#endif
#define DUK_USE_PACKED_TVAL

6
config/architectures/architecture_x32.h.in

@ -2,10 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 1
#endif
/* XXX: This is technically not guaranteed because it's possible to configure
* an x86 to require aligned accesses with Alignment Check (AC) flag.
*/
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 1
#endif
#define DUK_USE_PACKED_TVAL

6
config/architectures/architecture_x64.h.in

@ -2,10 +2,4 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 1
#endif
/* XXX: This is technically not guaranteed because it's possible to configure
* an x86 to require aligned accesses with Alignment Check (AC) flag.
*/
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 1
#endif
#undef DUK_USE_PACKED_TVAL

6
config/architectures/architecture_x86.h.in

@ -2,12 +2,6 @@
#if !defined(DUK_USE_BYTEORDER)
#define DUK_USE_BYTEORDER 1
#endif
/* XXX: This is technically not guaranteed because it's possible to configure
* an x86 to require aligned accesses with Alignment Check (AC) flag.
*/
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 1
#endif
#define DUK_USE_PACKED_TVAL

4
config/examples/low_memory.yaml

@ -11,6 +11,10 @@
# - Does not enable ROM string/object support by default, enable manually
#
# Consider switching alignment to align-by-1 or align-by-4 for more compact
# memory layout if the architecture supports it.
#DUK_USE_ALIGN_BY: 1
DUK_USE_PREFER_SIZE: true
DUK_USE_EXEC_PREFER_SIZE: true
DUK_USE_FAST_REFCOUNT_DEFAULT: false

7
config/header-snippets/alignment_fillin.h.in

@ -3,10 +3,13 @@
*
* Assume unaligned accesses are not supported unless specifically allowed
* in the target platform. Some platforms may support unaligned accesses
* but alignment to 4 or 8 may still be desirable.
* but alignment to 4 or 8 may still be desirable. Note that unaligned
* accesses (and even pointers) relative to natural alignment (regardless
* of target alignment) are technically undefined behavior and thus
* compiler/architecture specific.
*/
/* If not provided, use safe default for alignment. */
/* If not forced, use safe default for alignment. */
#if !defined(DUK_USE_ALIGN_BY)
#define DUK_USE_ALIGN_BY 8
#endif

Loading…
Cancel
Save