Documentation on INT1 can be found here:
http://www.rcollins.org/secrets/opcodes/ICEBP.html
Details
- Reviewers
craig.topper
Diff Detail
- Build Status
Buildable 3362 Build 3362: arc lint + arc unit
Event Timeline
I'd prefer not to use an undocumented instruction in codegen unless gcc or other major compiler does. Do you know if they do?
I will work on searching through our bug reports to try and figure out what generated the undocumented instruction. We have been using this patch since llvm 3.2, so I can't remember what generated this instruction.
I don't agree with it being generated by the compiler in a normal circumstance either, but i would say that it should be available to the assembler, or an intrinsic.
I can remove the int1 from the intrinsic. No other compiler will generate this, and it is normally generated by certain debuggers. I was able to find out that this was documented in the AMD opcode map.
I also found out that this instruction is supported by intel XED. https://github.com/intelxed/xed/blob/eb45a282de284ec2574e2b54460b37b7e587996c/datafiles/xed-isa.txt#L8238
I just found out NASM generates this opcode for both x86 and x64. In the manual it refers to it as icebp, and says that it accepts the alias int1. I was thinking about renaming this instruction to icebp so that it is not generated by a typo in assembly. Also, the lit tests seem to match int $1 when the check line is int1
lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
35 | The instructions don't really modify ESP or EFLAGS. I would expect them to be restored when the interrupt handler returned. So from the perspective of the code with the INT insturction they aren't changed. |
lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
35 | The flags are pushed onto the stack, and if the INT causes an exception they will not be popped from the stack when the exception handler is called. |
lib/Target/X86/X86InstrSystem.td | ||
---|---|---|
35 | I explained that poorly in my previous comment. The following is taken from the intel manual:
Also, in the case of windows SEH, the stack should be unwound, but the flags will not be restored. |
The instructions don't really modify ESP or EFLAGS. I would expect them to be restored when the interrupt handler returned. So from the perspective of the code with the INT insturction they aren't changed.