# This file is auto-generated by /codegen/x86_64_test_encoding.py
# Reference opcodes are generated by:
#     GNU assembler (GNU Binutils) 2.28.51.20170402

from peachpy.x86_64 import *
import unittest


class TestKADDB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x4A, 0xED]), KADDB(k5, k5, k5).encode())


class TestKADDW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x4A, 0xED]), KADDW(k5, k5, k5).encode())


class TestKADDD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x4A, 0xED]), KADDD(k5, k5, k5).encode())


class TestKADDQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x4A, 0xED]), KADDQ(k5, k5, k5).encode())


class TestKANDB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x41, 0xED]), KANDB(k5, k5, k5).encode())


class TestKANDW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x41, 0xED]), KANDW(k5, k5, k5).encode())


class TestKANDD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x41, 0xED]), KANDD(k5, k5, k5).encode())


class TestKANDQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x41, 0xED]), KANDQ(k5, k5, k5).encode())


class TestKANDNB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x42, 0xED]), KANDNB(k5, k5, k5).encode())


class TestKANDNW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x42, 0xED]), KANDNW(k5, k5, k5).encode())


class TestKANDND(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x42, 0xED]), KANDND(k5, k5, k5).encode())


class TestKANDNQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x42, 0xED]), KANDNQ(k5, k5, k5).encode())


class TestKORB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x45, 0xED]), KORB(k5, k5, k5).encode())


class TestKORW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x45, 0xED]), KORW(k5, k5, k5).encode())


class TestKORD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x45, 0xED]), KORD(k5, k5, k5).encode())


class TestKORQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x45, 0xED]), KORQ(k5, k5, k5).encode())


class TestKXNORB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x46, 0xED]), KXNORB(k5, k5, k5).encode())


class TestKXNORW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x46, 0xED]), KXNORW(k5, k5, k5).encode())


class TestKXNORD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x46, 0xED]), KXNORD(k5, k5, k5).encode())


class TestKXNORQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x46, 0xED]), KXNORQ(k5, k5, k5).encode())


class TestKXORB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x47, 0xED]), KXORB(k5, k5, k5).encode())


class TestKXORW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x47, 0xED]), KXORW(k5, k5, k5).encode())


class TestKXORD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD5, 0x47, 0xED]), KXORD(k5, k5, k5).encode())


class TestKXORQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x47, 0xED]), KXORQ(k5, k5, k5).encode())


class TestKMOVB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF9, 0x90, 0xED]), KMOVB(k5, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x79, 0x92, 0xE8]), KMOVB(k5, r8d).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x79, 0x90, 0x6E, 0x40]), KMOVB(k5, byte[r14 + 64]).encode())
        self.assertEqual(bytearray([0xC5, 0xF9, 0x93, 0xED]), KMOVB(ebp, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x79, 0x91, 0x6E, 0xC0]), KMOVB(byte[r14 - 64], k5).encode())


class TestKMOVW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF8, 0x90, 0xED]), KMOVW(k5, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x78, 0x92, 0xE8]), KMOVW(k5, r8d).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x78, 0x90, 0x6D, 0x40]), KMOVW(k5, word[r13 + 64]).encode())
        self.assertEqual(bytearray([0xC5, 0xF8, 0x93, 0xED]), KMOVW(ebp, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x78, 0x91, 0x6D, 0xC0]), KMOVW(word[r13 - 64], k5).encode())


class TestKMOVD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF9, 0x90, 0xED]), KMOVD(k5, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0x7B, 0x92, 0xE8]), KMOVD(k5, r8d).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0xF9, 0x90, 0x6C, 0x24, 0x40]), KMOVD(k5, dword[r12 + 64]).encode())
        self.assertEqual(bytearray([0xC5, 0xFB, 0x93, 0xED]), KMOVD(ebp, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0xF9, 0x91, 0x6C, 0x24, 0xC0]), KMOVD(dword[r12 - 64], k5).encode())


class TestKMOVQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF8, 0x90, 0xED]), KMOVQ(k5, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0xFB, 0x92, 0xEF]), KMOVQ(k5, r15).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0xF8, 0x90, 0x6B, 0x40]), KMOVQ(k5, qword[r11 + 64]).encode())
        self.assertEqual(bytearray([0xC4, 0xE1, 0xFB, 0x93, 0xCD]), KMOVQ(rcx, k5).encode())
        self.assertEqual(bytearray([0xC4, 0xC1, 0xF8, 0x91, 0x6B, 0xC0]), KMOVQ(qword[r11 - 64], k5).encode())


class TestKNOTB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF9, 0x44, 0xED]), KNOTB(k5, k5).encode())


class TestKNOTW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF8, 0x44, 0xED]), KNOTW(k5, k5).encode())


class TestKNOTD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF9, 0x44, 0xED]), KNOTD(k5, k5).encode())


class TestKNOTQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF8, 0x44, 0xED]), KNOTQ(k5, k5).encode())


class TestKUNPCKBW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD5, 0x4B, 0xED]), KUNPCKBW(k5, k5, k5).encode())


class TestKUNPCKWD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xD4, 0x4B, 0xED]), KUNPCKWD(k5, k5, k5).encode())


class TestKUNPCKDQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xD4, 0x4B, 0xED]), KUNPCKDQ(k5, k5, k5).encode())


class TestKTESTB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF9, 0x99, 0xED]), KTESTB(k5, k5).encode())


class TestKTESTW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF8, 0x99, 0xED]), KTESTW(k5, k5).encode())


class TestKTESTD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF9, 0x99, 0xED]), KTESTD(k5, k5).encode())


class TestKTESTQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF8, 0x99, 0xED]), KTESTQ(k5, k5).encode())


class TestKORTESTB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF9, 0x98, 0xED]), KORTESTB(k5, k5).encode())


class TestKORTESTW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC5, 0xF8, 0x98, 0xED]), KORTESTW(k5, k5).encode())


class TestKORTESTD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF9, 0x98, 0xED]), KORTESTD(k5, k5).encode())


class TestKORTESTQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE1, 0xF8, 0x98, 0xED]), KORTESTQ(k5, k5).encode())


class TestKSHIFTLB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0x79, 0x32, 0xED, 0x02]), KSHIFTLB(k5, k5, 2).encode())


class TestKSHIFTLW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0xF9, 0x32, 0xED, 0x02]), KSHIFTLW(k5, k5, 2).encode())


class TestKSHIFTLD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0x79, 0x33, 0xED, 0x02]), KSHIFTLD(k5, k5, 2).encode())


class TestKSHIFTLQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0xF9, 0x33, 0xED, 0x02]), KSHIFTLQ(k5, k5, 2).encode())


class TestKSHIFTRB(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0x79, 0x30, 0xED, 0x02]), KSHIFTRB(k5, k5, 2).encode())


class TestKSHIFTRW(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0xF9, 0x30, 0xED, 0x02]), KSHIFTRW(k5, k5, 2).encode())


class TestKSHIFTRD(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0x79, 0x31, 0xED, 0x02]), KSHIFTRD(k5, k5, 2).encode())


class TestKSHIFTRQ(unittest.TestCase):
    def runTest(self):
        self.assertEqual(bytearray([0xC4, 0xE3, 0xF9, 0x31, 0xED, 0x02]), KSHIFTRQ(k5, k5, 2).encode())


