History

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.

Thomas Preud'homme committed 13 years ago

Commit f6b50551 parent 807dc7c3 files · +4 −4Browse files

Unified · Split

3 files
  1. arm-gen.c +2 −2
  2. i386-gen.c +1 −1
  3. x86_64-gen.c +1 −1
arm-gen.c+2−2
@@ -571,7 +571,7 @@ void load(int r, SValue *sv) · 570 unmodified lines
571571 op=0xE5100000;
572572 if(!sign)
573573 op|=0x800000;
574− if ((ft & VT_BTYPE) == VT_BYTE)
574+ if ((ft & VT_BTYPE) == VT_BYTE || (ft & VT_BTYPE) == VT_BOOL)
575575 op|=0x400000;
576576 o(op|(intr(r)<<12)|fc|(base<<16));
577577 }
@@ -699,7 +699,7 @@ void store(int r, SValue *sv) · 121 unmodified lines
699699 op=0xE5000000;
700700 if(!sign)
701701 op|=0x800000;
702− if ((ft & VT_BTYPE) == VT_BYTE)
702+ if ((ft & VT_BTYPE) == VT_BYTE || (ft & VT_BTYPE) == VT_BOOL)
703703 op|=0x400000;
704704 o(op|(intr(r)<<12)|fc|(base<<16));
705705 }
i386-gen.c+1−1
@@ -244,7 +244,7 @@ ST_FUNC void load(int r, SValue *sv) · 243 unmodified lines
244244 } else if ((ft & VT_BTYPE) == VT_LDOUBLE) {
245245 o(0xdb); /* fldt */
246246 r = 5;
247− } else if ((ft & VT_TYPE) == VT_BYTE) {
247+ } else if ((ft & VT_TYPE) == VT_BYTE || (ft & VT_TYPE) == VT_BOOL) {
248248 o(0xbe0f); /* movsbl */
249249 } else if ((ft & VT_TYPE) == (VT_BYTE | VT_UNSIGNED)) {
250250 o(0xb60f); /* movzbl */
x86_64-gen.c+1−1
@@ -414,7 +414,7 @@ void load(int r, SValue *sv) · 413 unmodified lines
414414 r = REG_VALUE(r);
415415 } else if ((ft & VT_BTYPE) == VT_LDOUBLE) {
416416 b = 0xdb, r = 5; /* fldt */
417− } else if ((ft & VT_TYPE) == VT_BYTE) {
417+ } else if ((ft & VT_TYPE) == VT_BYTE || (ft & VT_TYPE) == VT_BOOL) {
418418 b = 0xbe0f; /* movsbl */
419419 } else if ((ft & VT_TYPE) == (VT_BYTE | VT_UNSIGNED)) {
420420 b = 0xb60f; /* movzbl */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t