Bug 15159 - binutils lacks Intel SMAP support (clac and stac instructions)
Summary: binutils lacks Intel SMAP support (clac and stac instructions)
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.24
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-19 13:42 UTC by Mikael Pettersson
Modified: 2013-02-19 19:14 UTC (History)
0 users

See Also:
Host:
Target: x86_64-*, i386-*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pettersson 2013-02-19 13:42:24 UTC
The Intel SMAP instructions "clac" and "stac" aren't supported by current binutils, c.f. a build of yesterday's head:

> cat smap1.s
.text
clac
stac
> gas/as-new -o smap1.o smap1.s
smap1.s: Assembler messages:
smap1.s:2: Error: no such instruction: `clac'
smap1.s:3: Error: no such instruction: `stac'
> cat smap2.s
.text
.byte 0x0f,0x01,0xca
.byte 0x0f,0x01,0xcb
> gas/as-new -o smap2.o smap2.s
> binutils/objdump -d smap2.o 

smap2.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <.text>:
   0:   0f 01                   (bad)  
   2:   ca 0f 01                lret   $0x10f
   5:   cb                      lret
Comment 1 Sourceware Commits 2013-02-19 19:10:45 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	hjl@sourceware.org	2013-02-19 19:10:36

Modified files:
	gas            : ChangeLog 
	gas/config     : tc-i386.c 
	gas/doc        : c-i386.texi 
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/i386: i386.exp 
	opcodes        : ChangeLog i386-dis.c i386-gen.c i386-init.h 
	                 i386-opc.h i386-opc.tbl i386-tbl.h 
Added files:
	gas/testsuite/gas/i386: smap.d smap.s x86-64-smap.d 

Log message:
	Implement Intel SMAP instructions
	
	gas/
	
	PR gas/15159
	* config/tc-i386.c (cpu_arch): Add ".smap".
	
	* doc/c-i386.texi: Document smap.
	
	gas/testsuite/
	
	PR gas/15159
	* gas/i386/i386.exp: Run smap and x86-64-smap.
	
	* gas/i386/smap.d: New file.
	* gas/i386/smap.s: likewise.
	* gas/i386/x86-64-smap.d: likewise.
	
	opcodes/
	
	PR gas/15159
	* i386-dis.c (rm_table): Add clac and stac to RM_0F01_REG_1.
	
	* i386-gen.c (cpu_flag_init): Add CPU_SMAP_FLAGS.
	(cpu_flags): Add CpuSMAP.
	
	* i386-opc.h (CpuSMAP): New.
	(i386_cpu_flags): Add cpusmap.
	
	* i386-opc.tbl: Add clac and stac.
	
	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/ChangeLog.diff?cvsroot=src&r1=1.4932&r2=1.4933
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/config/tc-i386.c.diff?cvsroot=src&r1=1.513&r2=1.514
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/doc/c-i386.texi.diff?cvsroot=src&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2189&r2=1.2190
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/smap.d.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/smap.s.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/x86-64-smap.d.diff?cvsroot=src&r1=NONE&r2=1.1
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/i386/i386.exp.diff?cvsroot=src&r1=1.182&r2=1.183
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&r1=1.1938&r2=1.1939
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-dis.c.diff?cvsroot=src&r1=1.274&r2=1.275
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-gen.c.diff?cvsroot=src&r1=1.91&r2=1.92
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-init.h.diff?cvsroot=src&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-opc.h.diff?cvsroot=src&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-opc.tbl.diff?cvsroot=src&r1=1.109&r2=1.110
http://sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/i386-tbl.h.diff?cvsroot=src&r1=1.114&r2=1.115
Comment 2 H.J. Lu 2013-02-19 19:14:18 UTC
Fixed.