mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
riscv: Add sar, shr insn
fixes 92_enum_bitfield.
This commit is contained in:
parent
f64d460d29
commit
215bc1aab4
@ -621,8 +621,6 @@ static void gen_opil(int op, int ll)
|
||||
d = ireg(d);
|
||||
switch (op) {
|
||||
case '%':
|
||||
case TOK_SAR:
|
||||
case TOK_SHR:
|
||||
case TOK_PDIV:
|
||||
default:
|
||||
tcc_error("implement me: %s(%s)", __FUNCTION__, get_tok_str(op, NULL));
|
||||
@ -633,6 +631,12 @@ static void gen_opil(int op, int ll)
|
||||
case '-':
|
||||
o(0x33 | (d << 7) | (a << 15) | (b << 20) | (0x20 << 25)); //sub d, a, b
|
||||
break;
|
||||
case TOK_SAR:
|
||||
o(0x33 | (d << 7) | (a << 15) | (b << 20) | (5 << 12) | (1 << 30)); //sra d, a, b
|
||||
break;
|
||||
case TOK_SHR:
|
||||
o(0x33 | (d << 7) | (a << 15) | (b << 20) | (5 << 12)); //srl d, a, b
|
||||
break;
|
||||
case TOK_SHL:
|
||||
o(0x33 | (d << 7) | (a << 15) | (b << 20) | (1 << 12)); //sll d, a, b
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user