-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/internal/obj/arm: .S is silently ignored in MOVW.S #20509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CL https://golang.org/cl/44335 mentions this issue. |
What does |
There is a mov instruction "MOV R1, R2" can take .S suffix. |
Now CL 44335 has nothing to do with this issue. |
"MOVW $0xffffffaa, R0" is assembled to "MVN $0x55, R0", and MVN can also take a .S suffix. |
But I do not find MOVW.S is really used, shall we disable .S for all "MOVW, MOVH, MOVB"? |
The assembler chooses different hardware instructions to materialize constant, which might change (e.g. for better optimization). Sometimes it doesn't take |
MOVW has several variants. It is tricky which forms accept |
We have two ways:
Any better solutions? |
This bug can also be assigned to me. |
@benshi001 done ;) |
I don't think it is necessary to change the existing checking mechanism. It can be checked at corresponding cases of MOVW in asmout. I don't think creating a new instruction is a good idea. It is not compatible with existing code. |
"It can be checked at corresponding cases of MOVW in asmout." If so, we need not wait to go1.10, it can be done soon in each case of optab. |
It is not where to make the check. The question is among the many variations of MOVW, which should accept the .S bit. For example, I don't think the MVN case you mentioned above should. This is not a critical bug, nor a regression. Let's wait for Go 1.10. |
Now in "func checkBits", the PWS suffixes are checked via (instruction, bit flags), how about change to (Optab.type_, bit flags). For example, Case 1 MOVW accepts .S, but case 12 does not. So the |
|
Change https://golang.org/cl/70910 mentions this issue: |
For "MOVW $0xaaaaaaaa, R1", the constant pool is used and actually it is assembled to "LDR Reg <- off(PC)". And in this case a .S suffix is not supported.
But the current assembler silently generated the right binary code without giving any error message.
The text was updated successfully, but these errors were encountered: