This is a maintenance fork
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

336 lines
11 KiB

/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
vi: set et ft=asm ts=8 sw=8 fenc=utf-8 :vi
Copyright 2018 Intel Corporation
Copyright 2020 Justine Alexandra Roberts Tunney
Licensed under the Apache License, Version 2.0 (the "License"); │
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "libc/macros.h"
/ Phash tables for instruction length decoding.
/ @see build/rle.py for more context here
.initbss 300,_init_x86tab
xed_prefix_table_bit:
.zero 32
.endobj xed_prefix_table_bit,globl,hidden
xed_has_modrm_2d:
.zero 512
.endobj xed_has_modrm_2d,globl,hidden
xed_has_disp_regular:
.zero 96
.endobj xed_has_disp_regular,globl,hidden
xed_has_sib_table:
.zero 96
.endobj xed_has_sib_table,globl,hidden
xed_disp_bits_2d:
.zero 512
.endobj xed_disp_bits_2d,globl,hidden
xed_imm_bits_2d:
.zero 512
.endobj xed_imm_bits_2d,globl,hidden
.previous
.initro 300,_init_x86tab # 536 bytes (30%)
xed_prefix_table_bit.rodata:
.byte 4,0x00 # 0003
.byte 4,0x40 # 0407
.byte 2,0xff # 0809
.byte 2,0x00 # 0a0b
.byte 1,0xf0 # 0c0c
.byte 17,0x00 # 0d1d
.byte 1,0x0d # 1e1e
.byte 1,0x00 # 1f1f
.endobj xed_prefix_table_bit.rodata
xed_has_modrm_2d.rodata:
.byte 4,0x01 # 0003
.byte 4,0x00 # 0407
.byte 4,0x01 # 080b
.byte 3,0x00 # 0c0e
.byte 1,0x03 # 0f0f
.byte 4,0x01 # 1013
.byte 4,0x00 # 1417
.byte 4,0x01 # 181b
.byte 4,0x00 # 1c1f
.byte 4,0x01 # 2023 #
.byte 2,0x00 # 2425 $%
.byte 1,0x03 # 2626 &
.byte 1,0x00 # 2727 '
.byte 4,0x01 # 282b (+
.byte 2,0x00 # 2c2d ,
.byte 1,0x03 # 2e2e .
.byte 1,0x00 # 2f2f /
.byte 4,0x01 # 3033 03
.byte 2,0x00 # 3435 45
.byte 1,0x03 # 3636 6
.byte 1,0x00 # 3737 7
.byte 4,0x01 # 383b 8;
.byte 2,0x00 # 3c3d <=
.byte 1,0x03 # 3e3e >
.byte 35,0x00 # 3f61 ?a
.byte 2,0x01 # 6263 bc
.byte 4,0x03 # 6467 dg
.byte 1,0x00 # 6868 h
.byte 1,0x01 # 6969 i
.byte 1,0x00 # 6a6a j
.byte 1,0x01 # 6b6b k
.byte 20,0x00 # 6c7f l
.byte 16,0x01 # 808f ÇÅ
.byte 48,0x00 # 90bf É
.byte 2,0x01 # c0c1
.byte 2,0x00 # c2c3
.byte 4,0x01 # c4c7
.byte 8,0x00 # c8cf
.byte 4,0x01 # d0d3
.byte 4,0x00 # d4d7
.byte 8,0x01 # d8df
.byte 16,0x00 # e0ef α
.byte 1,0x03 # f0f0
.byte 1,0x00 # f1f1 ±
.byte 2,0x03 # f2f3
.byte 2,0x00 # f4f5
.byte 2,0x01 # f6f7 ÷
.byte 6,0x00 # f8fd °²
.byte 6,0x01 # fe103
.byte 1,0x03 # 104104
.byte 5,0x00 # 105109
.byte 1,0x03 # 10a10a
.byte 1,0x00 # 10b10b
.byte 1,0x03 # 10c10c
.byte 1,0x01 # 10d10d
.byte 1,0x00 # 10e10e
.byte 1,0x03 # 10f10f
.byte 16,0x01 # 11011f
.byte 4,0x02 # 120123
.byte 4,0x03 # 124127
.byte 8,0x01 # 12812f
.byte 6,0x00 # 130135
.byte 1,0x03 # 136136
.byte 1,0x00 # 137137
.byte 8,0x03 # 13813f
.byte 55,0x01 # 140176
.byte 1,0x00 # 177177
.byte 8,0x01 # 17817f
.byte 16,0x00 # 18018f
.byte 16,0x01 # 19019f
.byte 3,0x00 # 1a01a2
.byte 3,0x01 # 1a31a5
.byte 2,0x03 # 1a61a7
.byte 3,0x00 # 1a81aa
.byte 29,0x01 # 1ab1c7
.byte 8,0x00 # 1c81cf
.byte 48,0x01 # 1d01ff
.endobj xed_has_modrm_2d.rodata
xed_has_disp_regular.rodata:
.byte 6,0x00 # 0005
.byte 1,0x02 # 0606
.byte 1,0x00 # 0707
.byte 8,0x01 # 080f
.byte 8,0x02 # 1017
.byte 13,0x00 # 1824 $
.byte 1,0x04 # 2525 %
.byte 2,0x00 # 2627 &'
.byte 8,0x01 # 282f (/
.byte 8,0x04 # 3037 07
.byte 13,0x00 # 3844 8D
.byte 1,0x04 # 4545 E
.byte 2,0x00 # 4647 FG
.byte 8,0x01 # 484f HO
.byte 8,0x04 # 5057 PW
.byte 8,0x00 # 585f X_
.endobj xed_has_disp_regular.rodata
xed_has_sib_table.rodata:
.byte 36,FALSE # 0023 #
.byte 1,TRUE # 2424 $
.byte 7,FALSE # 252b %+
.byte 1,TRUE # 2c2c ,
.byte 7,FALSE # 2d33 3
.byte 1,TRUE # 3434 4
.byte 15,FALSE # 3543 5C
.byte 1,TRUE # 4444 D
.byte 7,FALSE # 454b EK
.byte 1,TRUE # 4c4c L
.byte 7,FALSE # 4d53 MS
.byte 1,TRUE # 5454 T
.byte 11,FALSE # 555f U_
.endobj xed_has_sib_table.rodata
xed_disp_bits_2d.rodata:
.byte 15,0x04 # 000e
.byte 1,0x00 # 0f0f
.byte 22,0x04 # 1025 %
.byte 1,0x00 # 2626 &
.byte 7,0x04 # 272d '
.byte 1,0x00 # 2e2e .
.byte 7,0x04 # 2f35 /5
.byte 1,0x00 # 3636 6
.byte 7,0x04 # 373d 7=
.byte 1,0x00 # 3e3e >
.byte 37,0x04 # 3f63 ?c
.byte 4,0x00 # 6467 dg
.byte 8,0x04 # 686f ho
.byte 16,0x01 # 707f p
.byte 26,0x04 # 8099 ÇÖ
.byte 1,0x02 # 9a9a Ü
.byte 5,0x04 # 9b9f ¢ƒ
.byte 4,0x05 # a0a3 áú
.byte 35,0x04 # a4c6 ñ
.byte 1,0x06 # c7c7
.byte 24,0x04 # c8df
.byte 4,0x01 # e0e3 απ
.byte 4,0x04 # e4e7 Στ
.byte 2,0x03 # e8e9 ΦΘ
.byte 1,0x02 # eaea Ω
.byte 1,0x01 # ebeb δ
.byte 4,0x04 # ecef
.byte 1,0x00 # f0f0
.byte 1,0x04 # f1f1 ±
.byte 2,0x00 # f2f3
.byte 16,0x04 # f4103
.byte 1,0x00 # 104104
.byte 5,0x04 # 105109
.byte 1,0x00 # 10a10a
.byte 1,0x04 # 10b10b
.byte 1,0x00 # 10c10c
.byte 2,0x04 # 10d10e
.byte 1,0x00 # 10f10f
.byte 20,0x04 # 110123
.byte 4,0x00 # 124127
.byte 14,0x04 # 128135
.byte 1,0x00 # 136136
.byte 1,0x04 # 137137
.byte 8,0x00 # 13813f
.byte 64,0x04 # 14017f
.byte 16,0x03 # 18018f
.byte 22,0x04 # 1901a5
.byte 2,0x00 # 1a61a7
.byte 88,0x04 # 1a81ff
.endobj xed_disp_bits_2d.rodata
xed_imm_bits_2d.rodata:
.byte 4,0x01 # 0003
.byte 1,0x05 # 0404
.byte 1,0x07 # 0505
.byte 6,0x01 # 060b
.byte 1,0x09 # 0c0c
.byte 1,0x07 # 0d0d
.byte 1,0x01 # 0e0e
.byte 1,0x00 # 0f0f
.byte 4,0x01 # 1013
.byte 1,0x05 # 1414
.byte 1,0x07 # 1515 §
.byte 6,0x01 # 161b
.byte 1,0x05 # 1c1c
.byte 1,0x07 # 1d1d
.byte 6,0x01 # 1e23 #
.byte 1,0x05 # 2424 $
.byte 1,0x07 # 2525 %
.byte 1,0x00 # 2626 &
.byte 5,0x01 # 272b '+
.byte 1,0x05 # 2c2c ,
.byte 1,0x07 # 2d2d
.byte 1,0x00 # 2e2e .
.byte 5,0x01 # 2f33 /3
.byte 1,0x09 # 3434 4
.byte 1,0x07 # 3535 5
.byte 1,0x00 # 3636 6
.byte 5,0x01 # 373b 7;
.byte 1,0x05 # 3c3c <
.byte 1,0x07 # 3d3d =
.byte 1,0x00 # 3e3e >
.byte 37,0x01 # 3f63 ?c
.byte 4,0x00 # 6467 dg
.byte 1,0x06 # 6868 h
.byte 1,0x07 # 6969 i
.byte 2,0x05 # 6a6b jk
.byte 20,0x01 # 6c7f l
.byte 1,0x05 # 8080 Ç
.byte 1,0x07 # 8181 ü
.byte 2,0x05 # 8283 éâ
.byte 22,0x01 # 8499 äÖ
.byte 1,0x08 # 9a9a Ü
.byte 13,0x01 # 9ba7 ¢º
.byte 1,0x05 # a8a8 ¿
.byte 1,0x07 # a9a9
.byte 6,0x01 # aaaf ¬»
.byte 8,0x09 # b0b7
.byte 8,0x0a # b8bf
.byte 2,0x09 # c0c1
.byte 1,0x08 # c2c2
.byte 3,0x01 # c3c5
.byte 1,0x09 # c6c6
.byte 1,0x02 # c7c7
.byte 1,0x0b # c8c8
.byte 1,0x01 # c9c9
.byte 1,0x08 # caca
.byte 2,0x01 # cbcc
.byte 1,0x09 # cdcd
.byte 6,0x01 # ced3
.byte 2,0x09 # d4d5
.byte 14,0x01 # d6e3 π
.byte 4,0x09 # e4e7 Στ
.byte 2,0x01 # e8e9 ΦΘ
.byte 1,0x08 # eaea Ω
.byte 5,0x01 # ebef δ
.byte 1,0x00 # f0f0
.byte 1,0x01 # f1f1 ±
.byte 2,0x00 # f2f3
.byte 2,0x01 # f4f5
.byte 1,0x03 # f6f6 ÷
.byte 1,0x04 # f7f7
.byte 12,0x01 # f8103
.byte 1,0x00 # 104104
.byte 5,0x01 # 105109
.byte 1,0x00 # 10a10a
.byte 1,0x01 # 10b10b
.byte 1,0x00 # 10c10c
.byte 2,0x01 # 10d10e
.byte 1,0x00 # 10f10f
.byte 20,0x01 # 110123
.byte 4,0x00 # 124127
.byte 14,0x01 # 128135
.byte 1,0x00 # 136136
.byte 1,0x01 # 137137
.byte 8,0x00 # 13813f
.byte 48,0x01 # 14016f
.byte 4,0x09 # 170173
.byte 4,0x01 # 174177
.byte 1,0x0c # 178178
.byte 43,0x01 # 1791a3
.byte 1,0x09 # 1a41a4
.byte 1,0x01 # 1a51a5
.byte 2,0x00 # 1a61a7
.byte 4,0x01 # 1a81ab
.byte 1,0x09 # 1ac1ac
.byte 13,0x01 # 1ad1b9
.byte 1,0x09 # 1ba1ba
.byte 7,0x01 # 1bb1c1
.byte 1,0x09 # 1c21c2
.byte 1,0x01 # 1c31c3
.byte 3,0x09 # 1c41c6
.byte 57,0x01 # 1c71ff
.endobj xed_imm_bits_2d.rodata
.byte 0,0 # terminator
.byte 0,0,0,0,0,0 # padding
.previous
.init.start 300,_init_x86tab
call rldecode
lodsl
lodsw
.init.end 300,_init_x86tab