forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The constant initialization for globals in NVPTX is generated as an
array of bytes. The generation of this byte arrays was expecting the host to be little endian, which prevents big endian hosts to be used in the generation of the PTX code. This patch fixes the problem by changing the way the bytes are extracted so that it works for either little and big endian. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239412 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Samuel Antao
committed
Jun 9, 2015
1 parent
a0c9e11
commit 8e8c4b5
Showing
2 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s | ||
|
||
; Make sure the globals constant initializers are not prone to host endianess | ||
; issues. | ||
|
||
; CHECK-DAG: .b8 Gbli08[2] = {171, 205}; | ||
@Gbli08 = global [2 x i8] [i8 171, i8 205] | ||
|
||
; CHECK-DAG: .b8 Gbli16[4] = {205, 171, 1, 239}; | ||
@Gbli16 = global [2 x i16] [i16 43981, i16 61185] | ||
|
||
; CHECK-DAG: .b8 Gbli32[8] = {1, 239, 205, 171, 137, 103, 69, 35}; | ||
@Gbli32 = global [2 x i32] [i32 2882400001, i32 591751049] | ||
|
||
; CHECK-DAG: .b8 Gbli64[16] = {137, 103, 69, 35, 1, 239, 205, 171, 239, 205, 171, 137, 103, 69, 35, 1}; | ||
@Gbli64 = global [2 x i64] [i64 12379813738877118345, i64 81985529216486895] | ||
|
||
; CHECK-DAG: .b8 Gblf32[8] = {192, 225, 100, 75, 0, 96, 106, 69}; | ||
@Gblf32 = global [2 x float] [float 1.5e+7, float 3.75e+3] | ||
|
||
; CHECK-DAG: .b8 Gblf64[16] = {116, 10, 181, 48, 134, 62, 230, 58, 106, 222, 138, 98, 204, 250, 200, 75}; | ||
@Gblf64 = global [2 x double] [double 5.75e-25, double 12.25e+56] | ||
|