[PATCH] ARM: bkpt has an implicit immediate constant 0

Saleem Abdulrasool compnerd at compnerd.org
Sun Dec 22 15:47:20 PST 2013


  Added the dropped changes to ARMInst.td

Hi t.p.northover, logan,

http://llvm-reviews.chandlerc.com/D2456

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2456?vs=6228&id=6233#toc

Files:
  lib/Target/ARM/ARMInstrInfo.td
  lib/Target/ARM/ARMInstrThumb.td
  test/MC/ARM/bkpt.s

Index: lib/Target/ARM/ARMInstrInfo.td
===================================================================
--- lib/Target/ARM/ARMInstrInfo.td
+++ lib/Target/ARM/ARMInstrInfo.td
@@ -1725,6 +1725,8 @@
   let Inst{31-28} = 0xe; // AL
   let Inst{7-4} = 0b0111;
 }
+// default immediate for breakpoint mnemonic
+def : InstAlias<"bkpt", (BKPT 0)>, Requires<[IsARM]>;
 
 def HLT : AInoP<(outs), (ins imm0_65535:$val), MiscFrm, NoItinerary,
                  "hlt", "\t$val", []>, Requires<[IsARM, HasV8]> {
Index: lib/Target/ARM/ARMInstrThumb.td
===================================================================
--- lib/Target/ARM/ARMInstrThumb.td
+++ lib/Target/ARM/ARMInstrThumb.td
@@ -300,6 +300,8 @@
   bits<8> val;
   let Inst{7-0} = val;
 }
+// default immediate for breakpoint mnemonic
+def : InstAlias<"bkpt", (tBKPT 0)>, Requires<[IsThumb]>;
 
 def tHLT : T1I<(outs), (ins imm0_63:$val), NoItinerary, "hlt\t$val",
                 []>, T1Encoding<0b101110>, Requires<[IsThumb, HasV8]> {
Index: test/MC/ARM/bkpt.s
===================================================================
--- /dev/null
+++ test/MC/ARM/bkpt.s
@@ -0,0 +1,22 @@
+@ RUN: llvm-mc -triple armv7-unknown-unknown -filetype asm -o - %s | FileCheck %s
+@ XFAIL
+
+	.syntax unified
+	.thumb
+
+	.global default_bkpt
+	.type default_bkpt, %function
+default_bkpt:
+	bkpt
+
+@ CHECK-LABEL: default_bkpt
+@ CHECK: bkpt #0
+
+	.global normal_bkpt
+	.type normal_bkpt, %function
+normal_bkpt:
+	bkpt #42
+
+@ CHECK-LABEL: normal_bkpt
+@ CHECK: bkpt #42
+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2456.2.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131222/e72b8745/attachment.bin>


More information about the llvm-commits mailing list