From a14b9578ee5297d954103e05d7b2d322816ddd8f Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 1 Oct 2016 17:38:24 +0200 Subject: Support for 64-bit architectures: x86 in 64-bit mode This commit enriches the IA32 port so that it supports x86 processors in 64-bit mode as well as in 32-bit mode, depending on the value of Archi.ptr64, which itself is set from the configuration model. To activate x86-64 bit support, configure with "x86_64-linux". Main steps: - Enrich Op.v and Asm.v with 64-bit operations - SelectLong: in 64-bit mode, use 64-bit operations directly; in 32-bit mode, fall back on the old implementation based on pairs of 32-bit integers - Conventions1: support x86-64 ABI in addition to the 32-bit ABI. - Add support for the new 64-bit operations everywhere. - runtime/x86_64: implementation of the supporting library appropriate for x86 in 64-bit mode To do: - More optimizations are possible on 64-bit integer arithmetic operations. - Could add new chunks to load, say, an unsigned byte into a 64-bit long (currently we load as a 32-bit int then zero-extend). - Implements the wrong ABI for struct passing. --- runtime/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'runtime/Makefile') diff --git a/runtime/Makefile b/runtime/Makefile index c01ef38d..59d2bb64 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -1,11 +1,24 @@ include ../Makefile.config CFLAGS=-O1 -g -Wall + +ifeq ($(ARCH),ia32) +ifeq ($(MODEL),64) +ARCH=x86_64 +endif +endif + +ifeq ($(ARCH),x86_64) +OBJS=i64_dtou.o i64_utod.o i64_utof.o vararg.o +else OBJS=i64_dtos.o i64_dtou.o i64_sar.o i64_sdiv.o i64_shl.o \ i64_shr.o i64_smod.o i64_stod.o i64_stof.o \ i64_udivmod.o i64_udiv.o i64_umod.o i64_utod.o i64_utof.o \ vararg.o +endif + LIB=libcompcert.a + INCLUDES=include/float.h include/stdarg.h include/stdbool.h \ include/stddef.h include/varargs.h include/stdalign.h \ include/stdnoreturn.h -- cgit