[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Question about tcc (C67) assembler code.
From: |
Kim Lux |
Subject: |
[Tinycc-devel] Question about tcc (C67) assembler code. |
Date: |
Thu, 15 Dec 2005 14:35:54 -0700 |
Could someone explain how the code in the C67_asm(char *s, int a, int b,
int c) routine works ?
What are the "<<23"s about ?
BTW: I generally find the tcc code to be well written and
understandable. No knocks against this code, I just don't understand
what it is doing at first glance.
Here is an example instruction. How does it work ?
If one is writing a new assembler, should it be done in the same way ?
else if (strstr(s, "AND.L") == s) {
xpath = C67_map_regs(b) ^ C67_map_regs(c);
ALWAYS_ASSERT(C67_map_regs(a) == C67_map_regs(c));
C67_g((0 << 29) | //creg
(0 << 28) | //inv
(C67_map_regn(c) << 23) | //dst
(C67_map_regn(b) << 18) | //src2 (possible x path)
(C67_map_regn(a) << 13) | //src1
(xpath << 12) | //x cross path if opposite sides
(0x7b << 5) | //opcode
(0x6 << 2) | //opcode fixed
(C67_map_regs(c) << 1) | //side of dest
(0 << 0)); //parallel
--
Kim Lux, Diesel Research Inc.
- [Tinycc-devel] Question about tcc (C67) assembler code.,
Kim Lux <=