mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-05 11:18:48 +00:00
c80aad901b
According to the SystemZ ABI, 128-bit integer types should be passed and returned via implicit reference. However, this is not currently implemented at the LLVM IR level for the i128 type. This does not matter when compiling C/C++ code, since clang will implement the implicit reference itself. However, it turns out that when calling libgcc helper routines operating on 128-bit integers, LLVM will use i128 argument and return value types; the resulting code is not compatible with the ABI used in libgcc, leading to crashes (see PR26559). This should be simple to fix, except that i128 currently is not even a legal type for the SystemZ back end. Therefore, common code will already split arguments and return values into multiple parts. The bulk of this patch therefore consists of detecting such parts, and correctly handling passing via implicit reference of a value split into multiple parts. If at some time in the future, i128 becomes a legal type, this code can be removed again. This fixes PR26559. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261325 91177308-0d34-0410-b5e6-96231b3b80d8
22 lines
682 B
C++
22 lines
682 B
C++
//===-- SystemZCallingConv.cpp - Calling conventions for SystemZ ----------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "SystemZCallingConv.h"
|
|
#include "SystemZRegisterInfo.h"
|
|
|
|
using namespace llvm;
|
|
|
|
const MCPhysReg SystemZ::ArgGPRs[SystemZ::NumArgGPRs] = {
|
|
SystemZ::R2D, SystemZ::R3D, SystemZ::R4D, SystemZ::R5D, SystemZ::R6D
|
|
};
|
|
|
|
const MCPhysReg SystemZ::ArgFPRs[SystemZ::NumArgFPRs] = {
|
|
SystemZ::F0D, SystemZ::F2D, SystemZ::F4D, SystemZ::F6D
|
|
};
|