diff options
author | Jan Beulich <jbeulich@suse.com> | 2024-06-28 08:19:32 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2024-06-28 08:19:32 +0200 |
commit | c7eae03eab750f93b6460e883f25b71d46dd1c47 (patch) | |
tree | 66525e230d31b82444d94c01410f45bec81e6a2a /gas/testsuite | |
parent | 0868b8999bbca960781e7d8bbbc363536193a694 (diff) | |
download | gdb-c7eae03eab750f93b6460e883f25b71d46dd1c47.zip gdb-c7eae03eab750f93b6460e883f25b71d46dd1c47.tar.gz gdb-c7eae03eab750f93b6460e883f25b71d46dd1c47.tar.bz2 |
x86/APX: optimize {nf}-form rotate-by-width-less-1
Unlike for the legacy forms, where there's a difference in the resulting
EFLAGS.CF, for the NF variants the immediate can be got rid of in that
case by switching to a 1-bit rotate in the opposite direction.
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-apx-nf-optimize.d | 32 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-apx-nf.s | 20 |
2 files changed, 52 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/x86-64-apx-nf-optimize.d b/gas/testsuite/gas/i386/x86-64-apx-nf-optimize.d index ac05943..1056169 100644 --- a/gas/testsuite/gas/i386/x86-64-apx-nf-optimize.d +++ b/gas/testsuite/gas/i386/x86-64-apx-nf-optimize.d @@ -1480,4 +1480,36 @@ Disassembly of section \.text: [ ]*[a-f0-9]+:[ ]*62 f4 74 1c ff 00[ ]+\{nf\} inc \(%rax\),%ecx [ ]*[a-f0-9]+:[ ]*62 f4 fc 0c ff 00[ ]+\{nf\} incq \(%rax\) [ ]*[a-f0-9]+:[ ]*62 f4 b4 1c ff 00[ ]+\{nf\} inc \(%rax\),%r9 +[ ]*[a-f0-9]+:[ ]*62 f4 7c 0c d0 ca[ ]+\{nf\} ror \$1,%dl +[ ]*[a-f0-9]+:[ ]*62 f4 7c 1c d0 ca[ ]+\{nf\} ror \$1,%dl,%al +[ ]*[a-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f0-9]+:[ ]*62 f4 7d 1c d1 c2[ ]+\{nf\} rol \$1,%dx,%ax +[ ]*[a-f0-9]+:[ ]*62 f4 7c 0c d1 c2[ ]+\{nf\} rol \$1,%edx +[ ]*[a-f0-9]+:[ ]*62 f4 7c 1c d1 c2[ ]+\{nf\} rol \$1,%edx,%eax +[ ]*[a-f0-9]+:[ ]*62 f4 fc 0c d1 c2[ ]+\{nf\} rol \$1,%rdx +[ ]*[a-f0-9]+:[ ]*62 f4 fc 1c d1 c2[ ]+\{nf\} rol \$1,%rdx,%rax +[ ]*[a-f0-9]+:[ ]*62 f4 7c 0c d0 02[ ]+\{nf\} rolb \$1,\(%rdx\) +[ ]*[a-f0-9]+:[ ]*62 f4 7c 1c d0 02[ ]+\{nf\} rol \$1,\(%rdx\),%al +[ ]*[a-f0-9]+:[ ]*62 f4 7d 0c d1 02[ ]+\{nf\} rolw \$1,\(%rdx\) +[ ]*[a-f0-9]+:[ ]*62 f4 7d 1c d1 02[ ]+\{nf\} rol \$1,\(%rdx\),%ax +[ ]*[a-f0-9]+:[ ]*62 f4 7c 0c d1 02[ ]+\{nf\} roll \$1,\(%rdx\) +[ ]*[a-f0-9]+:[ ]*62 f4 7c 1c d1 02[ ]+\{nf\} rol \$1,\(%rdx\),%eax +[ ]*[a-f0-9]+:[ ]*62 f4 fc 0c d1 02[ ]+\{nf\} rolq \$1,\(%rdx\) +[ ]*[a-f0-9]+:[ ]*62 f4 fc 1c d1 02[ ]+\{nf\} rol \$1,\(%rdx\),%rax #pass diff --git a/gas/testsuite/gas/i386/x86-64-apx-nf.s b/gas/testsuite/gas/i386/x86-64-apx-nf.s index acb4ba6..14f6526 100644 --- a/gas/testsuite/gas/i386/x86-64-apx-nf.s +++ b/gas/testsuite/gas/i386/x86-64-apx-nf.s @@ -1433,3 +1433,23 @@ optimize: {nf} \op\()q $-1, (%rax) {nf} \op $-1, (%rax), %r9 .endr + + .irp dir, l, r + {nf} ro\dir $7, %dl + {nf} ro\dir $7, %dl, %al + {nf} ro\dir $15, %dx + {nf} ro\dir $15, %dx, %ax + {nf} ro\dir $31, %edx + {nf} ro\dir $31, %edx, %eax + {nf} ro\dir $63, %rdx + {nf} ro\dir $63, %rdx, %rax + + {nf} ro\dir\()b $7, (%rdx) + {nf} ro\dir $7, (%rdx), %al + {nf} ro\dir\()w $15, (%rdx) + {nf} ro\dir $15, (%rdx), %ax + {nf} ro\dir\()l $31, (%rdx) + {nf} ro\dir $31, (%rdx), %eax + {nf} ro\dir\()q $63, (%rdx) + {nf} ro\dir $63, (%rdx), %rax + .endr |