mirror of
https://github.com/mirror/tinycc.git
synced 2024-12-28 04:00:06 +08:00
Add support for load/store of _Bool value
Add support for loading _Bool value in i386, x86_64 and arm as well as support for storing _Bool value on arm.
This commit is contained in:
parent
807dc7c8de
commit
f6b50558fc
@ -571,7 +571,7 @@ void load(int r, SValue *sv)
|
||||
op=0xE5100000;
|
||||
if(!sign)
|
||||
op|=0x800000;
|
||||
if ((ft & VT_BTYPE) == VT_BYTE)
|
||||
if ((ft & VT_BTYPE) == VT_BYTE || (ft & VT_BTYPE) == VT_BOOL)
|
||||
op|=0x400000;
|
||||
o(op|(intr(r)<<12)|fc|(base<<16));
|
||||
}
|
||||
@ -699,7 +699,7 @@ void store(int r, SValue *sv)
|
||||
op=0xE5000000;
|
||||
if(!sign)
|
||||
op|=0x800000;
|
||||
if ((ft & VT_BTYPE) == VT_BYTE)
|
||||
if ((ft & VT_BTYPE) == VT_BYTE || (ft & VT_BTYPE) == VT_BOOL)
|
||||
op|=0x400000;
|
||||
o(op|(intr(r)<<12)|fc|(base<<16));
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ ST_FUNC void load(int r, SValue *sv)
|
||||
} else if ((ft & VT_BTYPE) == VT_LDOUBLE) {
|
||||
o(0xdb); /* fldt */
|
||||
r = 5;
|
||||
} else if ((ft & VT_TYPE) == VT_BYTE) {
|
||||
} else if ((ft & VT_TYPE) == VT_BYTE || (ft & VT_TYPE) == VT_BOOL) {
|
||||
o(0xbe0f); /* movsbl */
|
||||
} else if ((ft & VT_TYPE) == (VT_BYTE | VT_UNSIGNED)) {
|
||||
o(0xb60f); /* movzbl */
|
||||
|
@ -414,7 +414,7 @@ void load(int r, SValue *sv)
|
||||
r = REG_VALUE(r);
|
||||
} else if ((ft & VT_BTYPE) == VT_LDOUBLE) {
|
||||
b = 0xdb, r = 5; /* fldt */
|
||||
} else if ((ft & VT_TYPE) == VT_BYTE) {
|
||||
} else if ((ft & VT_TYPE) == VT_BYTE || (ft & VT_TYPE) == VT_BOOL) {
|
||||
b = 0xbe0f; /* movsbl */
|
||||
} else if ((ft & VT_TYPE) == (VT_BYTE | VT_UNSIGNED)) {
|
||||
b = 0xb60f; /* movzbl */
|
||||
|
Loading…
Reference in New Issue
Block a user