... |
... |
@@ -462,7 +462,12 @@ asm_header_word(lispobj* ptr, lispobj object, FILE* f, const char* note) |
462
|
462
|
unsigned long len = HeaderValue(object);
|
463
|
463
|
unsigned long type = TypeOf(object);
|
464
|
464
|
|
465
|
|
- fprintf(f, "\t.4byte\t0x%lx << 8 + %ld\t# %s\n", len, type, asmtab_types[type]);
|
|
465
|
+ fprintf(f, "\t.4byte\t0x%lx << 8 + %ld\t# %s", len, type, asmtab_types[type]);
|
|
466
|
+ if (note) {
|
|
467
|
+ fprintf(f, ": %s\n", note);
|
|
468
|
+ } else {
|
|
469
|
+ fprintf(f, "\n");
|
|
470
|
+ }
|
466
|
471
|
}
|
467
|
472
|
|
468
|
473
|
|
... |
... |
@@ -487,7 +492,7 @@ asm_boxed(lispobj* ptr, lispobj object, FILE* f) |
487
|
492
|
|
488
|
493
|
asm_label(ptr, object, f);
|
489
|
494
|
|
490
|
|
- asm_header_word(ptr, object, f, "");
|
|
495
|
+ asm_header_word(ptr, object, f, NULL);
|
491
|
496
|
|
492
|
497
|
for (k = 1; k < len; ++k) {
|
493
|
498
|
asm_lispobj(ptr + k, ptr[k], f);
|
... |
... |
@@ -542,7 +547,7 @@ asm_fdefn(lispobj* ptr, lispobj object, FILE* f) |
542
|
547
|
{
|
543
|
548
|
asm_label(ptr, object, f);
|
544
|
549
|
|
545
|
|
- asm_header_word(ptr, object, f, "fdefn");
|
|
550
|
+ asm_header_word(ptr, object, f, NULL);
|
546
|
551
|
asm_lispobj(ptr + 1, ptr[1], f);
|
547
|
552
|
asm_lispobj(ptr + 2, ptr[2], f);
|
548
|
553
|
|
... |
... |
@@ -576,7 +581,7 @@ asm_simple_vector(lispobj* ptr, lispobj object, FILE* f) |
576
|
581
|
lispobj* data = ptr + 2;
|
577
|
582
|
|
578
|
583
|
asm_label(ptr, object, f);
|
579
|
|
- asm_header_word(ptr, object, f, "simple vector");
|
|
584
|
+ asm_header_word(ptr, object, f, NULL);
|
580
|
585
|
asm_lispobj(ptr + 1, ptr[1], f);
|
581
|
586
|
|
582
|
587
|
for (k = 0; k < len; ++k) {
|
... |
... |
@@ -596,7 +601,7 @@ asm_closure_header(lispobj* ptr, lispobj object, FILE* f) |
596
|
601
|
closure = (struct closure *) ptr;
|
597
|
602
|
|
598
|
603
|
asm_label(ptr, object, f);
|
599
|
|
- asm_header_word(ptr, object, f, "closure header");
|
|
604
|
+ asm_header_word(ptr, object, f, NULL);
|
600
|
605
|
fprintf(f, "\t.4byte\tL%08lx\n", closure->function);
|
601
|
606
|
|
602
|
607
|
nwords -= 2;
|
... |
... |
@@ -614,7 +619,7 @@ asm_symbol_header(lispobj* ptr, lispobj object, FILE* f) |
614
|
619
|
struct symbol* sym = (struct symbol*) ptr;
|
615
|
620
|
|
616
|
621
|
asm_label(ptr, object, f);
|
617
|
|
- asm_header_word(ptr, object, f, "symbol header");
|
|
622
|
+ asm_header_word(ptr, object, f, NULL);
|
618
|
623
|
asm_lispobj(&sym->value, sym->value, f);
|
619
|
624
|
asm_lispobj(&sym->hash, sym->hash, f);
|
620
|
625
|
asm_lispobj(&sym->plist, sym->plist, f);
|
... |
... |
@@ -653,7 +658,7 @@ asm_code_header(lispobj* ptr, lispobj object, FILE* f) |
653
|
658
|
#endif
|
654
|
659
|
|
655
|
660
|
asm_label(ptr, object, f);
|
656
|
|
- asm_header_word(ptr, object, f, "code header");
|
|
661
|
+ asm_header_word(ptr, object, f, NULL);
|
657
|
662
|
|
658
|
663
|
for (k = 0; k < nheader_words - 1; ++k) {
|
659
|
664
|
asm_lispobj(ptr + k + 1, ptr[k + 1], f);
|
... |
... |
@@ -677,7 +682,7 @@ asm_code_header(lispobj* ptr, lispobj object, FILE* f) |
677
|
682
|
fprintf(f, "# ->code %p\n", &fheaderp->code);
|
678
|
683
|
#endif
|
679
|
684
|
asm_label((lispobj*)fheaderp, *((lispobj*)fheaderp), f);
|
680
|
|
- asm_header_word(&fheaderp->header, fheaderp->header, f, "function header");
|
|
685
|
+ asm_header_word(&fheaderp->header, fheaderp->header, f, NULL);
|
681
|
686
|
fprintf(f, "\t.4byte\tL%lx\n", fheaderp->self);
|
682
|
687
|
asm_lispobj(&fheaderp->next, fheaderp->next, f);
|
683
|
688
|
asm_lispobj(&fheaderp->name, fheaderp->name, f);
|
... |
... |
@@ -764,7 +769,7 @@ asm_simple_string(lispobj* where, lispobj object, FILE* f) |
764
|
769
|
#endif
|
765
|
770
|
|
766
|
771
|
asm_label(where, object, f);
|
767
|
|
- asm_header_word(where, object, f, "simple string");
|
|
772
|
+ asm_header_word(where, object, f, NULL);
|
768
|
773
|
asm_lispobj(where + 1, where[1], f);
|
769
|
774
|
|
770
|
775
|
s = (uint16_t*) vector->data;
|
... |
... |
@@ -802,7 +807,7 @@ asm_vector_bit(lispobj* ptr, lispobj object, FILE* f) |
802
|
807
|
#endif
|
803
|
808
|
|
804
|
809
|
asm_label(ptr, object, f);
|
805
|
|
- asm_header_word(ptr, object, f, "simple bit-vector");
|
|
810
|
+ asm_header_word(ptr, object, f, NULL);
|
806
|
811
|
asm_lispobj(ptr + 1, ptr[1], f);
|
807
|
812
|
|
808
|
813
|
data = vector->data;
|
... |
... |
@@ -851,7 +856,7 @@ asm_single_float(lispobj* ptr, lispobj object, FILE* f) |
851
|
856
|
struct single_float* obj = (struct single_float*) ptr;
|
852
|
857
|
|
853
|
858
|
asm_label(ptr, object, f);
|
854
|
|
- asm_header_word(ptr, object, f, "single float");
|
|
859
|
+ asm_header_word(ptr, object, f, NULL);
|
855
|
860
|
print_float(f, obj->value);
|
856
|
861
|
|
857
|
862
|
return 2;
|
... |
... |
@@ -895,7 +900,7 @@ asm_double_float(lispobj* ptr, lispobj object, FILE* f) |
895
|
900
|
struct double_float* obj = (struct double_float*) ptr;
|
896
|
901
|
|
897
|
902
|
asm_label(ptr, object, f);
|
898
|
|
- asm_header_word(ptr, object, f, "double float");
|
|
903
|
+ asm_header_word(ptr, object, f, NULL);
|
899
|
904
|
asm_lispobj(&obj->filler, obj->filler, f);
|
900
|
905
|
print_double(f, obj->value);
|
901
|
906
|
|
... |
... |
@@ -908,7 +913,7 @@ asm_double_double_float(lispobj* ptr, lispobj object, FILE* f) |
908
|
913
|
struct double_double_float* obj = (struct double_double_float*) ptr;
|
909
|
914
|
|
910
|
915
|
asm_label(ptr, object, f);
|
911
|
|
- asm_header_word(ptr, object, f, "double double float");
|
|
916
|
+ asm_header_word(ptr, object, f, NULL);
|
912
|
917
|
asm_lispobj(&obj->filler, obj->filler, f);
|
913
|
918
|
|
914
|
919
|
print_double(f, obj->hi);
|
... |
... |
@@ -923,7 +928,7 @@ asm_complex_single_float(lispobj* ptr, lispobj object, FILE* f) |
923
|
928
|
struct complex_single_float* obj = (struct complex_single_float*) ptr;
|
924
|
929
|
|
925
|
930
|
asm_label(ptr, object, f);
|
926
|
|
- asm_header_word(ptr, object, f, "complex single-float");
|
|
931
|
+ asm_header_word(ptr, object, f, NULL);
|
927
|
932
|
print_float(f, obj->real);
|
928
|
933
|
print_float(f, obj->imag);
|
929
|
934
|
/* Force double word boundary */
|
... |
... |
@@ -938,7 +943,7 @@ asm_complex_double_float(lispobj* ptr, lispobj object, FILE* f) |
938
|
943
|
struct complex_double_float* obj = (struct complex_double_float*) ptr;
|
939
|
944
|
|
940
|
945
|
asm_label(ptr, object, f);
|
941
|
|
- asm_header_word(ptr, object, f, "complex double-float");
|
|
946
|
+ asm_header_word(ptr, object, f, NULL);
|
942
|
947
|
asm_lispobj(&obj->filler, obj->filler, f);
|
943
|
948
|
|
944
|
949
|
print_double(f, obj->real);
|
... |
... |
@@ -953,7 +958,7 @@ asm_complex_double_double_float(lispobj* ptr, lispobj object, FILE* f) |
953
|
958
|
struct complex_double_double_float* obj = (struct complex_double_double_float*) ptr;
|
954
|
959
|
|
955
|
960
|
asm_label(ptr, object, f);
|
956
|
|
- asm_header_word(ptr, object, f, "complex double-float");
|
|
961
|
+ asm_header_word(ptr, object, f, NULL);
|
957
|
962
|
asm_lispobj(&obj->filler, obj->filler, f);
|
958
|
963
|
|
959
|
964
|
print_double(f, obj->real_hi);
|
... |
... |
@@ -981,7 +986,7 @@ asm_vector_unsigned_byte_2(lispobj* ptr, lispobj object, FILE* f) |
981
|
986
|
nwords = CEILING(NWORDS(length, 16) + 2, 2);
|
982
|
987
|
#endif
|
983
|
988
|
asm_label(ptr, object, f);
|
984
|
|
- asm_header_word(ptr, object, f, "vector unsigned_byte 2");
|
|
989
|
+ asm_header_word(ptr, object, f, NULL);
|
985
|
990
|
asm_lispobj(ptr + 1, ptr[1], f);
|
986
|
991
|
|
987
|
992
|
data = vector->data;
|
... |
... |
@@ -1012,7 +1017,7 @@ asm_vector_unsigned_byte_4(lispobj* ptr, lispobj object, FILE* f) |
1012
|
1017
|
nwords = CEILING(NWORDS(length, 8) + 2, 2);
|
1013
|
1018
|
#endif
|
1014
|
1019
|
asm_label(ptr, object, f);
|
1015
|
|
- asm_header_word(ptr, object, f, "vector unsigned_byte 4");
|
|
1020
|
+ asm_header_word(ptr, object, f, NULL);
|
1016
|
1021
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1017
|
1022
|
|
1018
|
1023
|
data = vector->data;
|
... |
... |
@@ -1043,7 +1048,7 @@ asm_vector_unsigned_byte_8(lispobj* ptr, lispobj object, FILE* f) |
1043
|
1048
|
nwords = CEILING(NWORDS(length, 4) + 2, 2);
|
1044
|
1049
|
#endif
|
1045
|
1050
|
asm_label(ptr, object, f);
|
1046
|
|
- asm_header_word(ptr, object, f, "vector unsigned_byte 8");
|
|
1051
|
+ asm_header_word(ptr, object, f, NULL);
|
1047
|
1052
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1048
|
1053
|
|
1049
|
1054
|
data = vector->data;
|
... |
... |
@@ -1072,7 +1077,7 @@ asm_vector_unsigned_byte_16(lispobj* ptr, lispobj object, FILE* f) |
1072
|
1077
|
nwords = CEILING(NWORDS(length, 2) + 2, 2);
|
1073
|
1078
|
#endif
|
1074
|
1079
|
asm_label(ptr, object, f);
|
1075
|
|
- asm_header_word(ptr, object, f, "vector unsigned_byte 16");
|
|
1080
|
+ asm_header_word(ptr, object, f, NULL);
|
1076
|
1081
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1077
|
1082
|
|
1078
|
1083
|
data = (uint16_t*) vector->data;
|
... |
... |
@@ -1104,7 +1109,7 @@ asm_vector_unsigned_byte_32(lispobj* ptr, lispobj object, FILE* f) |
1104
|
1109
|
#endif
|
1105
|
1110
|
|
1106
|
1111
|
asm_label(ptr, object, f);
|
1107
|
|
- asm_header_word(ptr, object, f, "vector unsigned_byte 32");
|
|
1112
|
+ asm_header_word(ptr, object, f, NULL);
|
1108
|
1113
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1109
|
1114
|
|
1110
|
1115
|
data = vector->data;
|
... |
... |
@@ -1134,7 +1139,7 @@ asm_vector_double_float(lispobj* ptr, lispobj object, FILE* f) |
1134
|
1139
|
#endif
|
1135
|
1140
|
|
1136
|
1141
|
asm_label(ptr, object, f);
|
1137
|
|
- asm_header_word(ptr, object, f, "vector double-float");
|
|
1142
|
+ asm_header_word(ptr, object, f, NULL);
|
1138
|
1143
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1139
|
1144
|
|
1140
|
1145
|
data = (const double*) vector->data;
|
... |
... |
@@ -1160,7 +1165,7 @@ asm_vector_double_double_float(lispobj* ptr, lispobj object, FILE* f) |
1160
|
1165
|
nwords = CEILING(length * 4 + 2, 2);
|
1161
|
1166
|
|
1162
|
1167
|
asm_label(ptr, object, f);
|
1163
|
|
- asm_header_word(ptr, object, f, "vector double-float");
|
|
1168
|
+ asm_header_word(ptr, object, f, NULL);
|
1164
|
1169
|
asm_lispobj(ptr + 1, ptr[1], f);
|
1165
|
1170
|
|
1166
|
1171
|
data = (const double*) vector->data;
|
... |
... |
@@ -1181,7 +1186,7 @@ asm_bignum(lispobj* ptr, lispobj object, FILE* f) |
1181
|
1186
|
len = CEILING(len, 2);
|
1182
|
1187
|
|
1183
|
1188
|
asm_label(ptr, object, f);
|
1184
|
|
- asm_header_word(ptr, object, f, "bignum");
|
|
1189
|
+ asm_header_word(ptr, object, f, NULL);
|
1185
|
1190
|
|
1186
|
1191
|
for (k = 1; k < len; ++k) {
|
1187
|
1192
|
fprintf(f, "\t.4byte\t0x%lx\t# %lu\n", ptr[k], ptr[k]);
|
... |
... |
@@ -1194,7 +1199,7 @@ int |
1194
|
1199
|
asm_sap(lispobj* ptr, lispobj object, FILE* f)
|
1195
|
1200
|
{
|
1196
|
1201
|
asm_label(ptr, object, f);
|
1197
|
|
- asm_header_word(ptr, object, f, "sap");
|
|
1202
|
+ asm_header_word(ptr, object, f, NULL);
|
1198
|
1203
|
/* Just print out the raw value of the address */
|
1199
|
1204
|
fprintf(f, "\t.4byte\t0x%lx\n", ptr[1]);
|
1200
|
1205
|
|
... |
... |
@@ -1215,11 +1220,19 @@ init_asmtab(void) |
1215
|
1220
|
asmtab_types[type_Ratio] = "Ratio";
|
1216
|
1221
|
asmtab_types[type_SingleFloat] = "SingleFloat";
|
1217
|
1222
|
asmtab_types[type_DoubleFloat] = "DoubleFloat";
|
|
1223
|
+#ifdef type_DoubleDoubleFloat
|
1218
|
1224
|
asmtab_types[type_DoubleDoubleFloat] = "DoubleDoubleFloat";
|
|
1225
|
+#endif
|
1219
|
1226
|
asmtab_types[type_Complex] = "Complex";
|
|
1227
|
+#ifdef type_ComplexSingleFloat
|
1220
|
1228
|
asmtab_types[type_ComplexSingleFloat] = "ComplexSingleFloat";
|
|
1229
|
+#endif
|
|
1230
|
+#ifdef type_ComplexDoubleFloat
|
1221
|
1231
|
asmtab_types[type_ComplexDoubleFloat] = "ComplexDoubleFloat";
|
|
1232
|
+#endif
|
|
1233
|
+#ifdef type_ComplexDoubleDoubleFloat
|
1222
|
1234
|
asmtab_types[type_ComplexDoubleDoubleFloat] = "ComplexDoubleDoubleFloat";
|
|
1235
|
+#endif
|
1223
|
1236
|
asmtab_types[type_SimpleArray] = "SimpleArray";
|
1224
|
1237
|
asmtab_types[type_SimpleString] = "SimpleString";
|
1225
|
1238
|
asmtab_types[type_SimpleBitVector] = "SimpleBitVector";
|
... |
... |
@@ -1229,16 +1242,32 @@ init_asmtab(void) |
1229
|
1242
|
asmtab_types[type_SimpleArrayUnsignedByte8] = "SimpleArrayUnsignedByte8";
|
1230
|
1243
|
asmtab_types[type_SimpleArrayUnsignedByte16] = "SimpleArrayUnsignedByte16";
|
1231
|
1244
|
asmtab_types[type_SimpleArrayUnsignedByte32] = "SimpleArrayUnsignedByte32";
|
|
1245
|
+#ifdef type_SimpleArraySignedByte8
|
1232
|
1246
|
asmtab_types[type_SimpleArraySignedByte8] = "SimpleArraySignedByte8";
|
|
1247
|
+#endif
|
|
1248
|
+#ifdef type_SimpleArraySignedByte16
|
1233
|
1249
|
asmtab_types[type_SimpleArraySignedByte16] = "SimpleArraySignedByte16";
|
|
1250
|
+#endif
|
|
1251
|
+#ifdef type_SimpleArraySignedByte30
|
1234
|
1252
|
asmtab_types[type_SimpleArraySignedByte30] = "SimpleArraySignedByte30";
|
|
1253
|
+#endif
|
|
1254
|
+#ifdef type_SimpleArraySignedByte32
|
1235
|
1255
|
asmtab_types[type_SimpleArraySignedByte32] = "SimpleArraySignedByte32";
|
|
1256
|
+#endif
|
1236
|
1257
|
asmtab_types[type_SimpleArraySingleFloat] = "SimpleArraySingleFloat";
|
1237
|
1258
|
asmtab_types[type_SimpleArrayDoubleFloat] = "SimpleArrayDoubleFloat";
|
|
1259
|
+#ifdef type_SimpleArrayDoubleDoubleFloat
|
1238
|
1260
|
asmtab_types[type_SimpleArrayDoubleDoubleFloat] = "SimpleArrayDoubleDoubleFloat";
|
|
1261
|
+#endif
|
|
1262
|
+#ifdef type_SimpleArrayComplexSingleFloat
|
1239
|
1263
|
asmtab_types[type_SimpleArrayComplexSingleFloat] = "SimpleArrayComplexSingleFloat";
|
|
1264
|
+#endif
|
|
1265
|
+#ifdef type_SimpleArrayComplexDoubleFloat
|
1240
|
1266
|
asmtab_types[type_SimpleArrayComplexDoubleFloat] = "SimpleArrayComplexDoubleFloat";
|
|
1267
|
+#endif
|
|
1268
|
+#ifdef type_SimpleArrayComplexDoubleDoubleFloat
|
1241
|
1269
|
asmtab_types[type_SimpleArrayComplexDoubleDoubleFloat] = "SimpleArrayComplexDoubleDoubleFloat";
|
|
1270
|
+#endif
|
1242
|
1271
|
asmtab_types[type_ComplexString] = "ComplexString";
|
1243
|
1272
|
asmtab_types[type_ComplexBitVector] = "ComplexBitVector";
|
1244
|
1273
|
asmtab_types[type_ComplexVector] = "ComplexVector";
|
... |
... |
@@ -1280,11 +1309,19 @@ init_asmtab(void) |
1280
|
1309
|
asmtab[type_Ratio] = asm_boxed;
|
1281
|
1310
|
asmtab[type_SingleFloat] = asm_single_float;
|
1282
|
1311
|
asmtab[type_DoubleFloat] = asm_double_float;
|
|
1312
|
+#ifdef type_DoubleDoubleFloat
|
1283
|
1313
|
asmtab[type_DoubleDoubleFloat] = asm_double_double_float;
|
|
1314
|
+#endif
|
1284
|
1315
|
asmtab[type_Complex] = asm_boxed;
|
|
1316
|
+#ifdef type_ComplexSingleFloat
|
1285
|
1317
|
asmtab[type_ComplexSingleFloat] = asm_complex_single_float;
|
|
1318
|
+#endif
|
|
1319
|
+#ifdef type_ComplexDoubleFloat
|
1286
|
1320
|
asmtab[type_ComplexDoubleFloat] = asm_complex_double_float;
|
|
1321
|
+#endif
|
|
1322
|
+#ifdef type_ComplexDoubleDoubleFloat
|
1287
|
1323
|
asmtab[type_ComplexDoubleDoubleFloat] = asm_complex_double_double_float;
|
|
1324
|
+#endif
|
1288
|
1325
|
asmtab[type_SimpleArray] = asm_boxed;
|
1289
|
1326
|
asmtab[type_SimpleString] = asm_simple_string;
|
1290
|
1327
|
asmtab[type_SimpleBitVector] = asm_vector_bit;
|
... |
... |
@@ -1295,12 +1332,16 @@ init_asmtab(void) |
1295
|
1332
|
asmtab[type_SimpleArrayUnsignedByte16] = asm_vector_unsigned_byte_16;
|
1296
|
1333
|
asmtab[type_SimpleArrayUnsignedByte32] = asm_vector_unsigned_byte_32;
|
1297
|
1334
|
asmtab[type_SimpleArrayDoubleFloat] = asm_vector_double_float;
|
|
1335
|
+#ifdef type_SimpleArrayDoubleDoubleFloat
|
1298
|
1336
|
asmtab[type_SimpleArrayDoubleDoubleFloat] = asm_vector_double_double_float;
|
|
1337
|
+#endif
|
1299
|
1338
|
asmtab[type_ComplexString] = asm_boxed;
|
1300
|
1339
|
asmtab[type_ComplexVector] = asm_boxed;
|
1301
|
1340
|
asmtab[type_CodeHeader] = asm_code_header;
|
|
1341
|
+#if defined(i386) || defined(__x86_64)
|
1302
|
1342
|
asmtab[type_ClosureHeader] = asm_closure_header;
|
1303
|
1343
|
asmtab[type_FuncallableInstanceHeader] = asm_closure_header;
|
|
1344
|
+#endif
|
1304
|
1345
|
/* Just use asm_boxed or have a special version for a value cell? */
|
1305
|
1346
|
asmtab[type_ValueCellHeader] = asm_boxed;
|
1306
|
1347
|
asmtab[type_SymbolHeader] = asm_symbol_header;
|
... |
... |
@@ -1334,7 +1375,7 @@ write_asm_object(const char *dir, int id, os_vm_address_t start, os_vm_address_t |
1334
|
1375
|
int k;
|
1335
|
1376
|
|
1336
|
1377
|
/* Output the first word */
|
1337
|
|
- asm_header_word(ptr, *ptr, f, "");
|
|
1378
|
+ asm_header_word(ptr, *ptr, f, NULL);
|
1338
|
1379
|
/* Header word for NIL */
|
1339
|
1380
|
asm_header_word(ptr + 1, ptr[1], f, "NIL header");
|
1340
|
1381
|
/* Label for NIL */
|