aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-09-14 23:33:45 +0200
committerlemon <lsof@mailbox.org>2025-09-14 23:33:45 +0200
commit3386b092d8e8b00191ef511ea585fe875578efe7 (patch)
tree974b76056954dd94508a1769778ca1b0587cbacd /amd64
parentf4e3e27dd0b56ac39f0f6242d3464df764ab2a61 (diff)
start implementing bitfields
Diffstat (limited to 'amd64')
-rw-r--r--amd64/emit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 28fda92..b1c4002 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -566,6 +566,11 @@ DEFINSTR2(Xsar,
{4|8, PGPR, PI32, "\xC1", EN_RI8, .ext=7}, /* SAR r32/64, imm */
{4|8, PGPR, PRCX, "\xD3", EN_R, .ext=7}, /* SAR r32/64, CL */
)
+DEFINSTR2(Xshr,
+ {4|8, PGPR, P1, "\xD1", EN_R, .ext=5}, /* SHR r32/64, 1 */
+ {4|8, PGPR, PI32, "\xC1", EN_RI8, .ext=5}, /* SHR r32/64, imm */
+ {4|8, PGPR, PRCX, "\xD3", EN_R, .ext=5}, /* SHR r32/64, CL */
+)
DEFINSTR2(Xcvtss2sd,
{-1, PFPR, PFPR, "\xF3\x0F\x5A", EN_RR}, /* CVTSS2SD xmm, xmm */
{-1, PFPR, PMEM, "\xF3\x0F\x5A", EN_RM}, /* CVTSS2SD xmm, xmm */
@@ -900,6 +905,7 @@ emitinstr(uchar **pcode, struct function *fn, struct block *blk, int curi, struc
break;
case Oshl: X = Xshl; goto ALU2;
case Osar: X = Xsar; goto ALU2;
+ case Oslr: X = Xshr; goto ALU2;
case Oand:
if (!ins->reg) {
Xtest(pcode, cls, mkregoper(ins->l), mkimmdatregoper(ins->r));