Project

General

Profile

Actions

Task #4283

closed

[translator] Support for custom attributes in operations and addressing modes.

Added by Andrei Tatarnikov almost 11 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
-
Target version:
Start date:
07/01/2013
Due date:
05/31/2014
% Done:

100%

Estimated time:
Detected in build:
svn
Published in build:
141230

Description

Транслятор и модель должны поддерживатить использование кастомных аттрибутов. Например, в приведённом ниже куске используется аттрибут loop, который организует цикл путём рекурсии. Для трансляции модели MIPS требуется эта возможность.

op CLZ(rd : index, rs : REG_IND_ZERO)
    syntax = format ("CLZ %d,%s", rd, rs.syntax)
    image  = format ("011100%s%5b%5b00000100000", rs.image, rd, rd)
    action = {
        tmp_signed_byte = 31;
        GPR [rd] = 32;
        loop;
    }
    loop = {
        if tmp_signed_byte >= 0 then
            if ( rs < tmp_signed_byte..tmp_signed_byte > == 0 ) then
                tmp_signed_byte = tmp_signed_byte - 1;
            else
                GPR [ rd ] = 31 - tmp_signed_byte;
                tmp_signed_byte = -1;
            endif;

            loop;
        endif;
    }
Actions

Also available in: Atom PDF