[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Operand sizes in mescc compiler

From: W. J. van der Laan
Subject: Operand sizes in mescc compiler
Date: Thu, 15 Apr 2021 08:26:51 +0000


I am still working on porting to RISC-V 64 bit, and am now running into some 
difficulties around handling operand sizes; there are quite a few constructions 
like this

      ((0) (wrap-as (as info 'mem->r)))
      ((1) (append (wrap-as (as info 'byte-mem->r)) (convert-r0 info type)))
      ((2) (append (wrap-as (as info 'word-mem->r)) (convert-r0 info type)))
      ((4) (append (wrap-as (as info 'long-mem->r)) (convert-r0 info type)))

a) What does reading or writing a size of 0 mean?

b) Does this mean that "byte" is 8 bits, "word" is 16 bits, and "long" always 
32 bits, or are these the C types and depend on the architecture? For example 
"long int" on RISC-V 64 bit is 64 bit. However from what I understand info.scm 
already represents this mapping

    ("void" . ,(make-type 'void 1 #f))
    ("signed char" . ,(make-type 'signed 1 #f))
    ("unsigned char" . ,(make-type 'unsigned 1 #f))
    ("unsigned short" . ,(make-type 'unsigned 2 #f))
    ("unsigned" . ,(make-type 'unsigned 4 #f))
    ("unsigned int" . ,(make-type 'unsigned 4 #f))
    ("unsigned long" . ,(make-type 'unsigned 8 #f))
    ("unsigned long long" . ,(make-type 'unsigned 8 #f))
    ("unsigned long long int" . ,(make-type 'unsigned 8 #f))

If it is fixed, where are the cases for 64 bit? Shouldn't we have an (8) too? 
Or is this what (0) is?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]