Index: lib/Target/X86/X86InstrSystem.td =================================================================== --- lib/Target/X86/X86InstrSystem.td +++ lib/Target/X86/X86InstrSystem.td @@ -32,10 +32,19 @@ def RSM : I<0xAA, RawFrm, (outs), (ins), "rsm", [], IIC_RSM>, TB; // Interrupt and SysCall Instructions. -let Uses = [EFLAGS] in +let Uses = [ESP, EFLAGS], Defs = [ESP, EFLAGS] in { def INTO : I<0xce, RawFrm, (outs), (ins), "into", []>; -def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3", - [(int_x86_int (i8 3))], IIC_INT3>; + + def INT1 : I<0xf1, RawFrm, (outs), (ins), "int1", + [(int_x86_int (i8 1))], IIC_INT>; + + def INT3 : I<0xcc, RawFrm, (outs), (ins), "int3", + [(int_x86_int (i8 3))], IIC_INT3>; + + def INT : Ii8<0xcd, RawFrm, (outs), (ins u8imm:$trap), "int\t$trap", + [(int_x86_int imm:$trap)], IIC_INT>; + +} } // SchedRW // The long form of "int $3" turns into int3 as a size optimization. @@ -44,10 +53,6 @@ let SchedRW = [WriteSystem] in { -def INT : Ii8<0xcd, RawFrm, (outs), (ins u8imm:$trap), "int\t$trap", - [(int_x86_int imm:$trap)], IIC_INT>; - - def SYSCALL : I<0x05, RawFrm, (outs), (ins), "syscall", [], IIC_SYSCALL>, TB; def SYSRET : I<0x07, RawFrm, (outs), (ins), "sysret{l}", [], IIC_SYSCALL>, TB; def SYSRET64 :RI<0x07, RawFrm, (outs), (ins), "sysret{q}", [], IIC_SYSCALL>, TB, Index: test/CodeGen/X86/int-intrinsic.ll =================================================================== --- test/CodeGen/X86/int-intrinsic.ll +++ test/CodeGen/X86/int-intrinsic.ll @@ -3,6 +3,14 @@ declare void @llvm.x86.int(i8) nounwind +; CHECK: int1 +; CHECK: ret +define void @primitive_int1 () { +bb.entry: + call void @llvm.x86.int(i8 1) nounwind + ret void +} + ; CHECK: int3 ; CHECK: ret define void @primitive_int3 () { Index: test/MC/Disassembler/X86/simple-tests.txt =================================================================== --- test/MC/Disassembler/X86/simple-tests.txt +++ test/MC/Disassembler/X86/simple-tests.txt @@ -6,6 +6,12 @@ # CHECK: int $33 0xCD 0x21 +# CHECK: int1 +0xf1 + +# CHECK: int3 +0xcc + # CHECK: jrcxz -127 0xe3 0x81 Index: test/MC/Disassembler/X86/x86-16.txt =================================================================== --- test/MC/Disassembler/X86/x86-16.txt +++ test/MC/Disassembler/X86/x86-16.txt @@ -60,6 +60,9 @@ # CHECK: into 0xce +# CHECK: int1 +0xf1 + # CHECK: int3 0xcc Index: test/MC/Disassembler/X86/x86-32.txt =================================================================== --- test/MC/Disassembler/X86/x86-32.txt +++ test/MC/Disassembler/X86/x86-32.txt @@ -40,6 +40,11 @@ # CHECK: crc32l %eax, %eax 0xf2 0x0f 0x38 0xf1 0xc0 +# CHECK: int1 +0xf1 + +# CHECK: int3 +0xcc # CHECK: int $33 0xCD 0x21 Index: test/MC/X86/x86-16.s =================================================================== --- test/MC/X86/x86-16.s +++ test/MC/X86/x86-16.s @@ -61,6 +61,9 @@ into // CHECK: into // CHECK: encoding: [0xce] +int1 +// CHECK: int1 +// CHECK: encoding: [0xf1] int3 // CHECK: int3 // CHECK: encoding: [0xcc] Index: test/MC/X86/x86-64.s =================================================================== --- test/MC/X86/x86-64.s +++ test/MC/X86/x86-64.s @@ -197,6 +197,10 @@ // CHECK: int3 int $3 +// CHECK: int1 +// CHECK: encoding: [0xf1] +int1 + // Allow scale factor without index register. // CHECK: movaps %xmm3, (%esi)