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
d9dc82e4
Commit
d9dc82e4
authored
Mar 03, 2015
by
Jim Stichnoth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subzero: Rerun clang-format after LLVM 3.6 merge.
BUG= none R=jvoung@chromium.org Review URL:
https://codereview.chromium.org/974113002
parent
a67fc448
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
170 additions
and
207 deletions
+170
-207
test_arith_main.cpp
crosstest/test_arith_main.cpp
+10
-10
test_bitmanip_main.cpp
crosstest/test_bitmanip_main.cpp
+15
-28
test_calling_conv_main.cpp
crosstest/test_calling_conv_main.cpp
+4
-4
test_cast_main.cpp
crosstest/test_cast_main.cpp
+10
-20
test_fcmp_main.cpp
crosstest/test_fcmp_main.cpp
+4
-4
test_global.cpp
crosstest/test_global.cpp
+13
-13
test_icmp_main.cpp
crosstest/test_icmp_main.cpp
+11
-11
test_sync_atomic_main.cpp
crosstest/test_sync_atomic_main.cpp
+15
-25
IceELFObjectWriter.cpp
src/IceELFObjectWriter.cpp
+1
-1
IceInst.cpp
src/IceInst.cpp
+4
-4
IceInstX8632.cpp
src/IceInstX8632.cpp
+6
-6
IceIntrinsics.cpp
src/IceIntrinsics.cpp
+69
-72
IceTargetLoweringX8632.cpp
src/IceTargetLoweringX8632.cpp
+6
-6
main.cpp
src/main.cpp
+2
-3
No files found.
crosstest/test_arith_main.cpp
View file @
d9dc82e4
...
@@ -64,14 +64,14 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -64,14 +64,14 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(inst, op, isdiv, isshift) \
#define X(inst, op, isdiv, isshift) \
{ STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv } \
{ STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv } \
,
,
UINTOP_TABLE
UINTOP_TABLE
#undef X
#undef X
#define X(inst, op, isdiv, isshift) \
#define X(inst, op, isdiv, isshift) \
{ STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv } \
{ STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv } \
,
,
SINTOP_TABLE
SINTOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
if
(
sizeof
(
TypeUnsigned
)
<=
sizeof
(
uint32_t
))
{
if
(
sizeof
(
TypeUnsigned
)
<=
sizeof
(
uint32_t
))
{
...
@@ -177,14 +177,14 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -177,14 +177,14 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(inst, op, isdiv, isshift) \
#define X(inst, op, isdiv, isshift) \
{ STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv, isshift } \
{ STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv, isshift } \
,
,
UINTOP_TABLE
UINTOP_TABLE
#undef X
#undef X
#define X(inst, op, isdiv, isshift) \
#define X(inst, op, isdiv, isshift) \
{ STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv, isshift } \
{ STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv, isshift } \
,
,
SINTOP_TABLE
SINTOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumElementsInType
=
Vectors
<
TypeUnsigned
>::
NumElements
;
const
static
size_t
NumElementsInType
=
Vectors
<
TypeUnsigned
>::
NumElements
;
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
@@ -247,9 +247,9 @@ void testsFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -247,9 +247,9 @@ void testsFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(inst, op, func) \
#define X(inst, op, func) \
{ STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst } \
{ STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst } \
,
,
FPOP_TABLE
FPOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
@@ -306,9 +306,9 @@ void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -306,9 +306,9 @@ void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(inst, op, func) \
#define X(inst, op, func) \
{ STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst } \
{ STR(inst), (FuncType)test##inst, (FuncType)Subzero_::test##inst } \
,
,
FPOP_TABLE
FPOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumElementsInType
=
4
;
const
static
size_t
NumElementsInType
=
4
;
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
...
crosstest/test_bitmanip_main.cpp
View file @
d9dc82e4
...
@@ -28,31 +28,18 @@ namespace Subzero_ {
...
@@ -28,31 +28,18 @@ namespace Subzero_ {
}
}
volatile
uint64_t
Values
[]
=
{
volatile
uint64_t
Values
[]
=
{
0
,
1
,
0
,
1
,
0x7e
,
0x7f
,
0x80
,
0x81
,
0xfe
,
0xff
,
0x7ffe
,
0x7fff
,
0x8000
,
0x8001
,
0x7e
,
0x7f
,
0xfffe
,
0xffff
,
0xc0de
,
0xabcd
,
0xdcba
,
0x007fffff
/*Max subnormal + */
,
0x80
,
0x81
,
0x00800000
/*Min+ */
,
0x7f7fffff
/*Max+ */
,
0x7f800000
/*+Inf*/
,
0xfe
,
0xff
,
0xff800000
/*-Inf*/
,
0x7fa00000
/*SNaN*/
,
0x7fc00000
/*QNaN*/
,
0x7ffffffe
,
0x7ffe
,
0x7fff
,
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x12345678
,
0x8000
,
0x8001
,
0xabcd1234
,
0x1234dcba
,
0x100000000ll
,
0x100000001ll
,
0x123456789abcdef1ll
,
0xfffe
,
0xffff
,
0x987654321ab1fedcll
,
0x000fffffffffffffll
/*Max subnormal + */
,
0xc0de
,
0xabcd
,
0xdcba
,
0x007fffff
/*Max subnormal + */
,
0x00800000
/*Min+ */
,
0x7f7fffff
/*Max+ */
,
0x7f800000
/*+Inf*/
,
0xff800000
/*-Inf*/
,
0x7fa00000
/*SNaN*/
,
0x7fc00000
/*QNaN*/
,
0x7ffffffe
,
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x12345678
,
0xabcd1234
,
0x1234dcba
,
0x100000000ll
,
0x100000001ll
,
0x123456789abcdef1ll
,
0x987654321ab1fedcll
,
0x000fffffffffffffll
/*Max subnormal + */
,
0x0010000000000000ll
/*Min+ */
,
0x7fefffffffffffffll
/*Max+ */
,
0x0010000000000000ll
/*Min+ */
,
0x7fefffffffffffffll
/*Max+ */
,
0x7ff0000000000000ll
/*+Inf*/
,
0xfff0000000000000ll
/*-Inf*/
,
0x7ff0000000000000ll
/*+Inf*/
,
0xfff0000000000000ll
/*-Inf*/
,
0x7ff0000000000001ll
/*SNaN*/
,
0x7ff8000000000000ll
/*QNaN*/
,
0x7ff0000000000001ll
/*SNaN*/
,
0x7ff8000000000000ll
/*QNaN*/
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x8000000000000000ll
,
0x8000000000000000ll
,
0x8000000000000001ll
,
0x8000000000000001ll
,
0xfffffffffffffffell
,
0xffffffffffffffffll
};
0xfffffffffffffffell
,
0xffffffffffffffffll
};
const
static
size_t
NumValues
=
sizeof
(
Values
)
/
sizeof
(
*
Values
);
const
static
size_t
NumValues
=
sizeof
(
Values
)
/
sizeof
(
*
Values
);
...
@@ -68,9 +55,9 @@ void testBitManip(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -68,9 +55,9 @@ void testBitManip(size_t &TotalTests, size_t &Passes, size_t &Failures) {
{ STR(inst), test_##inst, Subzero_::test_##inst } \
{ STR(inst), test_##inst, Subzero_::test_##inst } \
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst}, \
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst}, \
{STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
{STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
BMI_OPS
BMI_OPS
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
@@ -100,8 +87,8 @@ void testByteSwap(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -100,8 +87,8 @@ void testByteSwap(size_t &TotalTests, size_t &Passes, size_t &Failures) {
FuncType
FuncLlc
;
FuncType
FuncLlc
;
FuncType
FuncSz
;
FuncType
FuncSz
;
}
Funcs
[]
=
{
}
Funcs
[]
=
{
{
"bswap"
,
test_bswap
,
Subzero_
::
test_bswap
},
{
"bswap"
,
test_bswap
,
Subzero_
::
test_bswap
},
{
"bswap_alloca"
,
test_bswap_alloca
,
Subzero_
::
test_bswap_alloca
}};
{
"bswap_alloca"
,
test_bswap_alloca
,
Subzero_
::
test_bswap_alloca
}};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
i
=
0
;
i
<
NumValues
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
NumValues
;
++
i
)
{
...
...
crosstest/test_calling_conv_main.cpp
View file @
d9dc82e4
...
@@ -75,9 +75,9 @@ void testCaller(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -75,9 +75,9 @@ void testCaller(size_t &TotalTests, size_t &Passes, size_t &Failures) {
reinterpret_cast<CalleePtrTy>(&callee), \
reinterpret_cast<CalleePtrTy>(&callee), \
} \
} \
,
,
TEST_FUNC_TABLE
TEST_FUNC_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
...
@@ -125,9 +125,9 @@ void testCallee(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -125,9 +125,9 @@ void testCallee(size_t &TotalTests, size_t &Passes, size_t &Failures) {
reinterpret_cast<CalleePtrTy>(&Subzero_::callee) \
reinterpret_cast<CalleePtrTy>(&Subzero_::callee) \
} \
} \
,
,
TEST_FUNC_TABLE
TEST_FUNC_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
...
...
crosstest/test_cast_main.cpp
View file @
d9dc82e4
...
@@ -148,29 +148,19 @@ int main(int argc, char **argv) {
...
@@ -148,29 +148,19 @@ int main(int argc, char **argv) {
static
const
size_t
NumValsSi32
=
sizeof
(
ValsSi32
)
/
sizeof
(
*
ValsSi32
);
static
const
size_t
NumValsSi32
=
sizeof
(
ValsSi32
)
/
sizeof
(
*
ValsSi32
);
volatile
uint64_t
ValsUi64
[]
=
{
volatile
uint64_t
ValsUi64
[]
=
{
0
,
1
,
0x7e
,
0
,
1
,
0x7e
,
0x7f
,
0x80
,
0x81
,
0xfe
,
0xff
,
0x7ffe
,
0x7fff
,
0x8000
,
0x8001
,
0x7f
,
0x80
,
0x81
,
0xfffe
,
0xffff
,
0x7ffffffe
,
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfe
,
0xff
,
0x7ffe
,
0xfffffffe
,
0xffffffff
,
0x100000000ull
,
0x100000001ull
,
0x7fff
,
0x8000
,
0x8001
,
0x7ffffffffffffffeull
,
0x7fffffffffffffffull
,
0x8000000000000000ull
,
0xfffe
,
0xffff
,
0x7ffffffe
,
0x8000000000000001ull
,
0xfffffffffffffffeull
,
0xffffffffffffffffull
};
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x100000000ull
,
0x100000001ull
,
0x7ffffffffffffffeull
,
0x7fffffffffffffffull
,
0x8000000000000000ull
,
0x8000000000000001ull
,
0xfffffffffffffffeull
,
0xffffffffffffffffull
};
static
const
size_t
NumValsUi64
=
sizeof
(
ValsUi64
)
/
sizeof
(
*
ValsUi64
);
static
const
size_t
NumValsUi64
=
sizeof
(
ValsUi64
)
/
sizeof
(
*
ValsUi64
);
volatile
int64_t
ValsSi64
[]
=
{
volatile
int64_t
ValsSi64
[]
=
{
0
,
1
,
0x7e
,
0
,
1
,
0x7e
,
0x7f
,
0x80
,
0x81
,
0xfe
,
0xff
,
0x7ffe
,
0x7fff
,
0x8000
,
0x8001
,
0x7f
,
0x80
,
0x81
,
0xfffe
,
0xffff
,
0x7ffffffe
,
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfe
,
0xff
,
0x7ffe
,
0xfffffffe
,
0xffffffff
,
0x100000000ll
,
0x100000001ll
,
0x7fff
,
0x8000
,
0x8001
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x8000000000000000ll
,
0xfffe
,
0xffff
,
0x7ffffffe
,
0x8000000000000001ll
,
0xfffffffffffffffell
,
0xffffffffffffffffll
};
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x100000000ll
,
0x100000001ll
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x8000000000000000ll
,
0x8000000000000001ll
,
0xfffffffffffffffell
,
0xffffffffffffffffll
};
static
const
size_t
NumValsSi64
=
sizeof
(
ValsSi64
)
/
sizeof
(
*
ValsSi64
);
static
const
size_t
NumValsSi64
=
sizeof
(
ValsSi64
)
/
sizeof
(
*
ValsSi64
);
static
const
double
NegInf
=
-
1.0
/
0.0
;
static
const
double
NegInf
=
-
1.0
/
0.0
;
...
...
crosstest/test_fcmp_main.cpp
View file @
d9dc82e4
...
@@ -72,9 +72,9 @@ void testsScalar(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -72,9 +72,9 @@ void testsScalar(size_t &TotalTests, size_t &Passes, size_t &Failures) {
Subzero_fcmp##cmp##Double, fcmp##cmp##Double \
Subzero_fcmp##cmp##Double, fcmp##cmp##Double \
} \
} \
,
,
FCMP_TABLE
FCMP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
bool
ResultSz
,
ResultLlc
;
bool
ResultSz
,
ResultLlc
;
...
@@ -125,9 +125,9 @@ void testsVector(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -125,9 +125,9 @@ void testsVector(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(cmp) \
#define X(cmp) \
{ "fcmp" STR(cmp), Subzero_fcmp##cmp##Vector, fcmp##cmp##Vector } \
{ "fcmp" STR(cmp), Subzero_fcmp##cmp##Vector, fcmp##cmp##Vector } \
,
,
FCMP_TABLE
FCMP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumElementsInType
=
4
;
const
static
size_t
NumElementsInType
=
4
;
const
static
size_t
MaxTestsPerFunc
=
100000
;
const
static
size_t
MaxTestsPerFunc
=
100000
;
...
...
crosstest/test_global.cpp
View file @
d9dc82e4
...
@@ -43,12 +43,12 @@ static struct {
...
@@ -43,12 +43,12 @@ static struct {
}
NestedStuff
;
}
NestedStuff
;
uint8_t
*
Pointer5
;
uint8_t
*
Pointer5
;
}
StructEx
=
{
}
StructEx
=
{
{
10
,
20
,
30
,
40
,
50
},
{
10
,
20
,
30
,
40
,
50
},
ExternName1
,
ExternName1
,
{
0.5
,
1.5
,
2.5
},
{
0.5
,
1.5
,
2.5
},
ExternName4
,
ExternName4
,
{
ExternName3
,
{
1000
,
1010
,
1020
},
ExternName2
},
{
ExternName3
,
{
1000
,
1010
,
1020
},
ExternName2
},
ExternName5
,
ExternName5
,
};
};
#define ARRAY(a) \
#define ARRAY(a) \
...
@@ -61,13 +61,13 @@ struct {
...
@@ -61,13 +61,13 @@ struct {
uint8_t
*
ArrayAddress
;
uint8_t
*
ArrayAddress
;
size_t
ArraySizeInBytes
;
size_t
ArraySizeInBytes
;
}
Arrays
[]
=
{
}
Arrays
[]
=
{
ARRAY
(
ArrayInitPartial
),
ARRAY
(
ArrayInitPartial
),
ARRAY
(
ArrayInitFull
),
ARRAY
(
ArrayInitFull
),
ARRAY
(
ArrayConst
),
ARRAY
(
ArrayConst
),
ARRAY
(
ArrayDouble
),
ARRAY
(
ArrayDouble
),
{(
uint8_t
*
)(
ArrayInitPartial
+
2
),
{(
uint8_t
*
)(
ArrayInitPartial
+
2
),
sizeof
(
ArrayInitPartial
)
-
2
*
sizeof
(
int
)},
sizeof
(
ArrayInitPartial
)
-
2
*
sizeof
(
int
)},
{(
uint8_t
*
)(
&
StructEx
),
sizeof
(
StructEx
)},
{(
uint8_t
*
)(
&
StructEx
),
sizeof
(
StructEx
)},
};
};
size_t
NumArraysElements
=
sizeof
(
Arrays
)
/
sizeof
(
*
Arrays
);
size_t
NumArraysElements
=
sizeof
(
Arrays
)
/
sizeof
(
*
Arrays
);
...
...
crosstest/test_icmp_main.cpp
View file @
d9dc82e4
...
@@ -50,17 +50,17 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -50,17 +50,17 @@ void testsInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
(FuncTypeUnsigned)Subzero_::icmp##cmp \
(FuncTypeUnsigned)Subzero_::icmp##cmp \
} \
} \
,
,
ICMP_U_TABLE
ICMP_U_TABLE
#undef X
#undef X
#define X(cmp, op) \
#define X(cmp, op) \
{ \
{ \
STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)
icmp##cmp,
\
STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)
icmp##cmp,
\
(FuncTypeUnsigned)(FuncTypeSigned)
Subzero_::icmp##cmp
\
(FuncTypeUnsigned)(FuncTypeSigned)
Subzero_::icmp##cmp
\
} \
} \
,
,
ICMP_S_TABLE
ICMP_S_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
if
(
sizeof
(
TypeUnsigned
)
<=
sizeof
(
uint32_t
))
{
if
(
sizeof
(
TypeUnsigned
)
<=
sizeof
(
uint32_t
))
{
...
@@ -137,17 +137,17 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -137,17 +137,17 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
(FuncTypeUnsigned)Subzero_::icmp##cmp \
(FuncTypeUnsigned)Subzero_::icmp##cmp \
} \
} \
,
,
ICMP_U_TABLE
ICMP_U_TABLE
#undef X
#undef X
#define X(cmp, op) \
#define X(cmp, op) \
{ \
{ \
STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)
icmp##cmp,
\
STR(cmp), (FuncTypeUnsigned)(FuncTypeSigned)
icmp##cmp,
\
(FuncTypeUnsigned)(FuncTypeSigned)
Subzero_::icmp##cmp
\
(FuncTypeUnsigned)(FuncTypeSigned)
Subzero_::icmp##cmp
\
} \
} \
,
,
ICMP_S_TABLE
ICMP_S_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumElementsInType
=
Vectors
<
TypeUnsigned
>::
NumElements
;
const
static
size_t
NumElementsInType
=
Vectors
<
TypeUnsigned
>::
NumElements
;
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
@@ -206,7 +206,7 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) {
...
@@ -206,7 +206,7 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) {
#define X(cmp, op) \
#define X(cmp, op) \
{ STR(cmp), (FuncType)icmpi1##cmp, (FuncType)Subzero_::icmpi1##cmp } \
{ STR(cmp), (FuncType)icmpi1##cmp, (FuncType)Subzero_::icmpi1##cmp } \
,
,
ICMP_U_TABLE
ICMP_S_TABLE
};
ICMP_U_TABLE
ICMP_S_TABLE
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumElements
=
Vectors
<
T
>::
NumElements
;
const
static
size_t
NumElements
=
Vectors
<
T
>::
NumElements
;
const
static
size_t
MAX_NUMBER_OF_ELEMENTS_FOR_EXHAUSTIVE_TESTING
=
8
;
const
static
size_t
MAX_NUMBER_OF_ELEMENTS_FOR_EXHAUSTIVE_TESTING
=
8
;
...
...
crosstest/test_sync_atomic_main.cpp
View file @
d9dc82e4
...
@@ -33,27 +33,17 @@ namespace Subzero_ {
...
@@ -33,27 +33,17 @@ namespace Subzero_ {
}
}
volatile
uint64_t
Values
[]
=
{
volatile
uint64_t
Values
[]
=
{
0
,
1
,
0
,
1
,
0x7e
,
0x7f
,
0x80
,
0x81
,
0xfe
,
0xff
,
0x7ffe
,
0x7fff
,
0x8000
,
0x8001
,
0x7e
,
0x7f
,
0xfffe
,
0xffff
,
0x007fffff
/*Max subnormal + */
,
0x00800000
/*Min+ */
,
0x80
,
0x81
,
0x7f7fffff
/*Max+ */
,
0x7f800000
/*+Inf*/
,
0xff800000
/*-Inf*/
,
0xfe
,
0xff
,
0x7fa00000
/*SNaN*/
,
0x7fc00000
/*QNaN*/
,
0x7ffffffe
,
0x7fffffff
,
0x7ffe
,
0x7fff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x100000000ll
,
0x8000
,
0x8001
,
0x100000001ll
,
0x000fffffffffffffll
/*Max subnormal + */
,
0xfffe
,
0xffff
,
0x0010000000000000ll
/*Min+ */
,
0x7fefffffffffffffll
/*Max+ */
,
0x007fffff
/*Max subnormal + */
,
0x00800000
/*Min+ */
,
0x7ff0000000000000ll
/*+Inf*/
,
0xfff0000000000000ll
/*-Inf*/
,
0x7f7fffff
/*Max+ */
,
0x7f800000
/*+Inf*/
,
0x7ff0000000000001ll
/*SNaN*/
,
0x7ff8000000000000ll
/*QNaN*/
,
0xff800000
/*-Inf*/
,
0x7fa00000
/*SNaN*/
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x8000000000000000ll
,
0x7fc00000
/*QNaN*/
,
0x7ffffffe
,
0x8000000000000001ll
,
0xfffffffffffffffell
,
0xffffffffffffffffll
};
0x7fffffff
,
0x80000000
,
0x80000001
,
0xfffffffe
,
0xffffffff
,
0x100000000ll
,
0x100000001ll
,
0x000fffffffffffffll
/*Max subnormal + */
,
0x0010000000000000ll
/*Min+ */
,
0x7fefffffffffffffll
/*Max+ */
,
0x7ff0000000000000ll
/*+Inf*/
,
0xfff0000000000000ll
/*-Inf*/
,
0x7ff0000000000001ll
/*SNaN*/
,
0x7ff8000000000000ll
/*QNaN*/
,
0x7ffffffffffffffell
,
0x7fffffffffffffffll
,
0x8000000000000000ll
,
0x8000000000000001ll
,
0xfffffffffffffffell
,
0xffffffffffffffffll
};
const
static
size_t
NumValues
=
sizeof
(
Values
)
/
sizeof
(
*
Values
);
const
static
size_t
NumValues
=
sizeof
(
Values
)
/
sizeof
(
*
Values
);
...
@@ -77,9 +67,9 @@ void testAtomicRMW(volatile Type *AtomicLoc, size_t &TotalTests, size_t &Passes,
...
@@ -77,9 +67,9 @@ void testAtomicRMW(volatile Type *AtomicLoc, size_t &TotalTests, size_t &Passes,
{ STR(inst), test_##inst, Subzero_::test_##inst } \
{ STR(inst), test_##inst, Subzero_::test_##inst } \
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst}, \
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst}, \
{STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
{STR(inst) "_const", test_const_##inst, Subzero_::test_const_##inst},
RMWOP_TABLE
RMWOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
for
(
size_t
f
=
0
;
f
<
NumFuncs
;
++
f
)
{
...
@@ -188,9 +178,9 @@ void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
...
@@ -188,9 +178,9 @@ void testAtomicRMWThreads(volatile Type *AtomicLoc, size_t &TotalTests,
#define X(inst) \
#define X(inst) \
{ STR(inst), test_##inst, Subzero_::test_##inst } \
{ STR(inst), test_##inst, Subzero_::test_##inst } \
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst},
, {STR(inst) "_alloca", test_alloca_##inst, Subzero_::test_alloca_##inst},
RMWOP_TABLE
RMWOP_TABLE
#undef X
#undef X
};
};
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
const
static
size_t
NumFuncs
=
sizeof
(
Funcs
)
/
sizeof
(
*
Funcs
);
// Just test a few values, otherwise it takes a *really* long time.
// Just test a few values, otherwise it takes a *really* long time.
...
...
src/IceELFObjectWriter.cpp
View file @
d9dc82e4
...
@@ -36,7 +36,7 @@ struct {
...
@@ -36,7 +36,7 @@ struct {
#define X(tag, str, is_elf64, e_machine, e_flags) \
#define X(tag, str, is_elf64, e_machine, e_flags) \
{ is_elf64, e_machine, e_flags } \
{ is_elf64, e_machine, e_flags } \
,
,
TARGETARCH_TABLE
TARGETARCH_TABLE
#undef X
#undef X
};
};
...
...
src/IceInst.cpp
View file @
d9dc82e4
...
@@ -30,7 +30,7 @@ const struct InstArithmeticAttributes_ {
...
@@ -30,7 +30,7 @@ const struct InstArithmeticAttributes_ {
#define X(tag, str, commutative) \
#define X(tag, str, commutative) \
{ str, commutative } \
{ str, commutative } \
,
,
ICEINSTARITHMETIC_TABLE
ICEINSTARITHMETIC_TABLE
#undef X
#undef X
};
};
...
@@ -41,7 +41,7 @@ const struct InstCastAttributes_ {
...
@@ -41,7 +41,7 @@ const struct InstCastAttributes_ {
#define X(tag, str) \
#define X(tag, str) \
{ str } \
{ str } \
,
,
ICEINSTCAST_TABLE
ICEINSTCAST_TABLE
#undef X
#undef X
};
};
...
@@ -52,7 +52,7 @@ const struct InstFcmpAttributes_ {
...
@@ -52,7 +52,7 @@ const struct InstFcmpAttributes_ {
#define X(tag, str) \
#define X(tag, str) \
{ str } \
{ str } \
,
,
ICEINSTFCMP_TABLE
ICEINSTFCMP_TABLE
#undef X
#undef X
};
};
...
@@ -63,7 +63,7 @@ const struct InstIcmpAttributes_ {
...
@@ -63,7 +63,7 @@ const struct InstIcmpAttributes_ {
#define X(tag, str) \
#define X(tag, str) \
{ str } \
{ str } \
,
,
ICEINSTICMP_TABLE
ICEINSTICMP_TABLE
#undef X
#undef X
};
};
...
...
src/IceInstX8632.cpp
View file @
d9dc82e4
...
@@ -34,7 +34,7 @@ const struct InstX8632BrAttributes_ {
...
@@ -34,7 +34,7 @@ const struct InstX8632BrAttributes_ {
#define X(tag, encode, opp, dump, emit) \
#define X(tag, encode, opp, dump, emit) \
{ CondX86::opp, dump, emit } \
{ CondX86::opp, dump, emit } \
,
,
ICEINSTX8632BR_TABLE
ICEINSTX8632BR_TABLE
#undef X
#undef X
};
};
...
@@ -44,7 +44,7 @@ const struct InstX8632CmppsAttributes_ {
...
@@ -44,7 +44,7 @@ const struct InstX8632CmppsAttributes_ {
#define X(tag, emit) \
#define X(tag, emit) \
{ emit } \
{ emit } \
,
,
ICEINSTX8632CMPPS_TABLE
ICEINSTX8632CMPPS_TABLE
#undef X
#undef X
};
};
...
@@ -58,7 +58,7 @@ const struct TypeX8632Attributes_ {
...
@@ -58,7 +58,7 @@ const struct TypeX8632Attributes_ {
#define X(tag, elementty, cvt, sdss, pack, width, fld) \
#define X(tag, elementty, cvt, sdss, pack, width, fld) \
{ cvt, sdss, pack, width, fld } \
{ cvt, sdss, pack, width, fld } \
,
,
ICETYPEX8632_TABLE
ICETYPEX8632_TABLE
#undef X
#undef X
};
};
...
@@ -1256,9 +1256,9 @@ void emitVariableBlendInst(const char *Opcode, const Inst *Inst,
...
@@ -1256,9 +1256,9 @@ void emitVariableBlendInst(const char *Opcode, const Inst *Inst,
Inst
->
getDest
()
->
emit
(
Func
);
Inst
->
getDest
()
->
emit
(
Func
);
}
}
void
void
emitIASVariableBlendInst
(
emitIASVariableBlendInst
(
const
Inst
*
Inst
,
const
Cfg
*
Func
,
const
Inst
*
Inst
,
const
Cfg
*
Func
,
const
x86
::
AssemblerX86
::
XmmEmitterRegOp
&
Emitter
)
{
const
x86
::
AssemblerX86
::
XmmEmitterRegOp
&
Emitter
)
{
assert
(
Inst
->
getSrcSize
()
==
3
);
assert
(
Inst
->
getSrcSize
()
==
3
);
assert
(
llvm
::
cast
<
Variable
>
(
Inst
->
getSrc
(
2
))
->
getRegNum
()
==
assert
(
llvm
::
cast
<
Variable
>
(
Inst
->
getSrc
(
2
))
->
getRegNum
()
==
RegX8632
::
Reg_xmm0
);
RegX8632
::
Reg_xmm0
);
...
...
src/IceIntrinsics.cpp
View file @
d9dc82e4
...
@@ -51,24 +51,22 @@ const struct IceIntrinsicsEntry_ {
...
@@ -51,24 +51,22 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "nacl.atomic.cmpxchg." NameSuffix \
, "nacl.atomic.cmpxchg." NameSuffix \
}
}
AtomicCmpxchgInit
(
IceType_i8
,
"i8"
),
AtomicCmpxchgInit
(
IceType_i8
,
"i8"
),
AtomicCmpxchgInit
(
IceType_i16
,
"i16"
),
AtomicCmpxchgInit
(
IceType_i16
,
"i16"
),
AtomicCmpxchgInit
(
IceType_i32
,
"i32"
),
AtomicCmpxchgInit
(
IceType_i32
,
"i32"
),
AtomicCmpxchgInit
(
IceType_i64
,
"i64"
),
AtomicCmpxchgInit
(
IceType_i64
,
"i64"
),
#undef AtomicCmpxchgInit
#undef AtomicCmpxchgInit
{{
INTRIN
(
AtomicFence
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
AtomicFence
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
},
{
IceType_void
,
IceType_i32
},
2
},
2
},
"nacl.atomic.fence"
},
"nacl.atomic.fence"
},
{{
INTRIN
(
AtomicFenceAll
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
AtomicFenceAll
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
},
1
},
{
IceType_void
},
"nacl.atomic.fence.all"
},
1
},
{{
INTRIN
(
AtomicIsLockFree
,
SideEffects_F
,
ReturnsTwice_F
),
"nacl.atomic.fence.all"
},
{
IceType_i1
,
IceType_i32
,
IceType_i32
},
{{
INTRIN
(
AtomicIsLockFree
,
SideEffects_F
,
ReturnsTwice_F
),
3
},
{
IceType_i1
,
IceType_i32
,
IceType_i32
},
"nacl.atomic.is.lock.free"
},
3
},
"nacl.atomic.is.lock.free"
},
#define AtomicLoadInit(Overload, NameSuffix) \
#define AtomicLoadInit(Overload, NameSuffix) \
{ \
{ \
...
@@ -78,10 +76,10 @@ const struct IceIntrinsicsEntry_ {
...
@@ -78,10 +76,10 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "nacl.atomic.load." NameSuffix \
, "nacl.atomic.load." NameSuffix \
}
}
AtomicLoadInit
(
IceType_i8
,
"i8"
),
AtomicLoadInit
(
IceType_i8
,
"i8"
),
AtomicLoadInit
(
IceType_i16
,
"i16"
),
AtomicLoadInit
(
IceType_i16
,
"i16"
),
AtomicLoadInit
(
IceType_i32
,
"i32"
),
AtomicLoadInit
(
IceType_i32
,
"i32"
),
AtomicLoadInit
(
IceType_i64
,
"i64"
),
AtomicLoadInit
(
IceType_i64
,
"i64"
),
#undef AtomicLoadInit
#undef AtomicLoadInit
#define AtomicRMWInit(Overload, NameSuffix) \
#define AtomicRMWInit(Overload, NameSuffix) \
...
@@ -92,10 +90,10 @@ const struct IceIntrinsicsEntry_ {
...
@@ -92,10 +90,10 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "nacl.atomic.rmw." NameSuffix \
, "nacl.atomic.rmw." NameSuffix \
}
}
AtomicRMWInit
(
IceType_i8
,
"i8"
),
AtomicRMWInit
(
IceType_i8
,
"i8"
),
AtomicRMWInit
(
IceType_i16
,
"i16"
),
AtomicRMWInit
(
IceType_i16
,
"i16"
),
AtomicRMWInit
(
IceType_i32
,
"i32"
),
AtomicRMWInit
(
IceType_i32
,
"i32"
),
AtomicRMWInit
(
IceType_i64
,
"i64"
),
AtomicRMWInit
(
IceType_i64
,
"i64"
),
#undef AtomicRMWInit
#undef AtomicRMWInit
#define AtomicStoreInit(Overload, NameSuffix) \
#define AtomicStoreInit(Overload, NameSuffix) \
...
@@ -106,10 +104,10 @@ const struct IceIntrinsicsEntry_ {
...
@@ -106,10 +104,10 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "nacl.atomic.store." NameSuffix \
, "nacl.atomic.store." NameSuffix \
}
}
AtomicStoreInit
(
IceType_i8
,
"i8"
),
AtomicStoreInit
(
IceType_i8
,
"i8"
),
AtomicStoreInit
(
IceType_i16
,
"i16"
),
AtomicStoreInit
(
IceType_i16
,
"i16"
),
AtomicStoreInit
(
IceType_i32
,
"i32"
),
AtomicStoreInit
(
IceType_i32
,
"i32"
),
AtomicStoreInit
(
IceType_i64
,
"i64"
),
AtomicStoreInit
(
IceType_i64
,
"i64"
),
#undef AtomicStoreInit
#undef AtomicStoreInit
#define BswapInit(Overload, NameSuffix) \
#define BswapInit(Overload, NameSuffix) \
...
@@ -120,9 +118,9 @@ const struct IceIntrinsicsEntry_ {
...
@@ -120,9 +118,9 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "bswap." NameSuffix \
, "bswap." NameSuffix \
}
}
BswapInit
(
IceType_i16
,
"i16"
),
BswapInit
(
IceType_i16
,
"i16"
),
BswapInit
(
IceType_i32
,
"i32"
),
BswapInit
(
IceType_i32
,
"i32"
),
BswapInit
(
IceType_i64
,
"i64"
),
BswapInit
(
IceType_i64
,
"i64"
),
#undef BswapInit
#undef BswapInit
#define CtlzInit(Overload, NameSuffix) \
#define CtlzInit(Overload, NameSuffix) \
...
@@ -133,8 +131,8 @@ const struct IceIntrinsicsEntry_ {
...
@@ -133,8 +131,8 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "ctlz." NameSuffix \
, "ctlz." NameSuffix \
}
}
CtlzInit
(
IceType_i32
,
"i32"
),
CtlzInit
(
IceType_i32
,
"i32"
),
CtlzInit
(
IceType_i64
,
"i64"
),
CtlzInit
(
IceType_i64
,
"i64"
),
#undef CtlzInit
#undef CtlzInit
#define CtpopInit(Overload, NameSuffix) \
#define CtpopInit(Overload, NameSuffix) \
...
@@ -145,8 +143,8 @@ const struct IceIntrinsicsEntry_ {
...
@@ -145,8 +143,8 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "ctpop." NameSuffix \
, "ctpop." NameSuffix \
}
}
CtpopInit
(
IceType_i32
,
"i32"
),
CtpopInit
(
IceType_i32
,
"i32"
),
CtpopInit
(
IceType_i64
,
"i64"
),
CtpopInit
(
IceType_i64
,
"i64"
),
#undef CtpopInit
#undef CtpopInit
#define CttzInit(Overload, NameSuffix) \
#define CttzInit(Overload, NameSuffix) \
...
@@ -157,53 +155,52 @@ const struct IceIntrinsicsEntry_ {
...
@@ -157,53 +155,52 @@ const struct IceIntrinsicsEntry_ {
} \
} \
, "cttz." NameSuffix \
, "cttz." NameSuffix \
}
}
CttzInit
(
IceType_i32
,
"i32"
),
CttzInit
(
IceType_i32
,
"i32"
),
CttzInit
(
IceType_i64
,
"i64"
),
CttzInit
(
IceType_i64
,
"i64"
),
#undef CttzInit
#undef CttzInit
{{
INTRIN
(
Longjmp
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
Longjmp
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
,
IceType_i32
},
{
IceType_void
,
IceType_i32
,
IceType_i32
},
3
},
3
},
"nacl.longjmp"
},
"nacl.longjmp"
},
{{
INTRIN
(
Memcpy
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
Memcpy
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
{
IceType_void
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i1
},
IceType_i1
},
6
},
6
},
"memcpy.p0i8.p0i8.i32"
},
"memcpy.p0i8.p0i8.i32"
},
{{
INTRIN
(
Memmove
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
Memmove
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
{
IceType_void
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i32
,
IceType_i1
},
IceType_i1
},
6
},
6
},
"memmove.p0i8.p0i8.i32"
},
"memmove.p0i8.p0i8.i32"
},
{{
INTRIN
(
Memset
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
Memset
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
,
IceType_i8
,
IceType_i32
,
IceType_i32
,
{
IceType_void
,
IceType_i32
,
IceType_i8
,
IceType_i32
,
IceType_i32
,
IceType_i1
},
IceType_i1
},
6
},
6
},
"memset.p0i8.i32"
},
"memset.p0i8.i32"
},
{{
INTRIN
(
NaClReadTP
,
SideEffects_F
,
ReturnsTwice_F
),
{
IceType_i32
},
1
},
{{
INTRIN
(
NaClReadTP
,
SideEffects_F
,
ReturnsTwice_F
),
{
IceType_i32
},
1
},
"nacl.read.tp"
},
"nacl.read.tp"
},
{{
INTRIN
(
Setjmp
,
SideEffects_T
,
ReturnsTwice_T
),
{{
INTRIN
(
Setjmp
,
SideEffects_T
,
ReturnsTwice_T
),
{
IceType_i32
,
IceType_i32
},
{
IceType_i32
,
IceType_i32
},
2
},
2
},
"nacl.setjmp"
},
"nacl.setjmp"
},
#define SqrtInit(Overload, NameSuffix) \
#define SqrtInit(Overload, NameSuffix) \
{ \
{ \
{ INTRIN(Sqrt, SideEffects_F, ReturnsTwice_F), {Overload, Overload}, 2 } \
{ INTRIN(Sqrt, SideEffects_F, ReturnsTwice_F), {Overload, Overload}, 2 } \
, "sqrt." NameSuffix \
, "sqrt." NameSuffix \
}
}
SqrtInit
(
IceType_f32
,
"f32"
),
SqrtInit
(
IceType_f32
,
"f32"
),
SqrtInit
(
IceType_f64
,
"f64"
),
SqrtInit
(
IceType_f64
,
"f64"
),
#undef SqrtInit
#undef SqrtInit
{{
INTRIN
(
Stacksave
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_i32
},
1
},
{{
INTRIN
(
Stacksave
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_i32
},
1
},
"stacksave"
},
"stacksave"
},
{{
INTRIN
(
Stackrestore
,
SideEffects_T
,
ReturnsTwice_F
),
{{
INTRIN
(
Stackrestore
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
,
IceType_i32
},
{
IceType_void
,
IceType_i32
},
2
},
2
},
"stackrestore"
},
"stackrestore"
},
{{
INTRIN
(
Trap
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
},
1
},
{{
INTRIN
(
Trap
,
SideEffects_T
,
ReturnsTwice_F
),
{
IceType_void
},
1
},
"trap"
}};
"trap"
}};
const
size_t
IceIntrinsicsTableSize
=
llvm
::
array_lengthof
(
IceIntrinsicsTable
);
const
size_t
IceIntrinsicsTableSize
=
llvm
::
array_lengthof
(
IceIntrinsicsTable
);
#undef INTRIN
#undef INTRIN
...
...
src/IceTargetLoweringX8632.cpp
View file @
d9dc82e4
...
@@ -61,7 +61,7 @@ const struct TableFcmp_ {
...
@@ -61,7 +61,7 @@ const struct TableFcmp_ {
#define X(val, dflt, swapS, C1, C2, swapV, pred) \
#define X(val, dflt, swapS, C1, C2, swapV, pred) \
{ dflt, swapS, CondX86::C1, CondX86::C2, swapV, CondX86::pred } \
{ dflt, swapS, CondX86::C1, CondX86::C2, swapV, CondX86::pred } \
,
,
FCMPX8632_TABLE
FCMPX8632_TABLE
#undef X
#undef X
};
};
const
size_t
TableFcmpSize
=
llvm
::
array_lengthof
(
TableFcmp
);
const
size_t
TableFcmpSize
=
llvm
::
array_lengthof
(
TableFcmp
);
...
@@ -76,7 +76,7 @@ const struct TableIcmp32_ {
...
@@ -76,7 +76,7 @@ const struct TableIcmp32_ {
#define X(val, C_32, C1_64, C2_64, C3_64) \
#define X(val, C_32, C1_64, C2_64, C3_64) \
{ CondX86::C_32 } \
{ CondX86::C_32 } \
,
,
ICMPX8632_TABLE
ICMPX8632_TABLE
#undef X
#undef X
};
};
const
size_t
TableIcmp32Size
=
llvm
::
array_lengthof
(
TableIcmp32
);
const
size_t
TableIcmp32Size
=
llvm
::
array_lengthof
(
TableIcmp32
);
...
@@ -91,7 +91,7 @@ const struct TableIcmp64_ {
...
@@ -91,7 +91,7 @@ const struct TableIcmp64_ {
#define X(val, C_32, C1_64, C2_64, C3_64) \
#define X(val, C_32, C1_64, C2_64, C3_64) \
{ CondX86::C1_64, CondX86::C2_64, CondX86::C3_64 } \
{ CondX86::C1_64, CondX86::C2_64, CondX86::C3_64 } \
,
,
ICMPX8632_TABLE
ICMPX8632_TABLE
#undef X
#undef X
};
};
const
size_t
TableIcmp64Size
=
llvm
::
array_lengthof
(
TableIcmp64
);
const
size_t
TableIcmp64Size
=
llvm
::
array_lengthof
(
TableIcmp64
);
...
@@ -108,7 +108,7 @@ const struct TableTypeX8632Attributes_ {
...
@@ -108,7 +108,7 @@ const struct TableTypeX8632Attributes_ {
#define X(tag, elementty, cvt, sdss, pack, width, fld) \
#define X(tag, elementty, cvt, sdss, pack, width, fld) \
{ elementty } \
{ elementty } \
,
,
ICETYPEX8632_TABLE
ICETYPEX8632_TABLE
#undef X
#undef X
};
};
const
size_t
TableTypeX8632AttributesSize
=
const
size_t
TableTypeX8632AttributesSize
=
...
@@ -4120,8 +4120,8 @@ void TargetX8632::scalarizeArithmetic(InstArithmetic::OpKind Kind,
...
@@ -4120,8 +4120,8 @@ void TargetX8632::scalarizeArithmetic(InstArithmetic::OpKind Kind,
// We can eliminate the sext operation by copying the result of pcmpeqd,
// We can eliminate the sext operation by copying the result of pcmpeqd,
// pcmpgtd, or cmpps (which produce sign extended results) to the result
// pcmpgtd, or cmpps (which produce sign extended results) to the result
// of the sext operation.
// of the sext operation.
void
void
TargetX8632
::
eliminateNextVectorSextInstruction
(
TargetX8632
::
eliminateNextVectorSextInstruction
(
Variable
*
SignExtendedResult
)
{
Variable
*
SignExtendedResult
)
{
if
(
InstCast
*
NextCast
=
if
(
InstCast
*
NextCast
=
llvm
::
dyn_cast_or_null
<
InstCast
>
(
Context
.
getNextInst
()))
{
llvm
::
dyn_cast_or_null
<
InstCast
>
(
Context
.
getNextInst
()))
{
if
(
NextCast
->
getCastKind
()
==
InstCast
::
Sext
&&
if
(
NextCast
->
getCastKind
()
==
InstCast
::
Sext
&&
...
...
src/main.cpp
View file @
d9dc82e4
...
@@ -386,9 +386,8 @@ int main(int argc, char **argv) {
...
@@ -386,9 +386,8 @@ int main(int argc, char **argv) {
SMDiagnostic
Err
;
SMDiagnostic
Err
;
Ice
::
TimerMarker
T1
(
Ice
::
TimerStack
::
TT_parse
,
&
Ctx
);
Ice
::
TimerMarker
T1
(
Ice
::
TimerStack
::
TT_parse
,
&
Ctx
);
raw_ostream
*
Verbose
=
LLVMVerboseErrors
?
&
errs
()
:
nullptr
;
raw_ostream
*
Verbose
=
LLVMVerboseErrors
?
&
errs
()
:
nullptr
;
std
::
unique_ptr
<
Module
>
Mod
=
std
::
unique_ptr
<
Module
>
Mod
=
NaClParseIRFile
(
NaClParseIRFile
(
IRFilename
,
InputFileFormat
,
Err
,
Verbose
,
IRFilename
,
InputFileFormat
,
Err
,
Verbose
,
getGlobalContext
());
getGlobalContext
());
if
(
!
Mod
)
{
if
(
!
Mod
)
{
Err
.
print
(
argv
[
0
],
errs
());
Err
.
print
(
argv
[
0
],
errs
());
return
GetReturnValue
(
Ice
::
EC_Bitcode
);
return
GetReturnValue
(
Ice
::
EC_Bitcode
);
...
...
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