Commit 3869ac51 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Revert "Reduce the likelihood of x64/x86-64 changes breaking the build on other arches (#7083)."

This reverts commit a2e589a1.

Looks like it broke the build on x86/Windows.
parent a2e589a1
......@@ -51,17 +51,6 @@ where
#include "nativeGen/NCG.h"
#include "HsVersions.h"
#if i386_TARGET_ARCH == 0 && x86_64_TARGET_ARCH == 0
-- Compiling for some arch other than Intel so we choose x86-64 as default.
#undef arm_TARGET_ARCH
#undef powerpc_TARGET_ARCH
#undef powerpc64_TARGET_ARCH
#undef sparc_TARGET_ARCH
#undef x86_64_TARGET_ARCH
#define x86_64_TARGET_ARCH 1
#endif
#include "../includes/stg/MachRegs.h"
import Reg
......@@ -422,6 +411,8 @@ allIntArgRegs :: [Reg]
allFPArgRegs :: [Reg]
callClobberedRegs :: [Reg]
#if defined(i386_TARGET_ARCH) || defined(x86_64_TARGET_ARCH)
#if i386_TARGET_ARCH
#define eax 0
#define ebx 1
......@@ -597,23 +588,25 @@ globalRegMaybe _ = Nothing
--
#if defined(mingw32_HOST_OS)
#if defined(mingw32_HOST_OS) && x86_64_TARGET_ARCH
allArgRegs = zip (map regSingle [rcx,rdx,r8,r9])
(map regSingle [firstxmm ..])
allIntArgRegs = panic "X86.Regs.allIntArgRegs: not defined for this platform"
allFPArgRegs = panic "X86.Regs.allFPArgRegs: not defined for this platform"
#elif i386_TARGET_ARCH
allArgRegs = panic "X86.Regs.allArgRegs: not defined for this arch"
allIntArgRegs = panic "X86.Regs.allIntArgRegs: should not be used!"
allFPArgRegs = map regSingle [firstxmm .. firstxmm+7]
#else
allArgRegs = panic "X86.Regs.allArgRegs: not defined for this arch"
# if i386_TARGET_ARCH
allIntArgRegs = panic "X86.Regs.allIntArgRegs: should not be used!"
# elif x86_64_TARGET_ARCH
allIntArgRegs = map regSingle [rdi,rsi,rdx,rcx,r8,r9]
# else
allIntArgRegs = panic "X86.Regs.allIntArgRegs: not defined for this arch"
# endif
allFPArgRegs = map regSingle [firstxmm .. firstxmm+7]
#endif
......@@ -628,7 +621,7 @@ allHaskellArgRegs = [ RegReal r | Just r <- map globalRegMaybe globalArgRegs ]
instrClobberedRegs :: [RealReg]
#if i386_TARGET_ARCH
instrClobberedRegs = map RealRegSingle [ eax, ecx, edx ]
#else
#elif x86_64_TARGET_ARCH
instrClobberedRegs = map RealRegSingle [ rax, rcx, rdx ]
#endif
......@@ -639,12 +632,35 @@ instrClobberedRegs = map RealRegSingle [ rax, rcx, rdx ]
callClobberedRegs
= map regSingle ([eax,ecx,edx] ++ floatregnos)
#else
#elif x86_64_TARGET_ARCH
-- all xmm regs are caller-saves
-- caller-saves registers
callClobberedRegs
= map regSingle ([rax,rcx,rdx,rsi,rdi,r8,r9,r10,r11] ++ floatregnos)
#else
callClobberedRegs
= panic "X86.Regs.callClobberedRegs: not defined for this architecture"
#endif
#else /* i386_TARGET_ARCH || x86_64_TARGET_ARCH */
freeReg _ = 0#
globalRegMaybe _ = panic "X86.Regs.globalRegMaybe: not defined"
allArgRegs = panic "X86.Regs.allArgRegs: not defined"
allIntArgRegs = panic "X86.Regs.allIntArgRegs: not defined"
allFPArgRegs = panic "X86.Regs.allFPArgRegs: not defined"
callClobberedRegs = panic "X86.Regs.callClobberedRegs: not defined"
instrClobberedRegs :: [RealReg]
instrClobberedRegs = panic "X86.Regs.instrClobberedRegs: not defined for this arch"
allHaskellArgRegs :: [Reg]
allHaskellArgRegs = panic "X86.Regs.allHaskellArgRegs: not defined for this arch"
#endif
-- allocatableRegs is allMachRegNos with the fixed-use regs removed.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment