Skip to contentSkip to conversation

tcg/aarch64: Fix output of extract2 opcodes

PATCH In review Richard Henderson 5 participants 11 messages Jul 9, 2019 – Jul 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcg/aarch64: Fix output of extract2 opcodes

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

---
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +1 -1
index b0f8106642..0713448bf5 100644
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
Signature · 1 line
2.17.1
#1 lore raw
Quoted 9 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

---

The commit message looks more like a list of some random items than logical explanation of the code change. Improve it.

Regards,
Aleksandar

Quoted 20 lines
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +1 -2
index b0f8106642..0713448bf5 100644
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
--

2.17.1

#2 lore raw
Quoted 6 lines · Aleksandar Markovic
Quoted 5 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

Quoted 6 lines
Quoted 4 lines

---

The commit message looks more like a list of some random items than logical explanation of the code change. Improve it.

Vague and non-constructive comments like this are and will continue to be ignored.

If you want to review a patch, then you're going to have to actually read it. There are two obvious changes in the one line patch. Each sentence describes the reason for each change. There is no subtle complex problem here.

r~

Quoted 24 lines

Regards,
Aleksandar

Quoted 20 lines
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +1 -2
index b0f8106642..0713448bf5 100644
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
--

2.17.1

#3 lore raw
Quoted 4 lines · Richard Henderson
Quoted 1 line · Aleksandar Markovic

On Jul 9, 2019 8:56 PM, "Richard Henderson" <

Quoted 11 lines · [email protected]> wrote:
Quoted 11 lines
Quoted 9 lines

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

---

The commit message looks more like a list of some random items than

logical explanation of the code change. Improve it.

Quoted 4 lines

Vague and non-constructive comments like this are and will continue to be ignored.

You can continue ignoring any comment that you don't like, as you already have been doing for long time, but this will certainly not improve your code, and is contrary to the spirit of open source.

Regards, Aleksandar

Quoted 8 lines

If you want to review a patch, then you're going to have to actually read it. There are two obvious changes in the one line patch. Each sentence describes the reason for each change. There is no subtle complex problem here.

r~

Quoted 1 line
Quoted 7 lines
Quoted 7 lines

Regards,
Aleksandar

Review

Quoted 4 lines
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/tcg/aarch64/tcg-target.inc.c

Quoted 4 lines
Quoted 4 lines

tcg/aarch64/tcg-target.inc.c static void tcg_out_op(TCGContext *s, TCGOpcode

Quoted 4 lines

index b0f8106642..0713448bf5 100644

tcg/aarch64/tcg-target.inc.c +0 -0
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode

opc,

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
tcg/aarch64/tcg-target.inc.c +1 -2
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
--

2.17.1

#4 lore raw
In reply to Aleksandar Markovic
Quoted 2 lines · Aleksandar Markovic

The commit message looks more like a list of some random items than logical explanation of the code change. Improve it.

Can you be less combative in your review comments, please? Providing constructive and specific suggestions for the improvements you'd like to see is more likely to help us produce better software than abrupt orders to "improve it".

This is about the third or fourth time you've done this with RTH's patches and I think it is not really warranted.

thanks
-- PMM

#5 lore raw
Quoted 1 line

Can you be less combative in your review comments, please?

Sure, I will.

Thanks, Aleksandar

Reviewed-by on v1 1/1
#6 lore raw
In reply to Richard Henderson
Quoted 17 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

---
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +0 -0
index b0f8106642..0713448bf5 100644

tcg/aarch64/tcg-target.inc.c static void tcg_out_op(TCGContext *s, TCGOpcode opc, · line 2232

Quoted 8 lines
tcg/aarch64/tcg-target.inc.c +1 -1
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
Reviewed-by Tested-by on v1 1/1
#7 lore raw
In reply to Richard Henderson
Quoted 7 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

I ran a bunch of AArch64 EXTR testcases on AArch64 and hit the code at least 4600 times ;-)

Quoted 9 lines
---
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +0 -0
index b0f8106642..0713448bf5 100644

tcg/aarch64/tcg-target.inc.c static void tcg_out_op(TCGContext *s, TCGOpcode opc, · line 2232

Quoted 8 lines
tcg/aarch64/tcg-target.inc.c +1 -1
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:

--
Alex Bennée

#8 lore raw
In reply to Richard Henderson
Quoted 4 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

Hello, Richard.

If endian and rZ constraints are unrelated problems, then I think the commit message
should be:

"This patch fixes two problem:

- endianness: the aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian.

- rZ constrains: REG0() macro should be applied to the affected arguments."

One could argue that in this case the patch this should be actually two patches. This is better because of bisectability. The number of line in the patch doesn't matter.

If, on the other hand, endian and rZ constraints are related problems, then you should explain how in the commit message.

In general, your commit messages appear too terse, and it is hard to establish logical sense of the changes in question.

Would you be so kind to consider my opinion?

Regards,
Aleksandar

Quoted 25 lines
---
 tcg/aarch64/tcg-target.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/aarch64/tcg-target.inc.c +1 -2
index b0f8106642..0713448bf5 100644
@@ -2226,7 +2226,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
 
     case INDEX_op_extract2_i64:
     case INDEX_op_extract2_i32:
-        tcg_out_extr(s, ext, a0, a1, a2, args[3]);
+        tcg_out_extr(s, ext, a0, REG0(2), REG0(1), args[3]);
         break;
 
     case INDEX_op_add2_i32:
--

2.17.1

#9 lore raw
Quoted 13 lines · Aleksandar Markovic
Quoted 4 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

Hello, Richard.

If endian and rZ constraints are unrelated problems, then I think the commit message
should be:

Quoted 7 lines

"This patch fixes two problem:

- endianness: the aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian.

- rZ constrains: REG0() macro should be applied to the affected arguments."

That's fair.

Quoted 3 lines

One could argue that in this case the patch this should be actually two patches. This is better because of bisectability. The number of line in the patch doesn't matter.

Well, nothing between the faulty commit (Fixes: 464c2969d5d) and the second of the two prospective patches is really bisectable. For the given test case, all points in between will fail at runtime, even if each point compiles.

Therefore I don't see the point in separating the two changes.

Quoted 1 line

Would you be so kind to consider my opinion?

Yes. Thanks for the expanded opinion.

I plan to change the commit message to:

---
tcg/aarch64: Fix output of extract2 opcodes

This patch fixes two problems:
(1) The inputs to the EXTR insn were reversed,
(2) The input constraints use rZ, which means that we need to use the REG0 macro in order to supply XZR for a constant 0 input.

r-b, s-o-b, etc
---

Does that seem sufficient to you?

r~

#10 lore raw
Quoted 49 lines · Richard Henderson
Quoted 13 lines · Aleksandar Markovic
Quoted 4 lines · Richard Henderson

The aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian. Use REG0 so that we honor the rZ constraints.

Hello, Richard.

If endian and rZ constraints are unrelated problems, then I think the commit message
should be:

Quoted 7 lines

"This patch fixes two problem:

- endianness: the aarch64 argument ordering for the operands is big-endian, whereas the tcg argument ordering is little-endian.

- rZ constrains: REG0() macro should be applied to the affected arguments."

That's fair.

Quoted 3 lines

One could argue that in this case the patch this should be actually two patches. This is better because of bisectability. The number of line in the patch doesn't matter.

Well, nothing between the faulty commit (Fixes: 464c2969d5d) and the second of the two prospective patches is really bisectable. For the given test case, all points in between will fail at runtime, even if each point compiles.

Therefore I don't see the point in separating the two changes.

Quoted 1 line

Would you be so kind to consider my opinion?

Yes. Thanks for the expanded opinion.

I plan to change the commit message to:

---
tcg/aarch64: Fix output of extract2 opcodes

This patch fixes two problems:
(1) The inputs to the EXTR insn were reversed,
(2) The input constraints use rZ, which means that we need to use the REG0 macro in order to supply XZR for a constant 0 input.

Quoted 5 lines

r-b, s-o-b, etc
---

Does that seem sufficient to you?

It does. That's super. Thank you very much!

Yours,
Aleksandar

Quoted 2 lines

r~