//===------- M68kInstrBits.td - Bit Manipulation Instrs --*- tablegen -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// /// /// \file /// This file describes the bit manipulation instructions in the M68k /// architecture. Here is the current status of the file: /// /// Machine: /// /// BCNG [ ] BCLR [ ] BSET [ ] BTST [~] /// /// Map: /// /// [ ] - was not touched at all /// [!] - requires extarnal stuff implemented /// [~] - in progress but usable /// [x] - done /// //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // BTST //===----------------------------------------------------------------------===// /// ------------+---------+---------+---------+--------- /// F E D C | B A 9 | 8 7 6 | 5 4 3 | 2 1 0 /// ------------+---------+---------+---------+--------- /// 0 0 0 0 | REG | 1 0 0 | MODE | REG /// ------------+---------+---------+---------+--------- class MxBTSTEnc_R : MxEncoding, REG, MxBead4Bits<0b0000>, EXT.Imm, EXT.B8, EXT.Scale, EXT.WL, EXT.DAReg>; /// -------------------------------+---------+--------- /// F E D C B A 9 8 . 7 6 | 5 4 3 | 2 1 0 /// -------------------------------+---------+--------- /// 0 0 0 0 1 0 0 0 . 0 0 | MODE | REG /// ------------------------+------+---------+--------- /// 0 0 0 0 0 0 0 0 | BIT NUMBER /// ------------------------+-------------------------- class MxBTSTEnc_I : MxEncoding, MxBead4Bits<0b1000>, MxBead4Bits<0b0000>, IMM, EXT.Imm, EXT.B8, EXT.Scale, EXT.WL, EXT.DAReg>; let Defs = [CCR] in { class MxBTST_RR : MxInst<(outs), (ins TYPE.ROp:$dst, TYPE.ROp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBt TYPE.VT:$dst, TYPE.VT:$bitno))], MxBTSTEnc_R, MxEncEAd_0, MxExtEmpty>>; class MxBTST_RI : MxInst<(outs), (ins TYPE.ROp:$dst, TYPE.IOp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBt TYPE.VT:$dst, TYPE.IPat:$bitno))], MxBTSTEnc_I, MxEncEAd_0, MxExtEmpty>>; class MxBTST_MR : MxInst<(outs), (ins MEMOpd:$dst, TYPE.ROp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBt (TYPE.Load MEMPat:$dst), TYPE.VT:$bitno))], MxBTSTEnc_R, EA, EXT>>; class MxBTST_MI : MxInst<(outs), (ins MEMOpd:$dst, TYPE.IOp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBt (TYPE.Load MEMPat:$dst), TYPE.IPat:$bitno))], MxBTSTEnc_I, EA, EXT>>; } // Defs = [CCR] // Register BTST limited to 32 bits only def BTST32dd : MxBTST_RR; def BTST32di : MxBTST_RI; // Memory BTST limited to 8 bits only def BTST8jd : MxBTST_MR; def BTST8pd : MxBTST_MR; def BTST8fd : MxBTST_MR; def BTST8qd : MxBTST_MR; def BTST8kd : MxBTST_MR; def BTST8ji : MxBTST_MI; def BTST8pi : MxBTST_MI; def BTST8fi : MxBTST_MI; def BTST8qi : MxBTST_MI; def BTST8ki : MxBTST_MI;