Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
32f9ccef
Commit
32f9ccef
authored
Oct 19, 2016
by
Nicolas Capens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 64-bit pointer type for non-x32 ABIs.
BUG=swiftshader:9 Change-Id: Ife06416736d47acba4f2cff1ea8b17be61134752
parent
7145e693
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
52 additions
and
2 deletions
+52
-2
IceTargetLowering.cpp
src/IceTargetLowering.cpp
+14
-0
IceTargetLowering.h
src/IceTargetLowering.h
+1
-0
IceTargetLoweringARM32.cpp
src/IceTargetLoweringARM32.cpp
+4
-0
IceTargetLoweringARM32.h
src/IceTargetLoweringARM32.h
+2
-0
IceTargetLoweringMIPS32.cpp
src/IceTargetLoweringMIPS32.cpp
+5
-0
IceTargetLoweringMIPS32.h
src/IceTargetLoweringMIPS32.h
+1
-0
IceTargetLoweringX8632.cpp
src/IceTargetLoweringX8632.cpp
+5
-0
IceTargetLoweringX8664.cpp
src/IceTargetLoweringX8664.cpp
+4
-0
IceTargetLoweringX86Base.h
src/IceTargetLoweringX86Base.h
+1
-0
IceTargetLoweringX86BaseImpl.h
src/IceTargetLoweringX86BaseImpl.h
+11
-1
IceTypes.cpp
src/IceTypes.cpp
+3
-0
IceTypes.h
src/IceTypes.h
+1
-1
No files found.
src/IceTargetLowering.cpp
View file @
32f9ccef
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
createTargetHeaderLowering(::Ice::GlobalContext *Ctx); \
createTargetHeaderLowering(::Ice::GlobalContext *Ctx); \
void staticInit(::Ice::GlobalContext *Ctx); \
void staticInit(::Ice::GlobalContext *Ctx); \
bool shouldBePooled(const ::Ice::Constant *C); \
bool shouldBePooled(const ::Ice::Constant *C); \
::Ice::Type getPointerType(); \
} // end of namespace X
} // end of namespace X
#include "SZTargets.def"
#include "SZTargets.def"
#undef SUBZERO_TARGET
#undef SUBZERO_TARGET
...
@@ -298,6 +299,19 @@ bool TargetLowering::shouldBePooled(const Constant *C) {
...
@@ -298,6 +299,19 @@ bool TargetLowering::shouldBePooled(const Constant *C) {
}
}
}
}
::
Ice
::
Type
TargetLowering
::
getPointerType
()
{
const
TargetArch
Target
=
getFlags
().
getTargetArch
();
switch
(
Target
)
{
default
:
return
::
Ice
::
IceType_void
;
#define SUBZERO_TARGET(X) \
case TARGET_LOWERING_CLASS_FOR(X): \
return ::X::getPointerType();
#include "SZTargets.def"
#undef SUBZERO_TARGET
}
}
TargetLowering
::
SandboxType
TargetLowering
::
SandboxType
TargetLowering
::
determineSandboxTypeFromFlags
(
const
ClFlags
&
Flags
)
{
TargetLowering
::
determineSandboxTypeFromFlags
(
const
ClFlags
&
Flags
)
{
assert
(
!
Flags
.
getUseSandboxing
()
||
!
Flags
.
getUseNonsfi
());
assert
(
!
Flags
.
getUseSandboxing
()
||
!
Flags
.
getUseNonsfi
());
...
...
src/IceTargetLowering.h
View file @
32f9ccef
...
@@ -175,6 +175,7 @@ public:
...
@@ -175,6 +175,7 @@ public:
// Each target must define a public static method:
// Each target must define a public static method:
// static void staticInit(GlobalContext *Ctx);
// static void staticInit(GlobalContext *Ctx);
static
bool
shouldBePooled
(
const
class
Constant
*
C
);
static
bool
shouldBePooled
(
const
class
Constant
*
C
);
static
Type
getPointerType
();
static
std
::
unique_ptr
<
TargetLowering
>
createLowering
(
TargetArch
Target
,
static
std
::
unique_ptr
<
TargetLowering
>
createLowering
(
TargetArch
Target
,
Cfg
*
Func
);
Cfg
*
Func
);
...
...
src/IceTargetLoweringARM32.cpp
View file @
32f9ccef
...
@@ -66,6 +66,10 @@ bool shouldBePooled(const ::Ice::Constant *C) {
...
@@ -66,6 +66,10 @@ bool shouldBePooled(const ::Ice::Constant *C) {
return
::
Ice
::
ARM32
::
TargetARM32
::
shouldBePooled
(
C
);
return
::
Ice
::
ARM32
::
TargetARM32
::
shouldBePooled
(
C
);
}
}
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
ARM32
::
TargetARM32
::
getPointerType
();
}
}
// end of namespace ARM32
}
// end of namespace ARM32
namespace
Ice
{
namespace
Ice
{
...
...
src/IceTargetLoweringARM32.h
View file @
32f9ccef
...
@@ -68,6 +68,8 @@ public:
...
@@ -68,6 +68,8 @@ public:
return
false
;
return
false
;
}
}
static
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
IceType_i32
;
}
// TODO(jvoung): return a unique_ptr.
// TODO(jvoung): return a unique_ptr.
static
std
::
unique_ptr
<::
Ice
::
TargetLowering
>
create
(
Cfg
*
Func
)
{
static
std
::
unique_ptr
<::
Ice
::
TargetLowering
>
create
(
Cfg
*
Func
)
{
return
makeUnique
<
TargetARM32
>
(
Func
);
return
makeUnique
<
TargetARM32
>
(
Func
);
...
...
src/IceTargetLoweringMIPS32.cpp
View file @
32f9ccef
...
@@ -52,6 +52,11 @@ void staticInit(::Ice::GlobalContext *Ctx) {
...
@@ -52,6 +52,11 @@ void staticInit(::Ice::GlobalContext *Ctx) {
bool
shouldBePooled
(
const
::
Ice
::
Constant
*
C
)
{
bool
shouldBePooled
(
const
::
Ice
::
Constant
*
C
)
{
return
::
Ice
::
MIPS32
::
TargetMIPS32
::
shouldBePooled
(
C
);
return
::
Ice
::
MIPS32
::
TargetMIPS32
::
shouldBePooled
(
C
);
}
}
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
MIPS32
::
TargetMIPS32
::
getPointerType
();
}
}
// end of namespace MIPS32
}
// end of namespace MIPS32
namespace
Ice
{
namespace
Ice
{
...
...
src/IceTargetLoweringMIPS32.h
View file @
32f9ccef
...
@@ -43,6 +43,7 @@ public:
...
@@ -43,6 +43,7 @@ public:
}
}
return
false
;
return
false
;
}
}
static
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
IceType_i32
;
}
static
std
::
unique_ptr
<::
Ice
::
TargetLowering
>
create
(
Cfg
*
Func
)
{
static
std
::
unique_ptr
<::
Ice
::
TargetLowering
>
create
(
Cfg
*
Func
)
{
return
makeUnique
<
TargetMIPS32
>
(
Func
);
return
makeUnique
<
TargetMIPS32
>
(
Func
);
}
}
...
...
src/IceTargetLoweringX8632.cpp
View file @
32f9ccef
...
@@ -48,6 +48,11 @@ void staticInit(::Ice::GlobalContext *Ctx) {
...
@@ -48,6 +48,11 @@ void staticInit(::Ice::GlobalContext *Ctx) {
bool
shouldBePooled
(
const
class
::
Ice
::
Constant
*
C
)
{
bool
shouldBePooled
(
const
class
::
Ice
::
Constant
*
C
)
{
return
::
Ice
::
X8632
::
TargetX8632
::
shouldBePooled
(
C
);
return
::
Ice
::
X8632
::
TargetX8632
::
shouldBePooled
(
C
);
}
}
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
X8632
::
TargetX8632
::
getPointerType
();
}
}
// end of namespace X8632
}
// end of namespace X8632
namespace
Ice
{
namespace
Ice
{
...
...
src/IceTargetLoweringX8664.cpp
View file @
32f9ccef
...
@@ -41,6 +41,10 @@ bool shouldBePooled(const class ::Ice::Constant *C) {
...
@@ -41,6 +41,10 @@ bool shouldBePooled(const class ::Ice::Constant *C) {
return
::
Ice
::
X8664
::
TargetX8664
::
shouldBePooled
(
C
);
return
::
Ice
::
X8664
::
TargetX8664
::
shouldBePooled
(
C
);
}
}
::
Ice
::
Type
getPointerType
()
{
return
::
Ice
::
X8664
::
TargetX8664
::
getPointerType
();
}
}
// end of namespace X8664
}
// end of namespace X8664
namespace
Ice
{
namespace
Ice
{
...
...
src/IceTargetLoweringX86Base.h
View file @
32f9ccef
...
@@ -79,6 +79,7 @@ public:
...
@@ -79,6 +79,7 @@ public:
static
void
staticInit
(
GlobalContext
*
Ctx
);
static
void
staticInit
(
GlobalContext
*
Ctx
);
static
bool
shouldBePooled
(
const
Constant
*
C
);
static
bool
shouldBePooled
(
const
Constant
*
C
);
static
::
Ice
::
Type
getPointerType
();
static
FixupKind
getPcRelFixup
()
{
return
PcRelFixup
;
}
static
FixupKind
getPcRelFixup
()
{
return
PcRelFixup
;
}
static
FixupKind
getAbsFixup
()
{
return
AbsFixup
;
}
static
FixupKind
getAbsFixup
()
{
return
AbsFixup
;
}
...
...
src/IceTargetLoweringX86BaseImpl.h
View file @
32f9ccef
...
@@ -430,6 +430,16 @@ bool TargetX86Base<TraitsType>::shouldBePooled(const Constant *C) {
...
@@ -430,6 +430,16 @@ bool TargetX86Base<TraitsType>::shouldBePooled(const Constant *C) {
return
C
->
shouldBeRandomizedOrPooled
();
return
C
->
shouldBeRandomizedOrPooled
();
}
}
template
<
typename
TraitsType
>
::
Ice
::
Type
TargetX86Base
<
TraitsType
>::
getPointerType
()
{
if
(
!
Traits
::
Is64Bit
||
::
Ice
::
getFlags
().
getApplicationBinaryInterface
()
==
::
Ice
::
ABI_PNaCl
)
{
return
::
Ice
::
IceType_i32
;
}
else
{
return
::
Ice
::
IceType_i64
;
}
}
template
<
typename
TraitsType
>
void
TargetX86Base
<
TraitsType
>::
translateO2
()
{
template
<
typename
TraitsType
>
void
TargetX86Base
<
TraitsType
>::
translateO2
()
{
TimerMarker
T
(
TimerStack
::
TT_O2
,
Func
);
TimerMarker
T
(
TimerStack
::
TT_O2
,
Func
);
...
@@ -7456,7 +7466,7 @@ TargetX86Base<TraitsType>::getMemoryOperandForStackSlot(Type Ty, Variable *Slot,
...
@@ -7456,7 +7466,7 @@ TargetX86Base<TraitsType>::getMemoryOperandForStackSlot(Type Ty, Variable *Slot,
// TODO(wala,stichnot): lea should not
// TODO(wala,stichnot): lea should not
// be required. The address of the stack slot is known at compile time
// be required. The address of the stack slot is known at compile time
// (although not until after addProlog()).
// (although not until after addProlog()).
const
expr
Type
PointerType
=
IceType_i32
;
const
Type
PointerType
=
getPointerType
()
;
Variable
*
Loc
=
makeReg
(
PointerType
);
Variable
*
Loc
=
makeReg
(
PointerType
);
_lea
(
Loc
,
Slot
);
_lea
(
Loc
,
Slot
);
Constant
*
ConstantOffset
=
Ctx
->
getConstantInt32
(
Offset
);
Constant
*
ConstantOffset
=
Ctx
->
getConstantInt32
(
Offset
);
...
...
src/IceTypes.cpp
View file @
32f9ccef
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include "IceTypes.h"
#include "IceTypes.h"
#include "IceDefs.h"
#include "IceDefs.h"
#include "IceTargetLowering.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorHandling.h"
...
@@ -176,6 +177,8 @@ Type typeElementType(Type Ty) {
...
@@ -176,6 +177,8 @@ Type typeElementType(Type Ty) {
return
IceType_void
;
return
IceType_void
;
}
}
Type
getPointerType
()
{
return
TargetLowering
::
getPointerType
();
}
bool
isVectorType
(
Type
Ty
)
{
bool
isVectorType
(
Type
Ty
)
{
if
(
Ty
<
IceType_NUM
)
if
(
Ty
<
IceType_NUM
)
return
TypePropertiesTable
[
Ty
].
TypeIsVectorType
;
return
TypePropertiesTable
[
Ty
].
TypeIsVectorType
;
...
...
src/IceTypes.h
View file @
32f9ccef
...
@@ -85,7 +85,7 @@ const char *typeString(Type Ty);
...
@@ -85,7 +85,7 @@ const char *typeString(Type Ty);
inline
std
::
string
typeStdString
(
Type
Ty
)
{
return
typeString
(
Ty
);
}
inline
std
::
string
typeStdString
(
Type
Ty
)
{
return
typeString
(
Ty
);
}
const
char
*
regClassString
(
RegClass
C
);
const
char
*
regClassString
(
RegClass
C
);
inline
Type
getPointerType
()
{
return
IceType_i32
;
}
Type
getPointerType
();
bool
isVectorType
(
Type
Ty
);
bool
isVectorType
(
Type
Ty
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment