diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/gcc/gcc-13/0018-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch')
| -rw-r--r-- | meta-microblaze/recipes-devtools/gcc/gcc-13/0018-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/gcc/gcc-13/0018-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch b/meta-microblaze/recipes-devtools/gcc/gcc-13/0018-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch new file mode 100644 index 00000000..f388e9b5 --- /dev/null +++ b/meta-microblaze/recipes-devtools/gcc/gcc-13/0018-microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | From 0a7299e82a8f463e9e7cd6297c5bdc0aac3a0ec4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
| 3 | Date: Tue, 17 Jan 2017 18:07:24 +0530 | ||
| 4 | Subject: [PATCH 18/54] microblaze.md: Improve 'adddi3' and 'subdi3' insn | ||
| 5 | definitions Change adddi3 to handle DI immediates as the second operand, this | ||
| 6 | requires modification to the output template however reduces the need to | ||
| 7 | specify seperate templates for 16-bit positive/negative immediate operands. | ||
| 8 | The use of 32-bit immediates for the addi and addic instructions is handled | ||
| 9 | by the assembler, which will emit the imm instructions when required. This | ||
| 10 | conveniently handles the optimizable cases where the immediate constant value | ||
| 11 | does not need the higher half words of the operands upper/lower words. | ||
| 12 | |||
| 13 | Change the constraints of the subdi3 instruction definition such that it | ||
| 14 | does not match the second operand as an immediate value. This is because | ||
| 15 | there is no definition to handle this case nor is it possible to | ||
| 16 | implement purely with instructions as microblaze does not provide an | ||
| 17 | instruction to perform a forward arithmetic subtraction (it only | ||
| 18 | provides reverse 'rD = IMM - rA'). | ||
| 19 | |||
| 20 | Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> | ||
| 21 | --- | ||
| 22 | gcc/config/microblaze/microblaze.md | 13 ++++++------- | ||
| 23 | 1 file changed, 6 insertions(+), 7 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md | ||
| 26 | index 0597ed8d75a..498926a4a75 100644 | ||
| 27 | --- a/gcc/config/microblaze/microblaze.md | ||
| 28 | +++ b/gcc/config/microblaze/microblaze.md | ||
| 29 | @@ -502,17 +502,16 @@ | ||
| 30 | ;; Adding 2 DI operands in register or reg/imm | ||
| 31 | |||
| 32 | (define_insn "adddi3" | ||
| 33 | - [(set (match_operand:DI 0 "register_operand" "=d,d,d") | ||
| 34 | - (plus:DI (match_operand:DI 1 "register_operand" "%d,d,d") | ||
| 35 | - (match_operand:DI 2 "arith_operand32" "d,P,N")))] | ||
| 36 | + [(set (match_operand:DI 0 "register_operand" "=d,d") | ||
| 37 | + (plus:DI (match_operand:DI 1 "register_operand" "%d,d") | ||
| 38 | + (match_operand:DI 2 "arith_operand" "d,i")))] | ||
| 39 | "" | ||
| 40 | "@ | ||
| 41 | add\t%L0,%L1,%L2\;addc\t%M0,%M1,%M2 | ||
| 42 | - addi\t%L0,%L1,%2\;addc\t%M0,%M1,r0 | ||
| 43 | - addi\t%L0,%L1,%2\;addc\t%M0,%M1,r0\;addi\t%M0,%M0,-1" | ||
| 44 | + addi\t%L0,%L1,%j2\;addic\t%M0,%M1,%h2" | ||
| 45 | [(set_attr "type" "darith") | ||
| 46 | (set_attr "mode" "DI") | ||
| 47 | - (set_attr "length" "8,8,12")]) | ||
| 48 | + (set_attr "length" "8,8")]) | ||
| 49 | |||
| 50 | ;;---------------------------------------------------------------- | ||
| 51 | ;; Subtraction | ||
| 52 | @@ -549,7 +548,7 @@ | ||
| 53 | (define_insn "subdi3" | ||
| 54 | [(set (match_operand:DI 0 "register_operand" "=&d") | ||
| 55 | (minus:DI (match_operand:DI 1 "register_operand" "d") | ||
| 56 | - (match_operand:DI 2 "arith_operand32" "d")))] | ||
| 57 | + (match_operand:DI 2 "register_operand" "d")))] | ||
| 58 | "" | ||
| 59 | "rsub\t%L0,%L2,%L1\;rsubc\t%M0,%M2,%M1" | ||
| 60 | [(set_attr "type" "darith") | ||
| 61 | -- | ||
| 62 | 2.34.1 | ||
| 63 | |||
