* [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not
@ 2009-07-24 17:23 Laurent Desnogues
2009-07-24 18:01 ` Filip Navara
2009-08-22 12:03 ` andrzej zaborowski
0 siblings, 2 replies; 5+ messages in thread
From: Laurent Desnogues @ 2009-07-24 17:23 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 165 bytes --]
Hello,
this patch:
- fixes argument numbers for div2 and divu2
- implements TCG not.
Laurent
Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
[-- Attachment #2: arm-codegen2.patch --]
[-- Type: application/octet-stream, Size: 1692 bytes --]
diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c
index 7ef2b89..53877cf 100644
--- a/tcg/arm/tcg-target.c
+++ b/tcg/arm/tcg-target.c
@@ -1427,6 +1427,10 @@ static inline void tcg_out_op(TCGContext *s, int opc,
case INDEX_op_neg_i32:
tcg_out_dat_imm(s, COND_AL, ARITH_RSB, args[0], args[1], 0);
break;
+ case INDEX_op_not_i32:
+ tcg_out_dat_reg(s, COND_AL,
+ ARITH_MVN, args[0], 0, args[1], SHIFT_IMM_LSL(0));
+ break;
case INDEX_op_mul_i32:
tcg_out_mul32(s, COND_AL, args[0], args[1], args[2]);
break;
@@ -1555,12 +1559,13 @@ static const TCGTargetOpDef arm_op_defs[] = {
{ INDEX_op_sub_i32, { "r", "r", "rI" } },
{ INDEX_op_mul_i32, { "r", "r", "r" } },
{ INDEX_op_mulu2_i32, { "r", "r", "r", "r" } },
- { INDEX_op_div2_i32, { "r", "r", "r", "1", "2" } },
- { INDEX_op_divu2_i32, { "r", "r", "r", "1", "2" } },
+ { INDEX_op_div2_i32, { "r", "r", "r", "0", "1" } },
+ { INDEX_op_divu2_i32, { "r", "r", "r", "0", "1" } },
{ INDEX_op_and_i32, { "r", "r", "rI" } },
{ INDEX_op_or_i32, { "r", "r", "rI" } },
{ INDEX_op_xor_i32, { "r", "r", "rI" } },
{ INDEX_op_neg_i32, { "r", "r" } },
+ { INDEX_op_not_i32, { "r", "r" } },
{ INDEX_op_shl_i32, { "r", "r", "ri" } },
{ INDEX_op_shr_i32, { "r", "r", "ri" } },
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h
index 7ff2928..71e1ec5 100644
--- a/tcg/arm/tcg-target.h
+++ b/tcg/arm/tcg-target.h
@@ -33,6 +33,7 @@
#define TCG_TARGET_HAS_ext16s_i32
#define TCG_TARGET_HAS_neg_i32
#undef TCG_TARGET_HAS_neg_i64
+#define TCG_TARGET_HAS_not_i32
#undef TCG_TARGET_STACK_GROWSUP
enum {
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not
2009-07-24 17:23 [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not Laurent Desnogues
@ 2009-07-24 18:01 ` Filip Navara
2009-07-24 18:54 ` Laurent Desnogues
2009-08-22 12:03 ` andrzej zaborowski
1 sibling, 1 reply; 5+ messages in thread
From: Filip Navara @ 2009-07-24 18:01 UTC (permalink / raw)
To: Laurent Desnogues; +Cc: qemu-devel
On Fri, Jul 24, 2009 at 7:23 PM, Laurent
Desnogues<laurent.desnogues@gmail.com> wrote:
> Hello,
>
> this patch:
>
> - fixes argument numbers for div2 and divu2
> - implements TCG not.
>
>
> Laurent
>
> Signed-off-by: Laurent Desnogues <laurent.desnogues@gmail.com>
>
Looks good to me.
Acked-by: Filip Navara <filip.navara@gmail.com>
Best regards,
Filip Navara
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not
2009-07-24 17:23 [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not Laurent Desnogues
2009-07-24 18:01 ` Filip Navara
@ 2009-08-22 12:03 ` andrzej zaborowski
2009-09-25 15:46 ` Laurent Desnogues
1 sibling, 1 reply; 5+ messages in thread
From: andrzej zaborowski @ 2009-08-22 12:03 UTC (permalink / raw)
To: Laurent Desnogues; +Cc: qemu-devel
2009/7/24 Laurent Desnogues <laurent.desnogues@gmail.com>:
> Hello,
>
> this patch:
>
> - fixes argument numbers for div2 and divu2
But "0" is not defined in target_parse_constraint? Does div2 not work
as is now?
> - implements TCG not.
Pushed this part.
Cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not
2009-08-22 12:03 ` andrzej zaborowski
@ 2009-09-25 15:46 ` Laurent Desnogues
0 siblings, 0 replies; 5+ messages in thread
From: Laurent Desnogues @ 2009-09-25 15:46 UTC (permalink / raw)
To: andrzej zaborowski; +Cc: qemu-devel
On Sat, Aug 22, 2009 at 2:03 PM, andrzej zaborowski <balrogg@gmail.com> wrote:
> 2009/7/24 Laurent Desnogues <laurent.desnogues@gmail.com>:
>> Hello,
>>
>> this patch:
>>
>> - fixes argument numbers for div2 and divu2
>
> But "0" is not defined in target_parse_constraint? Does div2 not work
> as is now?
Given Gary Thomas latest question, I guess it's time to
resurrect that discussion :-)
Constraints defined as numbers are handled internally
by TCG in tcg_add_target_add_op_defs. My understanding
is that they mean that an input and an output arg are aliased.
I don't think it's what the constraint for div2 and divu2 is
trying to express.
Also the div helper looks broken: it potentially restores less
registers than what it saved, and uses ldrt.
My proposed fix was completely wrong, but I have no time
to make a correct one.
Laurent
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-25 15:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24 17:23 [Qemu-devel] [PATCH] ARM back-end: Fix register numbering for div/divu and add TCG not Laurent Desnogues
2009-07-24 18:01 ` Filip Navara
2009-07-24 18:54 ` Laurent Desnogues
2009-08-22 12:03 ` andrzej zaborowski
2009-09-25 15:46 ` Laurent Desnogues
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 NNTP newsgroup(s).