[GASPP] Comment out "it" instructions for armasm

Message ID 20191002085328.15337-1-martin@martin.st
State New
Headers show
Series
  • [GASPP] Comment out "it" instructions for armasm
Related show

Commit Message

Martin Storsjö Oct. 2, 2019, 8:53 a.m.
Armasm implicitly adds it instructions as needed. In VS 2019 16.3,
there's a bug [1] in armasm making it fail to parse these it instructions
(but it can still add them implicitly just fine).

I'm not sure if it really is worth working around this issue, or just
wait for it to hopefully be fixed by the next release again.

[1] https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html
---
 gas-preprocessor.pl | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Janne Grunau Oct. 3, 2019, 9:45 a.m. | #1
On 2019-10-02 11:53:28 +0300, Martin Storsjö wrote:
> Armasm implicitly adds it instructions as needed. In VS 2019 16.3,
> there's a bug [1] in armasm making it fail to parse these it instructions
> (but it can still add them implicitly just fine).
> 
> I'm not sure if it really is worth working around this issue, or just
> wait for it to hopefully be fixed by the next release again.
> 
> [1] https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html
> ---
>  gas-preprocessor.pl | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
> index b6c2786..9d8fb5d 100755
> --- a/gas-preprocessor.pl
> +++ b/gas-preprocessor.pl
> @@ -1168,6 +1168,10 @@ sub handle_serialized_line {
>          $line =~ s/fmxr/vmsr/;
>          $line =~ s/fmrx/vmrs/;
>          $line =~ s/fadds/vadd.f32/;
> +        # Armasm in VS 2019 16.3 errors out on "it" instructions. But
> +        # armasm implicitly adds the necessary it instructions anyway, so we
> +        # can just filter it out.
> +        $line =~ s/^\s*it[te]*\s+/$comm$&/;
>      }
>      if ($as_type eq "armasm" and $arch eq "aarch64") {
>          # Convert "b.eq" into "beq"

I guess ok-ish since armasm can handle implicit it instructions. Do you 
have expectation when a fixed version might be released? If it's more 
than a couple of weeks I'd say the workaround is worth it.

Janne
Martin Storsjö Oct. 3, 2019, 10:05 a.m. | #2
On Thu, 3 Oct 2019, Janne Grunau wrote:

> On 2019-10-02 11:53:28 +0300, Martin Storsjö wrote:
>> Armasm implicitly adds it instructions as needed. In VS 2019 16.3,
>> there's a bug [1] in armasm making it fail to parse these it instructions
>> (but it can still add them implicitly just fine).
>> 
>> I'm not sure if it really is worth working around this issue, or just
>> wait for it to hopefully be fixed by the next release again.
>> 
>> [1] https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html
>> ---
>>  gas-preprocessor.pl | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
>> index b6c2786..9d8fb5d 100755
>> --- a/gas-preprocessor.pl
>> +++ b/gas-preprocessor.pl
>> @@ -1168,6 +1168,10 @@ sub handle_serialized_line {
>>          $line =~ s/fmxr/vmsr/;
>>          $line =~ s/fmrx/vmrs/;
>>          $line =~ s/fadds/vadd.f32/;
>> +        # Armasm in VS 2019 16.3 errors out on "it" instructions. But
>> +        # armasm implicitly adds the necessary it instructions anyway, so we
>> +        # can just filter it out.
>> +        $line =~ s/^\s*it[te]*\s+/$comm$&/;
>>      }
>>      if ($as_type eq "armasm" and $arch eq "aarch64") {
>>          # Convert "b.eq" into "beq"
>
> I guess ok-ish since armasm can handle implicit it instructions. Do you 
> have expectation when a fixed version might be released? If it's more 
> than a couple of weeks I'd say the workaround is worth it.

There's roughly one stable release per 3 months, and the first preview for 
the next one (16.4) was already posted. In some cases, bugfixes do get 
into the next release (if deemed urgent enough I guess), but otherwise 
into current+2. So estimate of fix in a stable release is anywhere between 
2 and 5 months maybe.

If I would have caught this in August when the first preview actually 
containing the new broken armasm was out, it might have been possible to 
have it fixed sooner...

// Martin
Martin Storsjö Oct. 4, 2019, 12:37 p.m. | #3
On Thu, 3 Oct 2019, Martin Storsjö wrote:

> On Thu, 3 Oct 2019, Janne Grunau wrote:
>
>> On 2019-10-02 11:53:28 +0300, Martin Storsjö wrote:
>>> Armasm implicitly adds it instructions as needed. In VS 2019 16.3,
>>> there's a bug [1] in armasm making it fail to parse these it instructions
>>> (but it can still add them implicitly just fine).
>>> 
>>> I'm not sure if it really is worth working around this issue, or just
>>> wait for it to hopefully be fixed by the next release again.
>>> 
>>> [1] 
> https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html
>>> ---
>>>  gas-preprocessor.pl | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
>>> index b6c2786..9d8fb5d 100755
>>> --- a/gas-preprocessor.pl
>>> +++ b/gas-preprocessor.pl
>>> @@ -1168,6 +1168,10 @@ sub handle_serialized_line {
>>>          $line =~ s/fmxr/vmsr/;
>>>          $line =~ s/fmrx/vmrs/;
>>>          $line =~ s/fadds/vadd.f32/;
>>> +        # Armasm in VS 2019 16.3 errors out on "it" instructions. But
>>> +        # armasm implicitly adds the necessary it instructions anyway, so 
> we
>>> +        # can just filter it out.
>>> +        $line =~ s/^\s*it[te]*\s+/$comm$&/;
>>>      }
>>>      if ($as_type eq "armasm" and $arch eq "aarch64") {
>>>          # Convert "b.eq" into "beq"
>>
>> I guess ok-ish since armasm can handle implicit it instructions. Do you 
>> have expectation when a fixed version might be released? If it's more 
>> than a couple of weeks I'd say the workaround is worth it.
>
> There's roughly one stable release per 3 months, and the first preview for 
> the next one (16.4) was already posted. In some cases, bugfixes do get 
> into the next release (if deemed urgent enough I guess), but otherwise 
> into current+2. So estimate of fix in a stable release is anywhere between 
> 2 and 5 months maybe.
>
> If I would have caught this in August when the first preview actually 
> containing the new broken armasm was out, it might have been possible to 
> have it fixed sooner...

Pushed both of these now.

// Martin
Martin Storsjö Oct. 10, 2019, 7:04 p.m. | #4
On Thu, 3 Oct 2019, Martin Storsjö wrote:

> On Thu, 3 Oct 2019, Janne Grunau wrote:
>
>> On 2019-10-02 11:53:28 +0300, Martin Storsjö wrote:
>>> Armasm implicitly adds it instructions as needed. In VS 2019 16.3,
>>> there's a bug [1] in armasm making it fail to parse these it instructions
>>> (but it can still add them implicitly just fine).
>>> 
>>> I'm not sure if it really is worth working around this issue, or just
>>> wait for it to hopefully be fixed by the next release again.
>>> 
>>> [1] 
> https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html
>>> ---
>>>  gas-preprocessor.pl | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>> 
>>> diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
>>> index b6c2786..9d8fb5d 100755
>>> --- a/gas-preprocessor.pl
>>> +++ b/gas-preprocessor.pl
>>> @@ -1168,6 +1168,10 @@ sub handle_serialized_line {
>>>          $line =~ s/fmxr/vmsr/;
>>>          $line =~ s/fmrx/vmrs/;
>>>          $line =~ s/fadds/vadd.f32/;
>>> +        # Armasm in VS 2019 16.3 errors out on "it" instructions. But
>>> +        # armasm implicitly adds the necessary it instructions anyway, so 
> we
>>> +        # can just filter it out.
>>> +        $line =~ s/^\s*it[te]*\s+/$comm$&/;
>>>      }
>>>      if ($as_type eq "armasm" and $arch eq "aarch64") {
>>>          # Convert "b.eq" into "beq"
>>
>> I guess ok-ish since armasm can handle implicit it instructions. Do you 
>> have expectation when a fixed version might be released? If it's more 
>> than a couple of weeks I'd say the workaround is worth it.
>
> There's roughly one stable release per 3 months, and the first preview for 
> the next one (16.4) was already posted. In some cases, bugfixes do get 
> into the next release (if deemed urgent enough I guess), but otherwise 
> into current+2. So estimate of fix in a stable release is anywhere between 
> 2 and 5 months maybe.

https://developercommunity.visualstudio.com/content/problem/757709/armasm-fails-to-handle-it-instructions.html

They confirmed the bug and told that it should be fixed in 16.5, which is 
due in about 5 months.

// Martin

Patch

diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl
index b6c2786..9d8fb5d 100755
--- a/gas-preprocessor.pl
+++ b/gas-preprocessor.pl
@@ -1168,6 +1168,10 @@  sub handle_serialized_line {
         $line =~ s/fmxr/vmsr/;
         $line =~ s/fmrx/vmrs/;
         $line =~ s/fadds/vadd.f32/;
+        # Armasm in VS 2019 16.3 errors out on "it" instructions. But
+        # armasm implicitly adds the necessary it instructions anyway, so we
+        # can just filter it out.
+        $line =~ s/^\s*it[te]*\s+/$comm$&/;
     }
     if ($as_type eq "armasm" and $arch eq "aarch64") {
         # Convert "b.eq" into "beq"