diff options
Diffstat (limited to 'meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch')
-rw-r--r-- | meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch new file mode 100644 index 00000000..ff8e6107 --- /dev/null +++ b/meta-xilinx-bsp/recipes-microblaze/gcc/gcc-7/0025-MicroBlaze-correct-the-const-high-double-immediate-v.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | From fabd23a354496701b4a9ebf6931485b0d61c7bbe Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Sat, 26 Aug 2017 19:21:45 -0700 | ||
4 | Subject: [PATCH] MicroBlaze correct the const high double immediate value | ||
5 | |||
6 | With this patch the loading of the DI mode immediate values will be | ||
7 | using REAL_VALUE_FROM_CONST_DOUBLE and REAL_VALUE_TO_TARGET_DOUBLE | ||
8 | functions, as CONST_DOUBLE_HIGH was returning the sign extension value | ||
9 | even of the unsigned long long constants also | ||
10 | |||
11 | ChangeLog: | ||
12 | |||
13 | 2016-02-03 Nagaraju Mekala <nagaraju.mekala@xilinx.com> | ||
14 | Ajit Agarwal <ajitkum@xilinx.com> | ||
15 | |||
16 | * microblaze.c (print_operand): Use REAL_VALUE_FROM_CONST_DOUBLE & | ||
17 | REAL_VALUE_TO_TARGET_DOUBLE | ||
18 | * long.c (new): Added new testcase | ||
19 | |||
20 | Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com> | ||
21 | Signed-off-by: Ajit Agarwal <ajitkum@xilinx.com> | ||
22 | Signed-off-by: Mahesh Bodapati <mbodapat@xilinx.com> | ||
23 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> | ||
24 | Upstream-Status: Pending | ||
25 | --- | ||
26 | gcc/config/microblaze/microblaze.c | 6 ++++-- | ||
27 | gcc/testsuite/gcc.target/microblaze/long.c | 10 ++++++++++ | ||
28 | 2 files changed, 14 insertions(+), 2 deletions(-) | ||
29 | create mode 100644 gcc/testsuite/gcc.target/microblaze/long.c | ||
30 | |||
31 | diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c | ||
32 | index e7697bf30d..96bf6e1cab 100644 | ||
33 | --- a/gcc/config/microblaze/microblaze.c | ||
34 | +++ b/gcc/config/microblaze/microblaze.c | ||
35 | @@ -2493,14 +2493,16 @@ print_operand (FILE * file, rtx op, int letter) | ||
36 | else if (letter == 'h' || letter == 'j') | ||
37 | { | ||
38 | long val[2]; | ||
39 | + long l[2]; | ||
40 | if (code == CONST_DOUBLE) | ||
41 | { | ||
42 | if (GET_MODE (op) == DFmode) | ||
43 | REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), val); | ||
44 | else | ||
45 | { | ||
46 | - val[0] = CONST_DOUBLE_HIGH (op); | ||
47 | - val[1] = CONST_DOUBLE_LOW (op); | ||
48 | + REAL_VALUE_TO_TARGET_DOUBLE (*CONST_DOUBLE_REAL_VALUE (op), l); | ||
49 | + val[1] = l[WORDS_BIG_ENDIAN == 0]; | ||
50 | + val[0] = l[WORDS_BIG_ENDIAN != 0]; | ||
51 | } | ||
52 | } | ||
53 | else if (code == CONST_INT) | ||
54 | diff --git a/gcc/testsuite/gcc.target/microblaze/long.c b/gcc/testsuite/gcc.target/microblaze/long.c | ||
55 | new file mode 100644 | ||
56 | index 0000000000..4d4518619d | ||
57 | --- /dev/null | ||
58 | +++ b/gcc/testsuite/gcc.target/microblaze/long.c | ||
59 | @@ -0,0 +1,10 @@ | ||
60 | +/* { dg-options "-O0" } */ | ||
61 | +#define BASEADDR 0xF0000000ULL | ||
62 | +int main () | ||
63 | +{ | ||
64 | + unsigned long long start; | ||
65 | + start = (unsigned long long) BASEADDR; | ||
66 | + return 0; | ||
67 | +} | ||
68 | +/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0x00000000" } } */ | ||
69 | +/* { dg-final { scan-assembler "addik\tr(\[0-9]\|\[1-2]\[0-9]\|3\[0-1]),r0,0xf0000000" } } */ | ||
70 | -- | ||
71 | 2.14.2 | ||
72 | |||