-
Notifications
You must be signed in to change notification settings - Fork 6
/
superopt.h
1555 lines (1478 loc) · 69.8 KB
/
superopt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Superoptimizer definitions.
Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; see the file COPYING. If not, write to the Free
Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#if !(defined(SPARC) || defined(POWER) || defined(POWERPC) || defined(M88000) \
|| defined(AM29K) || defined(MC68000) || defined(MC68020) \
|| defined(I386) || defined(PYR) || defined(ALPHA) || defined(HPPA) \
|| defined(SH) || defined (I960) || defined (I960B)|| defined(XCORE) \
|| defined(AVR))
/* If no target instruction set is defined, use host instruction set. */
#define SPARC (defined(sparc) || defined(__sparc__))
#define POWER ((defined(rs6000) || defined(_IBMR2)) && !defined (_ARCH_PPC))
#define POWEPC (defined(_ARCH_PPC))
/* #define POWER ???? */
#define M88000 (defined(m88000) || defined(__m88000__))
#define AM29K (defined(_AM29K) || defined(_AM29000))
#define MC68020 (defined(m68020) || defined(mc68020))
#define MC68000 (defined(m68000) || defined(mc68000))
#define I386 (defined(i386) || defined(i80386) || defined(__i386__))
#define PYR (defined(pyr) || defined(__pyr__))
#define ALPHA defined(__alpha)
#define HPPA defined(__hppa)
#define SH defined(__sh__)
#define I960 defined (__i960)
#define XCORE defined (__XS1A__)
#endif
#define M68000 (MC68000 || MC68020)
#if POWERPC
#define POWER 1
#endif
#if I960B
#define I960 1
#endif
#if SPARC
#define TARGET_STRING "SPARC v7/v8"
#elif POWERPC
#define TARGET_STRING "PowerPC"
#elif POWER
#define TARGET_STRING "IBM POWER"
#elif M88000
#define TARGET_STRING "Motorola MC88000"
#elif AM29K
#define TARGET_STRING "Amd 29000"
#elif MC68020
#define TARGET_STRING "Motorola MC68020"
#elif MC68000
#define TARGET_STRING "Motorola MC68000 (no 68020 instructions)"
#elif I386
#define TARGET_STRING "Intel 386/486/Pentium/Sexium"
#elif PYR
#define TARGET_STRING "Pyramid (with the secret instructions)"
#elif ALPHA
#define TARGET_STRING "DEC Alpha"
#elif HPPA
#define TARGET_STRING "Hewlett-Packard Precision Architecture (PA-RISC)"
#elif SH
#define TARGET_STRING "Hitachi Super-H (SH)"
/* Reject sequences that require two different registers to be allocated to
register r0. */
#define EXTRA_SEQUENCE_TESTS(seq, n) \
{ \
int reg0 = -1; /* -1 means r0 is not yet allocated */ \
int i; \
for (i = 0; i < n; i++) \
{ \
if ((seq[i].opcode == AND || seq[i].opcode == XOR \
|| seq[i].opcode == IOR || seq[i].opcode == CYEQ) \
&& IMMEDIATE_P (seq[i].s2) && IMMEDIATE_VAL (seq[i].s2) != 0) \
{ \
if (reg0 >= 0 && reg0 != seq[i].d) \
return; \
reg0 = seq[i].d; \
} \
} \
}
#elif I960
#define TARGET_STRING "Intel 960 v1.0"
#elif I960B
#define TARGET_STRING "Intel 960 v1.1"
#elif XCORE
#define TARGET_STRING "XMOS XCore"
#elif AVR
#define TARGET_STRING "AVR"
#endif
#if !(SPARC || POWER || M88000 || AM29K || M68000 || I386 || PYR \
|| ALPHA || HPPA || SH || I960 || XCORE || AVR)
#error You have to choose target CPU type (e.g. -DSPARC).
#endif
#if MC68000
#define SHIFT_COST(CNT) ((8+2*(CNT)) / 5) /* internal cost */
#else
#define SHIFT_COST(CNT) 1
#endif
#if ALPHA
#define BITS_PER_WORD 64
#elif AVR
#define BITS_PER_WORD 8
#else
#define BITS_PER_WORD 32
#endif
/* Get longlong.h for double-word arithmetic.
First define the types for it to operate on. */
#define UWtype word
#define UHWtype word
#define UDWtype unsigned long /* Bogus, but we'll not depend on it */
#define W_TYPE_SIZE BITS_PER_WORD
#define SItype int
#define USItype unsigned int
#define DItype long long int
#define UDItype unsigned long long int
#define LONGLONG_STANDALONE
#include "longlong.h"
#if HPPA
#define HAS_NULLIFICATION 1
enum { NOT_NULLIFY = 0, NULLIFY = 1 };
#endif
#if BITS_PER_WORD == 64
#if defined (__GNUC__) || defined (_LONGLONG)
typedef unsigned long long int unsigned_word;
typedef signed long long int signed_word;
typedef unsigned_word word;
#undef PSTR /* no portable way to print */
#elif __alpha /* Native compiler on alpha has 64 bit longs. */
typedef unsigned long int unsigned_word;
typedef signed long int signed_word;
typedef unsigned_word word;
#define PSTR "0x%lx"
#else /* Not on alpha, not GCC. Don't have 64 bit type. */
#error Do not know how to perform 64 bit arithmetic with this compiler.
#endif
#elif BITS_PER_WORD == 8
typedef unsigned char unsigned_word;
typedef signed char signed_word;
typedef unsigned_word word;
#else
typedef unsigned int unsigned_word;
typedef signed int signed_word;
typedef unsigned_word word;
#define PSTR "0x%x"
#endif
#define TRUNC_CNT(cnt) ((unsigned) (cnt) % BITS_PER_WORD)
#if !defined(__GNUC__) || !defined(__OPTIMIZE__) || defined(DEBUG)
#define inline /* Empty */
#endif
/* Handle immediates by putting all handled values in the VALUE array at
appropriate indices, and then insert these indices in the code.
We currently do this just for some hardwired constants. */
#define CNST_0x80000000 (0x20 - 2)
#define CNST_0x7FFFFFFF (0x20 - 3)
#define CNST_0xFFFF (0x20 - 4)
#define CNST_0xFF (0x20 - 5)
#define VALUE_MIN_SIGNED ((word) 1 << (BITS_PER_WORD - 1))
#define VALUE_MAX_SIGNED (((word) 1 << (BITS_PER_WORD - 1)) - 1)
#define CNST(n) (0x20 + n)
#define VALUE(n) n
/* The IMMEDIATE_* macros are for printing assembly. NOT for sequence
generating or analyze. */
#define IMMEDIATE_P(op) (op >= 0x20 - 5)
static const word __immediate_val[] =
{
VALUE_MIN_SIGNED,
VALUE_MAX_SIGNED,
0xffff,
0xff
};
#define IMMEDIATE_VAL(op) \
((op) >= 0x20 - 1 ? op - 0x20 : __immediate_val[0x20 - 2 - (op)])
typedef enum
{
#undef DEF_INSN
#define DEF_INSN(SYM,CLASS,NAME) SYM,
#include "insn.def"
} opcode_t;
#define GET_INSN_CLASS(OP) (insn_class[OP])
#define GET_INSN_NAME(OP) (insn_name[OP])
#define UNARY_OPERATION(insn) (GET_INSN_CLASS (insn.opcode) == '1')
typedef struct
{
opcode_t opcode:11;
unsigned int s1:7;
unsigned int s2:7;
unsigned int d:7;
} insn_t;
#if __GNUC__ < 2
#define __CLOBBER_CC
#define __AND_CLOBBER_CC
#else /* __GNUC__ >= 2 */
#define __CLOBBER_CC : "cc"
#define __AND_CLOBBER_CC , "cc"
#endif /* __GNUC__ < 2 */
/* PERFORM_* for all instructions the search uses. These macros are
used both in the search phase and in the test phase. */
#if defined(__GNUC__) && defined(USE_ASM)
/*** Define machine-dependent PERFORM_* here to improve synthesis speed ***/
#if sparc
#define PERFORM_ADD_CIO(d, co, r1, r2, ci) \
asm ("subcc %%g0,%4,%%g0 ! set cy if CI != 0 \
addxcc %2,%3,%0 ! add R1 and R2 \
addx %%g0,%%g0,%1 ! set CO to cy" \
: "=r" (d), "=r" (co) \
: "%r" (r1), "rI" (r2), "rI" (ci) \
__CLOBBER_CC)
#define PERFORM_ADD_CO(d, co, r1, r2, ci) \
asm ("addcc %2,%3,%0 ! add R1 and R2 \
addx %%g0,%%g0,%1 ! set CO to cy" \
: "=r" (d), "=r" (co) \
: "%r" (r1), "rI" (r2) \
__CLOBBER_CC)
#define PERFORM_SUB_CIO(d, co, r1, r2, ci) \
asm ("subcc %%g0,%4,%%g0 ! set cy if CI != 0 \
subxcc %2,%3,%0 ! subtract R2 from R1 \
addx %%g0,%%g0,%1 ! set CO to cy" \
: "=r" (d), "=r" (co) \
: "r" (r1), "rI" (r2), "rI" (ci) \
__CLOBBER_CC)
#define PERFORM_SUB_CO(d, co, r1, r2, ci) \
asm ("subcc %2,%3,%0 ! subtract R2 from R1 \
addx %%g0,%%g0,%1 ! set CO to cy" \
: "=r" (d), "=r" (co) \
: "r" (r1), "rI" (r2) \
__CLOBBER_CC)
#define PERFORM_ADC_CIO(d, co, r1, r2, ci) \
asm ("subcc %4,1,%%g0 ! cy = (CI == 0) \
subxcc %2,%3,%0 ! subtract R2 from R1 \
subx %%g0,-1,%1 ! set CO to !cy" \
: "=&r" (d), "=r" (co) \
: "r" (r1), "rI" (r2), "rI" (ci) \
__CLOBBER_CC)
#define PERFORM_ADC_CO(d, co, r1, r2, ci) \
asm ("subcc %2,%3,%0 ! subtract R2 from R1 \
subx %%g0,-1,%1 ! set CO to !cy" \
: "=&r" (d), "=r" (co) \
: "r" (r1), "rI" (r2) \
__CLOBBER_CC)
#endif /* sparc */
#if m88k
#define PERFORM_ADD_CIO(d, co, r1, r2, ci) \
asm ("or %0,r0,1 \
subu.co r0,%4,%0 ; set cy if CI != 0 \
addu.cio %0,%2,%r3 ; add R1 and R2 \
addu.ci %1,r0,r0 ; set CO to cy" \
: "=&r" (d), "=r" (co) \
: "%r" (r1), "Or" (r2), "r" (ci))
#define PERFORM_ADD_CO(d, co, r1, r2, ci) \
asm ("addu.co %0,%2,%r3 ; add R1 and R2 \
addu.ci %1,r0,r0 ; set CO to cy" \
: "=r" (d), "=r" (co) \
: "%r" (r1), "Or" (r2))
#define PERFORM_SUB_CIO(d, co, r1, r2, ci) \
asm ("subu.co r0,r0,%r4 ; reset cy if CI != 0 \
subu.cio %0,%2,%r3 ; subtract R2 from R1 \
subu.ci %1,r0,r0 ; set CO to -1+cy \
subu %1,r0,%1 ; set CO to !cy" \
: "=r" (d), "=r" (co) \
: "r" (r1), "Or" (r2), "Or" (ci))
#define PERFORM_SUB_CO(d, co, r1, r2, ci) \
asm ("subu.co %0,%2,%r3 ; subtract R2 from R1 \
subu.ci %1,r0,r0 ; set CO to -1+cy \
subu %1,r0,%1 ; set CO to !cy" \
: "=r" (d), "=r" (co) \
: "r" (r1), "Or" (r2))
#define PERFORM_ADC_CIO(d, co, r1, r2, ci) \
asm ("or %0,r0,1 \
subu.co r0,%r4,%0 ; set cy if CI != 0 \
subu.cio %0,%2,%r3 ; subtract R2 from R1 \
addu.ci %1,r0,r0 ; set CO to cy" \
: "=&r" (d), "=r" (co) \
: "r" (r1), "Or" (r2), "Or" (ci))
#define PERFORM_ADC_CO(d, co, r1, r2, ci) \
asm ("subu.co %0,%2,%r3 ; subtract R2 from R1 \
addu.ci %1,r0,r0 ; set CO to cy" \
: "=r" (d), "=r" (co) \
: "r" (r1), "Or" (r2))
#endif /* m88k */
#endif /* __GNUC__ && USE_ASM */
/************************* Default PERFORM_* in C *************************/
#define PERFORM_COPY(d, co, r1, ci) \
((d) = (r1), (co) = (ci))
#define PERFORM_EXCHANGE(co, r1, r2, ci) \
do {word __temp = (r1), (r1) = (r2), (r2) = __temp, (co) = (ci);} while (0)
#define PERFORM_ADD(d, co, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci))
#ifndef PERFORM_ADD_CIO
#define PERFORM_ADD_CIO(d, co, r1, r2, ci) \
do { word __d = (r1) + (ci); \
word __cy = __d < (ci); \
(d) = __d + (r2); \
(co) = ((d) < __d) + __cy; } while (0)
#endif
#ifndef PERFORM_ADD_CI
#define PERFORM_ADD_CI(d, co, r1, r2, ci) \
do { word __d = (r1) + (r2) + (ci); \
(co) = (ci); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ADD_CO
#define PERFORM_ADD_CO(d, co, r1, r2, ci) \
do { word __d = (r1) + (r2); \
(co) = __d < (r1); \
(d) = __d; } while (0)
#endif
#define PERFORM_SUB(d, co, r1, r2, ci) \
((d) = (r1) - (r2), (co) = (ci))
#ifndef PERFORM_SUB_CIO
#define PERFORM_SUB_CIO(d, co, r1, r2, ci) \
do { word __d = (r1) - (r2) - (ci); \
(co) = (ci) ? __d >= (r1) : __d > (r1); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_SUB_CI
#define PERFORM_SUB_CI(d, co, r1, r2, ci) \
do { word __d = (r1) - (r2) - (ci); \
(co) = (ci); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_SUB_CO
#define PERFORM_SUB_CO(d, co, r1, r2, ci) \
do { word __d = (r1) - (r2); \
(co) = __d > (r1); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ADC_CIO
#define PERFORM_ADC_CIO(d, co, r1, r2, ci) \
do { word __d = (r1) + ~(r2) + (ci); \
(co) = (ci) ? __d <= (r1) : __d < (r1); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ADC_CI
#define PERFORM_ADC_CI(d, co, r1, r2, ci) \
do { word __d = (r1) + ~(r2) + (ci); \
(co) = (ci); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ADC_CO
#define PERFORM_ADC_CO(d, co, r1, r2, ci) \
do { word __d = (r1) - (r2); \
(co) = __d <= (r1); \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ADDCMPL
#define PERFORM_ADDCMPL(d, co, r1, r2, ci) \
((d) = (r1) + ~(r2), (co) = (ci))
#endif
#define PERFORM_LDA16F(d, co, r1, r2, ci) \
((d) = (r1) + ((r2) << 1), (co) = (ci))
#define PERFORM_LDA16B(d, co, r1, r2, ci) \
((d) = (r1) - ((r2) << 1), (co) = (ci))
#define PERFORM_LDAWF(d, co, r1, r2, ci) \
((d) = (r1) + ((r2) << 2), (co) = (ci))
#define PERFORM_LDAWB(d, co, r1, r2, ci) \
((d) = (r1) - ((r2) << 2), (co) = (ci))
#ifndef PERFORM_CMP
#define PERFORM_CMP(d, co, r1, r2, ci) \
do { \
unsigned_word __x = (r1) - (r2); \
unsigned_word __result_b = __x >> (BITS_PER_WORD - 1) ; \
unsigned_word __r1_b = (unsigned_word)(r1) >> (BITS_PER_WORD - 1) ; \
unsigned_word __r2_b = (unsigned_word)(r2) >> (BITS_PER_WORD - 1) ; \
((co) = ((~__r1_b & __r2_b) | (__r2_b & __result_b) | (__result_b & ~__r1_b))&1); \
} while (0)
#endif
#ifndef PERFORM_CMPC
#define PERFORM_CMPC(d, co, r1, r2, ci) \
do { \
unsigned_word __x = (r1) - (r2) - (ci); \
unsigned_word __result_b = __x >> (BITS_PER_WORD - 1) ; \
unsigned_word __r1_b = (unsigned_word)(r1) >> (BITS_PER_WORD - 1) ; \
unsigned_word __r2_b = (unsigned_word)(r2) >> (BITS_PER_WORD - 1) ; \
((co) = ((~__r1_b & __r2_b) | (__r2_b & __result_b) | (__result_b & ~__r1_b))&1); \
} while (0)
#endif
#ifndef PERFORM_CMPPAR
#define PERFORM_CMPPAR(d, co, r1, r2, ci) \
do { \
word __x; \
union { long w; short h[2]; char b[4]; } __r1, __r2; \
__r1.w = (r1); __r2.w = (r2); \
__x = ((__r1.h[0] != __r2.h[0]) && (__r1.h[1] != __r2.h[1])) << 14; \
__x |= ((__r1.b[0] != __r2.b[0]) && (__r1.b[1] != __r2.b[1]) \
&& (__r1.b[2] != __r2.b[2]) && (__r1.b[3] != __r2.b[3])) << 12; \
__x |= ((unsigned_word) (r1) >= (unsigned_word) (r2)) << 10; \
__x |= ((unsigned_word) (r1) <= (unsigned_word) (r2)) << 8; \
__x |= ((signed_word) (r1) >= (signed_word) (r2)) << 6; \
__x |= ((signed_word) (r1) <= (signed_word) (r2)) << 4; \
__x |= ((r1) != (r2)) << 2; \
(d) = __x + 0x5554; /* binary 0101010101010100 */ \
(co) = (ci); \
} while (0)
#endif
/* Logic operations that don't affect carry. */
#ifndef PERFORM_AND
#define PERFORM_AND(d, co, r1, r2, ci) \
((d) = (r1) & (r2), (co) = (ci))
#endif
#ifndef PERFORM_IOR
#define PERFORM_IOR(d, co, r1, r2, ci) \
((d) = (r1) | (r2), (co) = (ci))
#endif
#ifndef PERFORM_XOR
#define PERFORM_XOR(d, co, r1, r2, ci) \
((d) = (r1) ^ (r2), (co) = (ci))
#endif
#ifndef PERFORM_ANDC
#define PERFORM_ANDC(d, co, r1, r2, ci) \
((d) = (r1) & ~(r2), (co) = (ci))
#endif
#ifndef PERFORM_IORC
#define PERFORM_IORC(d, co, r1, r2, ci) \
((d) = (r1) | ~(r2), (co) = (ci))
#endif
#ifndef PERFORM_EQV
#define PERFORM_EQV(d, co, r1, r2, ci) \
((d) = (r1) ^ ~(r2), (co) = (ci))
#endif
#ifndef PERFORM_NAND
#define PERFORM_NAND(d, co, r1, r2, ci) \
((d) = ~((r1) & (r2)), (co) = (ci))
#endif
#ifndef PERFORM_NOR
#define PERFORM_NOR(d, co, r1, r2, ci) \
((d) = ~((r1) | (r2)), (co) = (ci))
#endif
/* Logic operations that reset carry. */
#ifndef PERFORM_AND_RC
#define PERFORM_AND_RC(d, co, r1, r2, ci) \
((d) = (r1) & (r2), (co) = 0)
#endif
#ifndef PERFORM_IOR_RC
#define PERFORM_IOR_RC(d, co, r1, r2, ci) \
((d) = (r1) | (r2), (co) = 0)
#endif
#ifndef PERFORM_XOR_RC
#define PERFORM_XOR_RC(d, co, r1, r2, ci) \
((d) = (r1) ^ (r2), (co) = 0)
#endif
#ifndef PERFORM_ANDC_RC
#define PERFORM_ANDC_RC(d, co, r1, r2, ci) \
((d) = (r1) & ~(r2), (co) = 0)
#endif
#ifndef PERFORM_IORC_RC
#define PERFORM_IORC_RC(d, co, r1, r2, ci) \
((d) = (r1) | ~(r2), (co) = 0)
#endif
#ifndef PERFORM_EQV_RC
#define PERFORM_EQV_RC(d, co, r1, r2, ci) \
((d) = (r1) ^ ~(r2), (co) = 0)
#endif
#ifndef PERFORM_NAND_RC
#define PERFORM_NAND_RC(d, co, r1, r2, ci) \
((d) = ~((r1) & (r2)), (co) = 0)
#endif
#ifndef PERFORM_NOR_RC
#define PERFORM_NOR_RC(d, co, r1, r2, ci) \
((d) = ~((r1) | (r2)), (co) = 0)
#endif
/* Logic operations that clobber carry. */
#ifndef PERFORM_AND_CC
#define PERFORM_AND_CC(d, co, r1, r2, ci) \
((d) = (r1) & (r2), (co) = -1)
#endif
#ifndef PERFORM_IOR_CC
#define PERFORM_IOR_CC(d, co, r1, r2, ci) \
((d) = (r1) | (r2), (co) = -1)
#endif
#ifndef PERFORM_XOR_CC
#define PERFORM_XOR_CC(d, co, r1, r2, ci) \
((d) = (r1) ^ (r2), (co) = -1)
#endif
#ifndef PERFORM_ANDC_CC
#define PERFORM_ANDC_CC(d, co, r1, r2, ci) \
((d) = (r1) & ~(r2), (co) = -1)
#endif
#ifndef PERFORM_IORC_CC
#define PERFORM_IORC_CC(d, co, r1, r2, ci) \
((d) = (r1) | ~(r2), (co) = -1)
#endif
#ifndef PERFORM_EQV_CC
#define PERFORM_EQV_CC(d, co, r1, r2, ci) \
((d) = (r1) ^ ~(r2), (co) = -1)
#endif
#ifndef PERFORM_NAND_CC
#define PERFORM_NAND_CC(d, co, r1, r2, ci) \
((d) = ~((r1) & (r2)), (co) = -1)
#endif
#ifndef PERFORM_NOR_CC
#define PERFORM_NOR_CC(d, co, r1, r2, ci) \
((d) = ~((r1) | (r2)), (co) = -1)
#endif
#ifndef PERFORM_LSHIFTR
#define PERFORM_LSHIFTR(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) >> TRUNC_CNT(r2)), \
(co) = (ci))
#endif
#ifndef PERFORM_ASHIFTR
#define PERFORM_ASHIFTR(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >> TRUNC_CNT(r2)), \
(co) = (ci))
#endif
#ifndef PERFORM_SHIFTL
#define PERFORM_SHIFTL(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) << TRUNC_CNT(r2)), (co) = (ci))
#endif
#ifndef PERFORM_ROTATEL
#define PERFORM_ROTATEL(d, co, r1, r2, ci) \
((d) = TRUNC_CNT(r2) == 0 ? (r1) \
: ((r1) << TRUNC_CNT(r2)) | ((r1) >> TRUNC_CNT(BITS_PER_WORD - (r2))),\
(co) = (ci))
#endif
#ifndef PERFORM_LSHIFTR_CO
#define PERFORM_LSHIFTR_CO(d, co, r1, r2, ci) \
do { word __d = ((unsigned_word) (r1) >> TRUNC_CNT(r2)); \
(co) = ((unsigned_word) (r1) >> (TRUNC_CNT(r2) - 1)) & 1; \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ASHIFTR_CO
#define PERFORM_ASHIFTR_CO(d, co, r1, r2, ci) \
do { word __d = ((signed_word) (r1) >> TRUNC_CNT(r2)); \
(co) = ((signed_word) (r1) >> (TRUNC_CNT(r2) - 1)) & 1; \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_ASHIFTR_CON
#define PERFORM_ASHIFTR_CON(d, co, r1, r2, ci) \
do { word __d = ((signed_word) (r1) >> TRUNC_CNT(r2)); \
(co) = (signed_word) (r1) < 0 \
&& ((r1) << TRUNC_CNT(BITS_PER_WORD - (r2))) != 0; \
(d) = __d; } while (0)
#endif
#ifndef PERFORM_SHIFTL_CO
#define PERFORM_SHIFTL_CO(d, co, r1, r2, ci) \
do { word __d = ((unsigned_word) (r1) << TRUNC_CNT(r2)); \
(co) = ((r1) >> TRUNC_CNT(BITS_PER_WORD - (r2))) & 1; \
(d) = __d; } while (0)
#endif
/* Do these first two rotates actually set carry correctly for r2 == 0??? */
#ifndef PERFORM_ROTATEL_CO
#define PERFORM_ROTATEL_CO(d, co, r1, r2, ci) \
((d) = (((r1) << TRUNC_CNT(r2)) \
| ((unsigned_word) (r1) >> TRUNC_CNT(BITS_PER_WORD - (r2)))), \
(co) = (d) & 1)
#endif
#ifndef PERFORM_ROTATER_CO
#define PERFORM_ROTATER_CO(d, co, r1, r2, ci) \
((d) = (((r1) >> TRUNC_CNT(r2)) \
| ((unsigned_word) (r1) << TRUNC_CNT(BITS_PER_WORD - (r2)))), \
(co) = ((d) >> (BITS_PER_WORD - 1)) & 1)
#endif
#ifndef PERFORM_ROTATEXL_CIO
#define PERFORM_ROTATEXL_CIO(d, co, r1, r2, ci) \
do { word __d; unsigned cnt = TRUNC_CNT(r2); \
if (cnt != 0) \
{ \
__d = ((r1) << cnt) | ((ci) << (cnt - 1)); \
if (cnt != 1) \
__d |= (unsigned_word) (r1) >> (BITS_PER_WORD - (cnt - 1));\
(co) = ((unsigned_word) (r1) >> (BITS_PER_WORD - cnt)) & 1; \
(d) = __d; \
} \
else \
{ \
(co) = (ci); \
(d) = (r1); \
} \
} while (0)
#endif
#ifndef PERFORM_ROTATEXR_CIO
#define PERFORM_ROTATEXR_CIO(d, co, r1, r2, ci) \
do { word __d; unsigned cnt = TRUNC_CNT(r2); \
if (cnt != 0) \
{ \
__d = ((unsigned_word) (r1) >> cnt) | ((ci) << (BITS_PER_WORD - cnt)); \
if (cnt != 1) \
__d |= ((r1) << (BITS_PER_WORD - (cnt - 1))); \
(co) = ((unsigned_word) (r1) >> (cnt - 1)) & 1; \
(d) = __d; \
} \
else \
{ \
(co) = (ci); \
(d) = (r1); \
} \
} while (0)
#endif
#ifndef PERFORM_EXTS1
#define PERFORM_EXTS1(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >> TRUNC_CNT(r2)) << 31 >> 31, (co) = (ci))
#endif
#ifndef PERFORM_EXTS2
#define PERFORM_EXTS2(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >> TRUNC_CNT(r2)) << 30 >> 30, (co) = (ci))
#endif
#ifndef PERFORM_EXTS8
#define PERFORM_EXTS8(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >> TRUNC_CNT(r2)) << 24 >> 24, (co) = (ci))
#endif
#ifndef PERFORM_EXTS16
#define PERFORM_EXTS16(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >> TRUNC_CNT(r2)) << 16 >> 16, (co) = (ci))
#endif
#ifndef PERFORM_EXTU1
#define PERFORM_EXTU1(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) >> TRUNC_CNT(r2)) & 1, (co) = (ci))
#endif
#ifndef PERFORM_EXTU2
#define PERFORM_EXTU2(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) >> TRUNC_CNT(r2)) & 3, (co) = (ci))
#endif
#ifndef PERFORM_DOZ
#define PERFORM_DOZ(d, co, r1, r2, ci) \
(((d) = (signed_word) (r1) > (signed_word) (r2) ? (r1) - (r2) : 0), \
(co) = (ci))
#endif
#ifndef PERFORM_CPEQ
#define PERFORM_CPEQ(d, co, r1, r2, ci) \
((d) = ((r1) == (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPGE
#define PERFORM_CPGE(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) >= (signed_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPGEU
#define PERFORM_CPGEU(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) >= (unsigned_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPGT
#define PERFORM_CPGT(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) > (signed_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPGTU
#define PERFORM_CPGTU(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) > (unsigned_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPLE
#define PERFORM_CPLE(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) <= (signed_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPLEU
#define PERFORM_CPLEU(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) <= (unsigned_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPLT
#define PERFORM_CPLT(d, co, r1, r2, ci) \
((d) = ((signed_word) (r1) < (signed_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPLTU
#define PERFORM_CPLTU(d, co, r1, r2, ci) \
((d) = ((unsigned_word) (r1) < (unsigned_word) (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CPNEQ
#define PERFORM_CPNEQ(d, co, r1, r2, ci) \
((d) = ((r1) != (r2)) << 31, (co) = (ci))
#endif
#ifndef PERFORM_CMPEQ
#define PERFORM_CMPEQ(d, co, r1, r2, ci) \
((d) = (r1) == (r2), (co) = (ci))
#endif
#ifndef PERFORM_CMPLE
#define PERFORM_CMPLE(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) <= (signed_word) (r2), (co) = (ci))
#endif
#ifndef PERFORM_CMPLEU
#define PERFORM_CMPLEU(d, co, r1, r2, ci) \
((d) = (unsigned_word) (r1) <= (unsigned_word) (r2), (co) = (ci))
#endif
#ifndef PERFORM_CMPLT
#define PERFORM_CMPLT(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) < (signed_word) (r2), (co) = (ci))
#endif
#ifndef PERFORM_CMPLTU
#define PERFORM_CMPLTU(d, co, r1, r2, ci) \
((d) = (unsigned_word) (r1) < (unsigned_word) (r2), (co) = (ci))
#endif
#ifndef PERFORM_CYEQ
#define PERFORM_CYEQ(d, co, r1, r2, ci) \
((co) = (r1) == (r2))
#endif
#ifndef PERFORM_CYGES
#define PERFORM_CYGES(d, co, r1, r2, ci) \
((co) = (signed_word) (r1) >= (signed_word) (r2))
#endif
#ifndef PERFORM_CYGEU
#define PERFORM_CYGEU(d, co, r1, r2, ci) \
((co) = (unsigned_word) (r1) >= (unsigned_word) (r2))
#endif
#ifndef PERFORM_CYGTS
#define PERFORM_CYGTS(d, co, r1, r2, ci) \
((co) = (signed_word) (r1) > (signed_word) (r2))
#endif
#ifndef PERFORM_CYGTU
#define PERFORM_CYGTU(d, co, r1, r2, ci) \
((co) = (unsigned_word) (r1) > (unsigned_word) (r2))
#endif
#ifndef PERFORM_CYAND
#define PERFORM_CYAND(d, co, r1, r2, ci) \
((co) = ((r1) & (r2)) == 0)
#endif
#ifndef PERFORM_MERGE16
#define PERFORM_MERGE16(d, co, r1, r2, ci) \
((d) = ((word) (r1) >> 16) | ((r2) << 16), (co) = (ci))
#endif
#ifndef PERFORM_DECR_CYEQ
#define PERFORM_DECR_CYEQ(d, co, r1, r2, ci) \
((d) = ((r1) - 1), (co) = (r1) == (r2)) /* should protect from samevar(d,r1/r2) ??? */
#endif
#ifndef PERFORM_MKMSK
#define PERFORM_MKMSK(d, co, r1, ci) \
((d) = ((unsigned_word) (r1) > 31) ? 0xffffffff : (1 << (r1)) - 1, (co) = (ci))
#endif
/* Unary operations. */
#ifndef PERFORM_CLZ
#define PERFORM_CLZ(d, co, r1, ci) \
do { \
int __a = 0; \
word __r = (r1); \
if (__r > 0xffffffff) \
__r = __r >> 31 >> 1, __a += 32; \
if (__r > 0xffff) \
__r >>= 16, __a += 16; \
if (__r > 0xff) \
__r >>= 8, __a += 8; \
(d) = clz_tab[__r] - __a + BITS_PER_WORD - 32; \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_CTZ
/* This can be done faster using the (x & -x) trick. */
#define PERFORM_CTZ(d, co, r1, ci) \
do { \
int __a; \
abort (); \
__a = ((r1) & 0xffff == 0) \
? (((r1) & 0xff0000) == 0 ? 24 : 16) \
: ((r1) & 0xff == 0) ? 8 : 0; \
(d) = ctz_tab[((r1) >> __a) & 0xff] + __a; \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_BITREV
#define PERFORM_BITREV(d, co, r1, ci) \
do { \
unsigned_word __a = (r1); \
__a = ((__a & 0xaaaaaaaa) >> 1) | ((__a & 0x55555555) << 1); \
__a = ((__a & 0xcccccccc) >> 2) | ((__a & 0x33333333) << 2); \
__a = ((__a & 0xf0f0f0f0) >> 4) | ((__a & 0x0f0f0f0f) << 4); \
__a = ((__a & 0xff00ff00) >> 8) | ((__a & 0x00ff00ff) << 8); \
(d) = (__a >> 16) | (__a << 16); \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_BYTEREV
#define PERFORM_BYTEREV(d, co, r1, ci) \
do { \
(d) = (((r1) & 0x000000ff) << 24) | \
(((r1) & 0x0000ff00) << 8) | \
(((r1) & 0x00ff0000) >> 8) | \
(((r1) & 0xff000000) >> 24); \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_FF1
#define PERFORM_FF1(d, co, r1, ci) \
do { \
int __a; \
__a = (r1) <= 0xffff \
? ((r1) <= 0xff ? 0 : 8) \
: ((r1) <= 0xffffff ? 16 : 24); \
(d) = ff1_tab[(r1) >> __a] + __a; \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_FF0
#define PERFORM_FF0(d, co, r1, ci) \
PERFORM_FF1(d, co, ~(r1), ci)
#endif
#ifndef PERFORM_FFS
#define PERFORM_FFS(d, co, r1, ci) \
do { \
word __x = (r1) & (-r1); \
PERFORM_CLZ(d, co, __x, ci); \
(d) = BITS_PER_WORD - (d); \
} while (0)
#endif
#ifndef PERFORM_BSF86
#define PERFORM_BSF86(d, co, r1, ci) \
do { \
if ((r1) == 0) \
(d) = random_word (); \
else \
PERFORM_FF1(d, co, (r1) & -(r1), ci); \
(co) = -1; \
} while (0)
#endif
#ifndef PERFORM_ABSVAL
#define PERFORM_ABSVAL(d, co, r1, ci) \
((d) = (signed_word) (r1) < 0 ? -(r1) : (r1), (co) = (ci))
#endif
#ifndef PERFORM_NABSVAL
#define PERFORM_NABSVAL(d, co, r1, ci) \
((d) = (signed_word) (r1) > 0 ? -(r1) : (r1), (co) = (ci))
#endif
#ifndef PERFORM_CMOVEQ
#define PERFORM_CMOVEQ(d, co, r1, r2, ci) \
((d) = (r1) == 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_CMOVNE
#define PERFORM_CMOVNE(d, co, r1, r2, ci) \
((d) = (r1) != 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_CMOVLT
#define PERFORM_CMOVLT(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) < 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_CMOVGE
#define PERFORM_CMOVGE(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) >= 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_CMOVLE
#define PERFORM_CMOVLE(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) <= 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_CMOVGT
#define PERFORM_CMOVGT(d, co, r1, r2, ci) \
((d) = (signed_word) (r1) > 0 ? (r2) : (d), (co) = (ci))
#endif
#ifndef PERFORM_INVDIV
#define PERFORM_INVDIV(v, co, r1, ci) \
do { \
word __q, __r; \
udiv_qrnnd (__q, __r, -(r1), 0, (r1)); \
(v) = __q; \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_INVMOD
#define PERFORM_INVMOD(v, co, r1, ci) \
do { \
word __q, __r; \
udiv_qrnnd (__q, __r, -(r1), 0, (r1)); \
(v) = __r; \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_MUL
#define PERFORM_MUL(v, co, r1, r2, ci) \
do { \
(v) = (r1) * (r2); \
(co) = (ci); \
} while (0)
#endif
#ifndef PERFORM_UMULWIDEN_HI
#define PERFORM_UMULWIDEN_HI(v, co, r1, r2, ci) \
do { \
word __ph, __pl; \
umul_ppmm (__ph, __pl, (r1), (r2)); \
(v) = __ph; \
(co) = (ci); \
} while (0)
#endif
#ifdef UDIV_WITH_SDIV
#define PERFORM_SDIV(v, co, r1, r2, ci) \
do { \
if ((r2) != 0) \
(v) = (signed_word) (r1) / (signed_word) (r2); \
else \
(v) = 0; \
(co) = (ci); \
} while (0)
#endif /* UDIV_WITH_SDIV */
/* HP-PA nullifying instructions. */
#define PERFORM_NULLIFIED(v, co, sc, ci) \
((v) = values[dr], (co) = (ci), (sc) = 0)
#define PERFORM_COPY_S(d, co, sc, r1, ci) \
((d) = (r1), (co) = (ci), (sc) = 1)
#define PERFORM_ADD_SEQ(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (r1) == -(r2))
#define PERFORM_ADD_SNE(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (r1) != -(r2))
#define PERFORM_ADD_SLTS(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (r1) < -(signed_word) (r2))
#define PERFORM_ADD_SGES(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (r1) >= -(signed_word) (r2))
#define PERFORM_ADD_SLES(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (r1) <= -(signed_word) (r2))
#define PERFORM_ADD_SGTS(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (r1) > -(signed_word) (r2))
#define PERFORM_ADD_SLTU(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (unsigned_word) (r1) < -(unsigned_word) (r2))
#define PERFORM_ADD_SGEU(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (unsigned_word) (r1) >= -(unsigned_word) (r2))
#define PERFORM_ADD_SLEU(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (unsigned_word) (r1) <= -(unsigned_word) (r2))
#define PERFORM_ADD_SGTU(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (unsigned_word) (r1) > -(unsigned_word) (r2))
#define PERFORM_ADD_SOVS(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (~((r1) ^ (r2)) & ((d) ^ (r1))) < 0)
#define PERFORM_ADD_SNVS(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = (signed_word) (~((r1) ^ (r2)) & ((d) ^ (r1))) >= 0)
#define PERFORM_ADD_SODD(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = ((d) & 1) != 0)
#define PERFORM_ADD_SEVN(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), \
sc = ((d) & 1) == 0)
#define PERFORM_ADD_S(d, co, sc, r1, r2, ci) \
((d) = (r1) + (r2), (co) = (ci), (sc) = 1)
#define PERFORM_ADD_CIO_SEQ(d, co, sc, r1, r2, ci) \
do { word __d = (r1) + (r2); \
word __cy = __d < (r1); \
__d += (ci); \
__cy += (__d < (ci)); \
(d) = __d; \
(co) = __cy; \
(sc) = __d == 0; } while (0)
#define PERFORM_ADD_CIO_SNE(d, co, sc, r1, r2, ci) \
do { word __d = (r1) + (r2); \
word __cy = __d < (r1); \
__d += (ci); \
__cy += (__d < (ci)); \
(d) = __d; \
(co) = __cy; \
(sc) = __d != 0; } while (0)
#define PERFORM_ADD_CIO_SLTU(d, co, sc, r1, r2, ci) \