+2018-07-30 Jan Beulich <jbeulich@suse.com>
+
+ PR gas/23465
+ * config/tc-i386.c (output_disp): Restrict scaling.
+ * testsuite/gas/i386/evex-no-scale.s,
+ testsuite/gas/i386/evex-no-scale-32.d
+ testsuite/gas/i386/evex-no-scale-64.d: New.
+ * testsuite/gas/i386/i386.exp: Run new tests.
+
2018-07-30 Andrew Jenner <andrew@codesourcery.com>
* Makefile.am (TARGET_CPU_CFILES): Add entry for C-SKY.
int size = disp_size (n);
offsetT val = i.op[n].disps->X_add_number;
- val = offset_in_range (val >> i.memshift, size);
+ val = offset_in_range (val >> (size == 1 ? i.memshift : 0),
+ size);
p = frag_more (size);
md_number_to_chars (p, val, size);
}
--- /dev/null
+#source: evex-no-scale.s
+#objdump: -dw
+#name: ix86 EVEX no disp scaling
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <disp>:
+ +[a-f0-9]+: 62 f1 7c 48 28 04 05 40 00 00 00 vmovaps 0x40\(,%eax,1\),%zmm0
+ +[a-f0-9]+: 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40\(,%eiz,1\),%zmm0
+ +[a-f0-9]+: 62 f1 7c 48 28 05 40 00 00 00 vmovaps 0x40,%zmm0
+ +[a-f0-9]+: 67 62 f1 7c 48 28 06 40 00 vmovaps 0x40,%zmm0
--- /dev/null
+#source: evex-no-scale.s
+#objdump: -dw
+#name: x86-64 EVEX no disp scaling
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <disp>:
+ +[a-f0-9]+: 62 f1 7c 48 28 05 00 fc ff ff vmovaps -0x400\(%rip\),%zmm0 # .*
+ +[a-f0-9]+: 62 f1 7c 48 28 04 05 40 00 00 00 vmovaps 0x40\(,%rax,1\),%zmm0
+ +[a-f0-9]+: 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40,%zmm0
+ +[a-f0-9]+: 67 62 f1 7c 48 28 04 05 40 00 00 00 vmovaps 0x40\(,%eax,1\),%zmm0
+ +[a-f0-9]+: 67 62 f1 7c 48 28 04 25 40 00 00 00 addr32 vmovaps 0x40,%zmm0
+ +[a-f0-9]+: 62 f1 7c 48 28 04 25 40 00 00 00 vmovaps 0x40,%zmm0
--- /dev/null
+ .allow_index_reg
+ .section .probe, "", @progbits
+.Lprobe_64bit:
+ inc %eax
+.equiv is_64bit, (. - .Lprobe_64bit) / 2
+
+ .text
+disp:
+.if is_64bit
+ vmovaps -1024(%rip), %zmm0
+ vmovaps 64(,%rax), %zmm0
+ vmovaps 64(,%riz), %zmm0
+.endif
+ vmovaps 64(,%eax), %zmm0
+ vmovaps 64(,%eiz), %zmm0
+ vmovaps 64, %zmm0
+.if !is_64bit
+ addr16 vmovaps 64, %zmm0
+.endif
run_dump_test "evex-lig512-intel"
run_dump_test "evex-wig1"
run_dump_test "evex-wig1-intel"
+ run_dump_test "evex-no-scale-32"
run_dump_test "sse2avx"
run_list_test "inval-avx" "-al"
run_list_test "inval-avx512f" "-al"
run_dump_test "x86-64-evex-lig512-intel"
run_dump_test "x86-64-evex-wig1"
run_dump_test "x86-64-evex-wig1-intel"
+ run_dump_test "evex-no-scale-64"
run_dump_test "x86-64-sse2avx"
run_list_test "x86-64-inval-avx" "-al"
run_list_test "x86-64-inval-avx512f" "-al"