From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Accessing a register with a larger size from generic
Date: Thu, 27 Sep 2001 18:31:26 +0000 (UTC)
Date: 2001-09-27T18:31:26+00:00 [thread overview]
Message-ID: <slrn9r6s3u.pqt.lutz@belenus.iks-jena.de> (raw)
------------------------------
[...with, use, package (body), ...]
subtype long is Interfaces.C.long;
type call_code is (KILL, FORK, EXIT, ...);
for call_code use (KILL => 1, FORK => 2, ...);
generic
call : call_code;
type type1 is private;
function syscall1 (arg1 : type1) return long;
function syscall1 (arg1 : type1) return long is
res : long;
begin
Asm ("int $0x80",
Outputs => long'Asm_Output ("=a", res),
Inputs => (call_code'Asm_Input ("0", call),
type1'Asm_Input ("b", arg1)),
Volatile => True);
return res;
end syscall1;
------------------------------
generates code (using GNAT 3.13p) like:
movb $2, %al
xorw %bx, %bx
int 0x80
instead of
movl $2, %eax
xorl %ebx, %ebx
int 0x80
How can I change the type of the generated RTL expression to SI independed
of the generic type?
next reply other threads:[~2001-09-27 18:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-27 18:31 Lutz Donnerhacke [this message]
2001-09-27 19:16 ` Accessing a register with a larger size from generic David C. Hoos
2001-10-02 8:01 ` Lutz Donnerhacke
2001-09-28 8:53 ` Lutz Donnerhacke
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox