//===-- 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: /// /// BCHG [ ] 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 { dag Value = (ascend (descend 0b0000, (operand "$"#bitno_name, 3), 0b100, dst_enc.EA ), dst_enc.Supplement ); } /// -------------------------------+---------+--------- /// 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 { dag Value = (ascend (descend 0b0000100000, dst_enc.EA), (descend 0b00000000, (operand "$"#bitno_name, 8)), dst_enc.Supplement ); } let Defs = [CCR] in { class MxBTST_RR : MxInst<(outs), (ins TYPE.ROp:$dst, TYPE.ROp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBtst TYPE.VT:$dst, TYPE.VT:$bitno))]> { let Inst = MxBTSTEnc_R, "bitno">.Value; } class MxBTST_RI : MxInst<(outs), (ins TYPE.ROp:$dst, TYPE.IOp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBtst TYPE.VT:$dst, TYPE.IPat:$bitno))]> { let Inst = MxBTSTEnc_I, "bitno">.Value; } class MxBTST_MR : MxInst<(outs), (ins MEMOpd:$dst, TYPE.ROp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBtst (TYPE.Load MEMPat:$dst), TYPE.VT:$bitno))]> { let Inst = MxBTSTEnc_R.Value; } class MxBTST_MI : MxInst<(outs), (ins MEMOpd:$dst, TYPE.IOp:$bitno), "btst\t$bitno, $dst", [(set CCR, (MxBtst (TYPE.Load MEMPat:$dst), TYPE.IPat:$bitno))]> { let Inst = MxBTSTEnc_I.Value; } } // 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 BTST8od : MxBTST_MR>; def BTST8ed : MxBTST_MR>; def BTST8pd : MxBTST_MR>; def BTST8fd : MxBTST_MR>; def BTST8qd : MxBTST_MR>; def BTST8kd : MxBTST_MR>; def BTST8ji : MxBTST_MI>; def BTST8oi : MxBTST_MI>; def BTST8ei : MxBTST_MI>; def BTST8pi : MxBTST_MI>; def BTST8fi : MxBTST_MI>; def BTST8qi : MxBTST_MI>; def BTST8ki : MxBTST_MI>;