* [Patch,microblaze]: Optimized usage of fint instruction.
@ 2015-02-25 10:27 Ajit Kumar Agarwal
2015-02-26 0:01 ` Michael Eager
0 siblings, 1 reply; 5+ messages in thread
From: Ajit Kumar Agarwal @ 2015-02-25 10:27 UTC (permalink / raw)
To: GCC Patches
Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
Hello All:
Please find the patch for the optimized usage of fint instruction changes. No regression is seen
in the deja GNU tests.
commit ed4dc0b96bf43c200cacad97f73a98ab7048e51b
Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Wed Feb 25 15:36:29 2015 +0530
[Patch,microblaze]: Optimized usage of fint instruction.
The changes are made in the patch for optimized usage of fint instruction.
The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
fint instruction takes 6/7 cycles as compared to fcmp instruction which
takes 1 cycles. The conversion from float to int with fint instruction
is not required and can directly compared with fcmp instruction which
takes 1 cycle as compared to 6/7 cycles with fint instruction.
ChangeLog:
2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
* config/microblaze/microblaze.md (peephole2): New.
Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
Thanks & Regards
Ajit
[-- Attachment #2: 0001-Patch-microblaze-Optimized-usage-of-fint-instruction.patch --]
[-- Type: application/octet-stream, Size: 2306 bytes --]
From ed4dc0b96bf43c200cacad97f73a98ab7048e51b Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Wed, 25 Feb 2015 15:36:29 +0530
Subject: [PATCH] [Patch,microblaze]: Optimized usage of fint instruction.
The changes are made in the patch for optimized usage of fint instruction.
The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
fint instruction takes 6/7 cycles as compared to fcmp instruction which
takes 1 cycles. The conversion from float to int with fint instruction
is not required and can directly compared with fcmp instruction which
takes 1 cycle as compared to 6/7 cycles with fint instruction.
ChangeLog:
2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
* config/microblaze/microblaze.md (peephole2): New.
Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
---
gcc/config/microblaze/microblaze.md | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 67e509c..9faebf2 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -663,6 +663,31 @@
(set_attr "mode" "SI")
(set_attr "length" "4")])
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand")
+ (fix:SI (match_operand:SF 1 "register_operand")))
+ (set (pc)
+ (if_then_else (match_operator 2 "ordered_comparison_operator"
+ [(match_operand:SI 3 "register_operand")
+ (match_operand:SI 4 "arith_operand")])
+ (label_ref (match_operand 5))
+ (pc)))]
+ "TARGET_HARD_FLOAT"
+ [(set (match_dup 1) (match_dup 3))]
+
+ {
+ rtx condition;
+ rtx cmp_op0 = operands[3];
+ rtx cmp_op1 = operands[4];
+ rtx comp_reg = gen_rtx_REG (SImode, MB_ABI_ASM_TEMP_REGNUM);
+
+ emit_insn (gen_cstoresf4 (comp_reg, operands[2],
+ gen_rtx_REG(SFmode,REGNO(cmp_op0)),
+ gen_rtx_REG(SFmode,REGNO(cmp_op1))));
+ condition = gen_rtx_NE (SImode, comp_reg, const0_rtx);
+ emit_jump_insn (gen_condjump(condition, operands[5]));
+ }
+)
;;----------------------------------------------------------------
;; Negation and one's complement
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch,microblaze]: Optimized usage of fint instruction.
2015-02-25 10:27 [Patch,microblaze]: Optimized usage of fint instruction Ajit Kumar Agarwal
@ 2015-02-26 0:01 ` Michael Eager
2015-03-04 11:54 ` Ajit Kumar Agarwal
0 siblings, 1 reply; 5+ messages in thread
From: Michael Eager @ 2015-02-26 0:01 UTC (permalink / raw)
To: Ajit Kumar Agarwal, GCC Patches
Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala
On 02/25/15 02:20, Ajit Kumar Agarwal wrote:
> Hello All:
>
> Please find the patch for the optimized usage of fint instruction changes. No regression is seen
> in the deja GNU tests.
>
> commit ed4dc0b96bf43c200cacad97f73a98ab7048e51b
> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
> Date: Wed Feb 25 15:36:29 2015 +0530
>
> [Patch,microblaze]: Optimized usage of fint instruction.
>
> The changes are made in the patch for optimized usage of fint instruction.
> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
> fint instruction takes 6/7 cycles as compared to fcmp instruction which
> takes 1 cycles. The conversion from float to int with fint instruction
> is not required and can directly compared with fcmp instruction which
> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>
> ChangeLog:
> 2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
>
> * config/microblaze/microblaze.md (peephole2): New.
>
+ emit_insn (gen_cstoresf4 (comp_reg, operands[2],
+ gen_rtx_REG(SFmode,REGNO(cmp_op0)),
+ gen_rtx_REG(SFmode,REGNO(cmp_op1))));
Spaces before left parens and after comma in last two lines.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [Patch,microblaze]: Optimized usage of fint instruction.
2015-02-26 0:01 ` Michael Eager
@ 2015-03-04 11:54 ` Ajit Kumar Agarwal
2015-03-04 16:21 ` Michael Eager
0 siblings, 1 reply; 5+ messages in thread
From: Ajit Kumar Agarwal @ 2015-03-04 11:54 UTC (permalink / raw)
To: Michael Eager, GCC Patches
Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala
[-- Attachment #1: Type: text/plain, Size: 2653 bytes --]
-----Original Message-----
From: Michael Eager [mailto:eager@eagerm.com]
Sent: Thursday, February 26, 2015 4:33 AM
To: Ajit Kumar Agarwal; GCC Patches
Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch,microblaze]: Optimized usage of fint instruction.
On 02/25/15 02:20, Ajit Kumar Agarwal wrote:
> Hello All:
>
> Please find the patch for the optimized usage of fint instruction
> changes. No regression is seen in the deja GNU tests.
>
> commit ed4dc0b96bf43c200cacad97f73a98ab7048e51b
> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
> Date: Wed Feb 25 15:36:29 2015 +0530
>
> [Patch,microblaze]: Optimized usage of fint instruction.
>
> The changes are made in the patch for optimized usage of fint instruction.
> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
> fint instruction takes 6/7 cycles as compared to fcmp instruction which
> takes 1 cycles. The conversion from float to int with fint instruction
> is not required and can directly compared with fcmp instruction which
> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>
> ChangeLog:
> 2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
>
> * config/microblaze/microblaze.md (peephole2): New.
>
+ emit_insn (gen_cstoresf4 (comp_reg, operands[2],
+ gen_rtx_REG(SFmode,REGNO(cmp_op0)),
+ gen_rtx_REG(SFmode,REGNO(cmp_op1))));
>>Spaces before left parens and after comma in last two lines.
Changes are incorporated. Please find the log for updated patch.
commit 492b0d0b67a5b12d2dc239de3215630c8838edea
Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Wed Mar 4 17:15:16 2015 +0530
[Patch,microblaze]: Optimized usage of fint instruction.
The changes are made in the patch for optimized usage of fint instruction.
The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
fint instruction takes 6/7 cycles as compared to fcmp instruction which
takes 1 cycles. The conversion from float to int with fint instruction
is not required and can directly compared with fcmp instruction which
takes 1 cycle as compared to 6/7 cycles with fint instruction.
ChangeLog:
2015-03-04 Ajit Agarwal <ajitkum@xilinx.com>
* config/microblaze/microblaze.md (peephole2): New.
Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
Thanks & Regards
Ajit
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
[-- Attachment #2: 0001-Patch-microblaze-Optimized-usage-of-fint-instruction.patch --]
[-- Type: application/octet-stream, Size: 2312 bytes --]
From 492b0d0b67a5b12d2dc239de3215630c8838edea Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Wed, 4 Mar 2015 17:15:16 +0530
Subject: [PATCH] [Patch,microblaze]: Optimized usage of fint instruction.
The changes are made in the patch for optimized usage of fint instruction.
The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
fint instruction takes 6/7 cycles as compared to fcmp instruction which
takes 1 cycles. The conversion from float to int with fint instruction
is not required and can directly compared with fcmp instruction which
takes 1 cycle as compared to 6/7 cycles with fint instruction.
ChangeLog:
2015-03-04 Ajit Agarwal <ajitkum@xilinx.com>
* config/microblaze/microblaze.md (peephole2): New.
Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
---
gcc/config/microblaze/microblaze.md | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md
index 67e509c..ad97ca6 100644
--- a/gcc/config/microblaze/microblaze.md
+++ b/gcc/config/microblaze/microblaze.md
@@ -663,6 +663,31 @@
(set_attr "mode" "SI")
(set_attr "length" "4")])
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand")
+ (fix:SI (match_operand:SF 1 "register_operand")))
+ (set (pc)
+ (if_then_else (match_operator 2 "ordered_comparison_operator"
+ [(match_operand:SI 3 "register_operand")
+ (match_operand:SI 4 "arith_operand")])
+ (label_ref (match_operand 5))
+ (pc)))]
+ "TARGET_HARD_FLOAT"
+ [(set (match_dup 1) (match_dup 3))]
+
+ {
+ rtx condition;
+ rtx cmp_op0 = operands[3];
+ rtx cmp_op1 = operands[4];
+ rtx comp_reg = gen_rtx_REG (SImode, MB_ABI_ASM_TEMP_REGNUM);
+
+ emit_insn (gen_cstoresf4 (comp_reg, operands[2],
+ gen_rtx_REG (SFmode, REGNO (cmp_op0)),
+ gen_rtx_REG (SFmode, REGNO (cmp_op1))));
+ condition = gen_rtx_NE (SImode, comp_reg, const0_rtx);
+ emit_jump_insn (gen_condjump (condition, operands[5]));
+ }
+)
;;----------------------------------------------------------------
;; Negation and one's complement
--
1.7.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch,microblaze]: Optimized usage of fint instruction.
2015-03-04 11:54 ` Ajit Kumar Agarwal
@ 2015-03-04 16:21 ` Michael Eager
2015-05-05 1:09 ` Michael Eager
0 siblings, 1 reply; 5+ messages in thread
From: Michael Eager @ 2015-03-04 16:21 UTC (permalink / raw)
To: Ajit Kumar Agarwal, GCC Patches
Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala
On 03/04/15 03:53, Ajit Kumar Agarwal wrote:
>
>
> -----Original Message-----
> From: Michael Eager [mailto:eager@eagerm.com]
> Sent: Thursday, February 26, 2015 4:33 AM
> To: Ajit Kumar Agarwal; GCC Patches
> Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala
> Subject: Re: [Patch,microblaze]: Optimized usage of fint instruction.
>
> On 02/25/15 02:20, Ajit Kumar Agarwal wrote:
>> Hello All:
>>
>> Please find the patch for the optimized usage of fint instruction
>> changes. No regression is seen in the deja GNU tests.
>>
>> commit ed4dc0b96bf43c200cacad97f73a98ab7048e51b
>> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
>> Date: Wed Feb 25 15:36:29 2015 +0530
>>
>> [Patch,microblaze]: Optimized usage of fint instruction.
>>
>> The changes are made in the patch for optimized usage of fint instruction.
>> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
>> fint instruction takes 6/7 cycles as compared to fcmp instruction which
>> takes 1 cycles. The conversion from float to int with fint instruction
>> is not required and can directly compared with fcmp instruction which
>> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>>
>> ChangeLog:
>> 2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
>>
>> * config/microblaze/microblaze.md (peephole2): New.
>
>>
> + emit_insn (gen_cstoresf4 (comp_reg, operands[2],
> + gen_rtx_REG(SFmode,REGNO(cmp_op0)),
> + gen_rtx_REG(SFmode,REGNO(cmp_op1))));
>
>>> Spaces before left parens and after comma in last two lines.
>
> Changes are incorporated. Please find the log for updated patch.
>
> commit 492b0d0b67a5b12d2dc239de3215630c8838edea
> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
> Date: Wed Mar 4 17:15:16 2015 +0530
>
> [Patch,microblaze]: Optimized usage of fint instruction.
>
> The changes are made in the patch for optimized usage of fint instruction.
> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
> fint instruction takes 6/7 cycles as compared to fcmp instruction which
> takes 1 cycles. The conversion from float to int with fint instruction
> is not required and can directly compared with fcmp instruction which
> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>
> ChangeLog:
> 2015-03-04 Ajit Agarwal <ajitkum@xilinx.com>
>
> * config/microblaze/microblaze.md (peephole2): New.
>
> Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
>
> Thanks & Regards
> Ajit
OK.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Patch,microblaze]: Optimized usage of fint instruction.
2015-03-04 16:21 ` Michael Eager
@ 2015-05-05 1:09 ` Michael Eager
0 siblings, 0 replies; 5+ messages in thread
From: Michael Eager @ 2015-05-05 1:09 UTC (permalink / raw)
To: Ajit Kumar Agarwal, GCC Patches
Cc: Vinod Kathail, Shail Aditya Gupta, Vidhumouli Hunsigida, Nagaraju Mekala
On 03/04/2015 08:20 AM, Michael Eager wrote:
> On 03/04/15 03:53, Ajit Kumar Agarwal wrote:
>>
>>
>> -----Original Message-----
>> From: Michael Eager [mailto:eager@eagerm.com]
>> Sent: Thursday, February 26, 2015 4:33 AM
>> To: Ajit Kumar Agarwal; GCC Patches
>> Cc: Vinod Kathail; Shail Aditya Gupta; Vidhumouli Hunsigida; Nagaraju Mekala
>> Subject: Re: [Patch,microblaze]: Optimized usage of fint instruction.
>>
>> On 02/25/15 02:20, Ajit Kumar Agarwal wrote:
>>> Hello All:
>>>
>>> Please find the patch for the optimized usage of fint instruction
>>> changes. No regression is seen in the deja GNU tests.
>>>
>>> commit ed4dc0b96bf43c200cacad97f73a98ab7048e51b
>>> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
>>> Date: Wed Feb 25 15:36:29 2015 +0530
>>>
>>> [Patch,microblaze]: Optimized usage of fint instruction.
>>>
>>> The changes are made in the patch for optimized usage of fint instruction.
>>> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
>>> fint instruction takes 6/7 cycles as compared to fcmp instruction which
>>> takes 1 cycles. The conversion from float to int with fint instruction
>>> is not required and can directly compared with fcmp instruction which
>>> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>>>
>>> ChangeLog:
>>> 2015-02-25 Ajit Agarwal <ajitkum@xilinx.com>
>>>
>>> * config/microblaze/microblaze.md (peephole2): New.
>>
>>>
>> + emit_insn (gen_cstoresf4 (comp_reg, operands[2],
>> + gen_rtx_REG(SFmode,REGNO(cmp_op0)),
>> + gen_rtx_REG(SFmode,REGNO(cmp_op1))));
>>
>>>> Spaces before left parens and after comma in last two lines.
>>
>> Changes are incorporated. Please find the log for updated patch.
>>
>> commit 492b0d0b67a5b12d2dc239de3215630c8838edea
>> Author: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
>> Date: Wed Mar 4 17:15:16 2015 +0530
>>
>> [Patch,microblaze]: Optimized usage of fint instruction.
>>
>> The changes are made in the patch for optimized usage of fint instruction.
>> The sequence of fint/cond_branch is replaced with fcmp/cond_branch. The
>> fint instruction takes 6/7 cycles as compared to fcmp instruction which
>> takes 1 cycles. The conversion from float to int with fint instruction
>> is not required and can directly compared with fcmp instruction which
>> takes 1 cycle as compared to 6/7 cycles with fint instruction.
>>
>> ChangeLog:
>> 2015-03-04 Ajit Agarwal <ajitkum@xilinx.com>
>>
>> * config/microblaze/microblaze.md (peephole2): New.
>>
>> Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
>>
>> Thanks & Regards
>> Ajit
>
> OK.
Committed revision 222790.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-05 1:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-25 10:27 [Patch,microblaze]: Optimized usage of fint instruction Ajit Kumar Agarwal
2015-02-26 0:01 ` Michael Eager
2015-03-04 11:54 ` Ajit Kumar Agarwal
2015-03-04 16:21 ` Michael Eager
2015-05-05 1:09 ` Michael Eager
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).