ref: 1cc6febfeccb6d720972dfb09611341bbf49983d
parent: c6af5fbe1f560644ce362b77c13aecd1412f9fbf
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Apr 27 14:02:46 EDT 2023
more updates
--- a/g1regs.h
+++ b/g1regs.h
@@ -1,34 +1,35 @@
enum {
/* SWREG1 */
- SW_DEC_TIMEOUT = 1<<18,
- SW_DEC_ERROR_INT = 1<<16,
- SW_DEC_BUFFER_INT = 1<<14,
- SW_DEC_RDY_INT = 1<<12,
- SW_DEC_ABORT_INT = 1<<11,
- SW_DEC_IRQ = 1<<8,
- SW_DEC_ABORT_E = 1<<5,
- SW_DEC_IRQ_DIS = 1<<4,
- SW_DEC_E = 1<<0,
+ SW_DEC_TIMEOUT = 18,
+ SW_DEC_ERROR_INT = 16,
+ SW_DEC_BUFFER_INT = 14,
+ SW_DEC_RDY_INT = 12,
+ SW_DEC_ABORT_INT = 11,
+ SW_DEC_IRQ = 8,
+ SW_DEC_ABORT_E = 5,
+ SW_DEC_IRQ_DIS = 4,
+ SW_DEC_E = 0,
/* SWREG2 */
- SW_DEC_TIMEOUT_E = 1<<23, /* enable timeouts */
- SW_DEC_STRSWAP32_E = 1<<22, /* = 1 (64-bit) */
- SW_DEC_STRENDIAN_E = 1<<21, /* = 1 (little endian) */
- SW_DEC_INSWAP32_E = 1<<20, /* = 1 (64-bit) */
- SW_DEC_OUTSWAP32_E = 1<<19, /* = 1 (64-bit) */
- SW_DEC_CLK_GATE_E = 1<<10, /* clock gate (0=gated 1=running) */
- SW_DEC_IN_ENDIAN = 1<<9, /* = 1 (little endian) */
- SW_DEC_OUT_ENDIAN = 1<<8, /* = 1 (little endian) */
+ SW_DEC_TIMEOUT_E = 23, /* enable timeouts */
+ SW_DEC_STRSWAP32_E = 22, /* = 1 (64-bit) */
+ SW_DEC_STRENDIAN_E = 21, /* = 1 (little endian) */
+ SW_DEC_INSWAP32_E = 20, /* = 1 (64-bit) */
+ SW_DEC_OUTSWAP32_E = 19, /* = 1 (64-bit) */
+ SW_DEC_CLK_GATE_E = 10, /* clock gate (0=gated 1=running) */
+ SW_DEC_IN_ENDIAN = 9, /* = 1 (little endian) */
+ SW_DEC_OUT_ENDIAN = 8, /* = 1 (little endian) */
SW_DEC_MAX_BURST = 0, /* = 16 for AIX is the max */
/* SWREG3 */
- SW_PIC_INTERLACE_E = 1<<23, /* = !sps.frame_mbs_only_flag &&
- * (sps.mb_adaptive_frame_field_flag || pic.field_pic_flag) */
- SW_PIC_FIELDMODE_E = 1<<22, /* = !sps.frame_mbs_only_flag && pic.field_pic_flag */
- SW_PIC_TOPFIELD_E = 1<<19, /* = !sps.frame_mbs_only_flag && !pic.bottom_field_flag */
- SW_WRITE_MVS_E = 1<<12, /* = sps.profile_idc > 66 && sps.nal_ref_idc != 0 */
- SW_SEQ_MBAFF_E = 1<<10, /* = sps.mb_adaptive_frame_field_flag */
- SW_PICORD_COUNT_E = 1<<9, /* = sps.profile_idc > 66 (higher than baseline profile) */
+ SW_PIC_INTERLACE_E = 23, /* = !sps.frame_mbs_only_flag &&
+ * (sps.mb_adaptive_frame_field_flag || sh.field_pic_flag)
+ */
+ SW_PIC_FIELDMODE_E = 22, /* = !sps.frame_mbs_only_flag && sh.field_pic_flag */
+ SW_PIC_TOPFIELD_E = 19, /* = !sps.frame_mbs_only_flag && !sh.bottom_field_flag */
+ SW_WRITE_MVS_E = 12, /* = sps.profile_idc > 66 && sps.nal_ref_idc != 0 */
+ SW_SEQ_MBAFF_E = 10, /* = sps.mb_adaptive_frame_field_flag */
+ SW_PICORD_COUNT_E = 9, /* = sps.profile_idc > 66 (higher than baseline profile) */
SW_DEC_AXI_WR_ID = 0, /* AIX id, 0xff for autoalloc */
/* SWREG4 */
@@ -38,33 +39,33 @@
/* SWREG5 */
SW_STRM_START_BIT = 26, /* = 0 (always starting at byte boundary) */
- SW_TYPE1_QUANT_E = 1<<24, /* = pps.pic_scaling_matrix_present_flag */
+ SW_TYPE1_QUANT_E = 24, /* = pps.pic_scaling_matrix_present_flag */
SW_CH_QP_OFFSET = 19, /* = pps.chroma_qp_index_offset */
SW_CH_QP_OFFSET2 = 14, /* = pps.second_chroma_qp_index_offset */
- SW_FIELDPIC_FLAG_E = 1<<0, /* = !sps.frame_mbs_only_flag */
+ SW_FIELDPIC_FLAG_E = 0, /* = !sps.frame_mbs_only_flag */
/* SWREG6 */
- SW_START_CODE_E = 1<<31, /* = 1 */
+ SW_START_CODE_E = 31, /* = 1 */
SW_INIT_QP = 25, /* = pps.pic_init_qp_minus26 + 26 */
SW_STREAM_LEN = 0, /* = size of the available input in bytes */
/* SWREG7 */
- SW_CABAC_E = 1<<31, /* = pps.entropy_coding_mode_flag */
- SW_BLACKWHITE_E = 1<<30, /* = sps.chroma_format_idc == 0 && sps.profile_idc >= 100 (>= high profile) */
- SW_DIR_8X8_INFER_E = 1<<29, /* = sps.direct_8x8_inference_flag */
- SW_WEIGHT_PRED_E = 1<<28, /* = pps.weighted_pred_flag */
+ SW_CABAC_E = 31, /* = pps.entropy_coding_mode_flag */
+ SW_BLACKWHITE_E = 30, /* = sps.chroma_format_idc == 0 && sps.profile_idc >= 100 (>= high profile) */
+ SW_DIR_8X8_INFER_E = 29, /* = sps.direct_8x8_inference_flag */
+ SW_WEIGHT_PRED_E = 28, /* = pps.weighted_pred_flag */
SW_WEIGHT_BIPR_IDC = 26, /* = pps.weighted_bipred_idc */
SW_FRAMENUM_LEN = 16, /* = sps.log2_max_frame_num_minus4 + 4 */
- SW_FRAMENUM = 0, /* = pic.frame_num */
+ SW_FRAMENUM = 0, /* = sh.frame_num */
/* SWREG8 */
- SW_CONST_INTRA_E = 1<<31, /* = pps.constrained_intra_pred_flag */
- SW_FILT_CTRL_PRES = 1<<30, /* = pps.deblocking_filter_control_present_flag */
- SW_RDPIC_CNT_PRES = 1<<29, /* = pps.redundant_pic_cnt_present_flag */
- SW_8X8TRANS_FLAG_E = 1<<28, /* = pps.transform_8x8_mode_flag */
- SW_REFPIC_MK_LEN = 17, /* = size (in bits) of pic.dec_ref_pic_marking */
- SW_IDR_PIC_E = 1<<16, /* = pic.nal_unit_type == 5 (IDR slice) */
- SW_IDR_PIC_ID = 0, /* = pic.idr_pic_id */
+ SW_CONST_INTRA_E = 31, /* = pps.constrained_intra_pred_flag */
+ SW_FILT_CTRL_PRES = 30, /* = pps.deblocking_filter_control_present_flag */
+ SW_RDPIC_CNT_PRES = 29, /* = pps.redundant_pic_cnt_present_flag */
+ SW_8X8TRANS_FLAG_E = 28, /* = pps.transform_8x8_mode_flag */
+ SW_REFPIC_MK_LEN = 17, /* = size (in bits) of sh.dec_ref_pic_marking (sps.nal_ref_idc != 0) */
+ SW_IDR_PIC_E = 16, /* = sh.nal_unit_type == 5 (IDR slice) */
+ SW_IDR_PIC_ID = 0, /* = sh.idr_pic_id */
/* SWREG9 */
SW_PPS_ID = 24, /* = pps.pic_parameter_set_id */
@@ -71,10 +72,10 @@
SW_REFIDX1_ACTIVE = 19, /* = pps.num_ref_idx_l1_default_active_minus1 + 1 */
SW_REFIDX0_ACTIVE = 14, /* = pps.num_ref_idx_l0_default_active_minus1 + 1 */
SW_POC_LENGTH = 0, /* = sum of sizes (in bits) of:
- * 1) pic.pic_order_cnt_lsb
- * 2) pic.delta_pic_order_cnt_bottom
- * 3) pic.delta_pic_order_cnt0
- * 4) pic.delta_pic_order_cnt1
+ * 1) sh.pic_order_cnt_lsb
+ * 2) sh.delta_pic_order_cnt_bottom
+ * 3) sh.delta_pic_order_cnt0
+ * 4) sh.delta_pic_order_cnt1
*/
/* SWREG12 */
@@ -85,8 +86,8 @@
/* SWREG14 ... SWREG29 */
SW_REFERx_BASE = 0,
- SW_REFERx_FIELD_E = 1<<1,
- SW_REFERx_TOPC_E = 1<<0,
+ SW_REFERx_FIELD_E = 1,
+ SW_REFERx_TOPC_E = 0,
/* SWREG30 ... SWREG37 */
SW_REFERx_NBR_NEXT = 16,
@@ -108,10 +109,10 @@
* (see 8.2.1.1 - 8.2.1.3)
* alternating top and bottom field order counts
* 32 + 2 - 32-bit ints
- * 3) scaling lists (sps.scaling_matrix_present_flag != 0 ||
+ * 3) scaling lists (sps.seq_scaling_matrix_present_flag != 0 ||
* pps.pic_scaling_matrix_present_flag != 0)
* 4x4 + 8x8 - after inverse scanning process (8.5.6)
- * [6][16] + [6][64] - [3][2][1][0][7][6][5][4]... (little endia, 64bit)
+ * [6][16] + [6][64] - [3][2][1][0][7][6][5][4]... (little endian, 64bit)
*/
/* SWREG41 */
@@ -129,6 +130,6 @@
SW_PRED_BC_TAP_0_2 = 2, /* = 20 ^ */
/* SWREG58 */
- SW_DEC_MULTICORE_E = 1<<30, /* is this even usable? */
- SW_DEC_WRITESTAT_E = 1<<29,
+ SW_DEC_MULTICORE_E = 30, /* is this even usable? */
+ SW_DEC_WRITESTAT_E = 29,
};
--- a/hantest.c
+++ b/hantest.c
@@ -1,60 +1,226 @@
#include <u.h>
#include <libc.h>
+#include <ctype.h>
+#include "g1regs.h"
+enum {
+ DecodeH264,
+};
+
+typedef struct VPUctx VPUctx;
+
+struct VPUctx {
+ int slen;
+
+ union {
+ /* h.264 decoding */
+ struct {
+ struct {
+ u16int pic_height_in_map_units_minus1;
+ u16int pic_width_in_mbs_minus1;
+ u8int chroma_format_idc;
+ u8int frame_mbs_only_flag;
+ u8int log2_max_frame_num_minus4;
+ u8int max_num_ref_frames;
+ u8int nal_ref_idc;
+ u8int profile_idc;
+ u8int direct_8x8_inference_flag;
+ u8int mb_adaptive_frame_field_flag;
+ u8int seq_scaling_matrix_present_flag;
+ }sps;
+ struct {
+ u8int chroma_qp_index_offset;
+ u8int pic_init_qp_minus26;
+ u8int second_chroma_qp_index_offset;
+ u8int weighted_bipred_idc;
+ u8int pic_parameter_set_id;
+ u8int num_ref_idx_l0_default_active_minus1;
+ u8int num_ref_idx_l1_default_active_minus1;
+ u8int constrained_intra_pred_flag;
+ u8int deblocking_filter_control_present_flag;
+ u8int entropy_coding_mode_flag;
+ u8int pic_scaling_matrix_present_flag;
+ u8int redundant_pic_cnt_present_flag;
+ u8int transform_8x8_mode_flag;
+ u8int weighted_pred_flag;
+ }pps;
+ struct {
+ u16int frame_num;
+ u16int idr_pic_id;
+ u32int size_dec_ref_pic_marking;
+ u8int size_pic_order_cnt_lsb;
+ u8int size_delta_pic_order_cnt_bottom;
+ u8int size_delta_pic_order_cnt0;
+ u8int size_delta_pic_order_cnt1;
+ u8int nal_unit_type;
+ u8int field_pic_flag;
+ u8int bottom_field_flag;
+ }sh;
+ };
+ };
+};
+
+static int process;
+
static u32int *g1, *g2;
+static void
+g1load(VPUctx *c)
+{
+ g1[2] = 16 << SW_DEC_MAX_BURST | /* AXI burst length = 16 */
+ 1 << SW_DEC_STRSWAP32_E | 1 << SW_DEC_STRENDIAN_E | /* 64bit / little endian */
+ 1 << SW_DEC_INSWAP32_E | 1 << SW_DEC_OUTSWAP32_E |
+ 1 << SW_DEC_IN_ENDIAN | 1 << SW_DEC_OUT_ENDIAN |
+ 1 << SW_DEC_TIMEOUT_E; /* timeout interrupt */
+
+ g1[3] = (c->sps.frame_mbs_only_flag == 0 &&
+ (c->sps.mb_adaptive_frame_field_flag || c->sh.field_pic_flag)) << SW_PIC_INTERLACE_E |
+ (c->sps.frame_mbs_only_flag == 0 && c->sh.field_pic_flag) << SW_PIC_FIELDMODE_E |
+ (c->sps.frame_mbs_only_flag == 0 && c->sh.bottom_field_flag == 0) << SW_PIC_TOPFIELD_E |
+ (c->sps.profile_idc > 66 && c->sps.nal_ref_idc != 0) << SW_WRITE_MVS_E |
+ c->sps.mb_adaptive_frame_field_flag << SW_SEQ_MBAFF_E |
+ (c->sps.profile_idc > 66) << SW_PICORD_COUNT_E |
+ 0xff << SW_DEC_AXI_WR_ID;
+
+ g1[4] = (c->sps.pic_width_in_mbs_minus1 + 1) << SW_PIC_MB_WIDTH |
+ (c->sps.pic_height_in_map_units_minus1 + 1) << SW_PIC_MB_HEIGHT_P |
+ c->sps.max_num_ref_frames << SW_REF_FRAMES;
+
+ g1[5] = 0 << SW_STRM_START_BIT |
+ c->pps.pic_scaling_matrix_present_flag << SW_TYPE1_QUANT_E |
+ c->pps.chroma_qp_index_offset << SW_CH_QP_OFFSET |
+ c->pps.second_chroma_qp_index_offset << SW_CH_QP_OFFSET2 |
+ (c->sps.frame_mbs_only_flag == 0) << SW_FIELDPIC_FLAG_E;
+
+ g1[6] = 1 << SW_START_CODE_E |
+ (c->pps.pic_init_qp_minus26 + 26) << SW_INIT_QP |
+ c->slen << SW_STREAM_LEN;
+
+ g1[7] = c->pps.entropy_coding_mode_flag << SW_CABAC_E |
+ (c->sps.chroma_format_idc == 0 && c->sps.profile_idc >= 100) << SW_BLACKWHITE_E |
+ c->sps.direct_8x8_inference_flag << SW_DIR_8X8_INFER_E |
+ c->pps.weighted_pred_flag << SW_WEIGHT_PRED_E |
+ c->pps.weighted_bipred_idc << SW_WEIGHT_BIPR_IDC |
+ (c->sps.log2_max_frame_num_minus4 + 4) << SW_FRAMENUM_LEN |
+ c->sh.frame_num << SW_FRAMENUM;
+
+ g1[8] = c->pps.constrained_intra_pred_flag << SW_CONST_INTRA_E |
+ c->pps.deblocking_filter_control_present_flag << SW_FILT_CTRL_PRES |
+ c->pps.redundant_pic_cnt_present_flag << SW_RDPIC_CNT_PRES |
+ c->pps.transform_8x8_mode_flag << SW_8X8TRANS_FLAG_E |
+ (c->sps.nal_ref_idc != 0 ? c->sh.size_dec_ref_pic_marking : 0) << SW_REFPIC_MK_LEN |
+ (c->sh.nal_unit_type == 5) << SW_IDR_PIC_E |
+ c->sh.idr_pic_id << SW_IDR_PIC_ID;
+
+ g1[9] = c->pps.pic_parameter_set_id << SW_PPS_ID |
+ (c->pps.num_ref_idx_l1_default_active_minus1 + 1) << SW_REFIDX1_ACTIVE |
+ (c->pps.num_ref_idx_l0_default_active_minus1 + 1) << SW_REFIDX0_ACTIVE |
+ (c->sh.size_pic_order_cnt_lsb + c->sh.size_delta_pic_order_cnt_bottom +
+ c->sh.size_delta_pic_order_cnt0 + c->sh.size_delta_pic_order_cnt1) << SW_POC_LENGTH;
+
+ /* fixed 6-tap filter values (1 -5 20) */
+ g1[49] = 1 << SW_PRED_BC_TAP_0_0 |
+ (-5 & ((1<<(SW_PRED_BC_TAP_0_0-SW_PRED_BC_TAP_0_1))-1)) << SW_PRED_BC_TAP_0_1 |
+ 20 << SW_PRED_BC_TAP_0_2;
+}
+
+static int
+parsecmd(VPUctx *c, char *s)
+{
+ char *a[4];
+ int n, x;
+
+#define value(name, field, min, max) \
+ if(strcmp(a[1], name) == 0){ \
+ if(x < (min) || x > (max)) \
+ return -1; \
+ field = x; \
+ return 0; \
+ }
+
+ if((n = tokenize(s, a, nelem(a))) < 2)
+ return -1;
+
+ if(strcmp(a[0], "decode") == 0){
+ if(n == 2 && strcmp(a[1], "h.264") == 0){
+ process = DecodeH264;
+ return 0;
+ }
+ }else if(process == DecodeH264 && n == 3){
+ x = atoi(a[2]);
+ if(strcmp(a[0], "sps") == 0){
+ value("pic_height_in_map_units_minus1", c->sps.pic_height_in_map_units_minus1, 0, 0xff);
+ value("pic_width_in_mbs_minus1", c->sps.pic_width_in_mbs_minus1, 0, 0xff);
+ value("chroma_format_idc", c->sps.chroma_format_idc, 0, 3);
+ value("log2_max_frame_num_minus4", c->sps.log2_max_frame_num_minus4, 0, 12);
+ value("max_num_ref_frames", c->sps.max_num_ref_frames, 0, 16);
+ value("nal_ref_idc", c->sps.nal_ref_idc, 0, 3);
+ value("profile_idc", c->sps.profile_idc, 0, 0xff);
+ value("direct_8x8_inference_flag", c->sps.direct_8x8_inference_flag, 0, 1);
+ value("frame_mbs_only_flag", c->sps.frame_mbs_only_flag, 0, 1);
+ value("mb_adaptive_frame_field_flag", c->sps.mb_adaptive_frame_field_flag, 0, 1);
+ value("seq_scaling_matrix_present_flag", c->sps.seq_scaling_matrix_present_flag, 0, 1);
+ }else if(strcmp(a[0], "pps") == 0){
+ value("chroma_qp_index_offset", c->pps.chroma_qp_index_offset, 0, (1<<5)-1);
+ value("pic_init_qp_minus26", c->pps.pic_init_qp_minus26, 0, (1<<6)-1);
+ value("second_chroma_qp_index_offset", c->pps.second_chroma_qp_index_offset, 0, (1<<5)-1);
+ value("weighted_bipred_idc", c->pps.weighted_bipred_idc, 0, 2);
+ value("pic_parameter_set_id", c->pps.pic_parameter_set_id, 0, 0xff);
+ value("num_ref_idx_l0_default_active_minus1", c->pps.num_ref_idx_l0_default_active_minus1, 0, (1<<5)-1);
+ value("num_ref_idx_l1_default_active_minus1", c->pps.num_ref_idx_l1_default_active_minus1, 0, (1<<5)-1);
+ value("constrained_intra_pred_flag", c->pps.constrained_intra_pred_flag, 0, 1);
+ value("deblocking_filter_control_present_flag", c->pps.deblocking_filter_control_present_flag, 0, 1);
+ value("entropy_coding_mode_flag", c->pps.entropy_coding_mode_flag, 0, 1);
+ value("pic_scaling_matrix_present_flag", c->pps.pic_scaling_matrix_present_flag, 0, 1);
+ value("redundant_pic_cnt_present_flag", c->pps.redundant_pic_cnt_present_flag, 0, 1);
+ value("transform_8x8_mode_flag", c->pps.transform_8x8_mode_flag, 0, 1);
+ value("weighted_pred_flag", c->pps.weighted_pred_flag, 0, 1);
+ }else if(strcmp(a[0], "sh") == 0){
+ value("frame_num", c->sh.frame_num, 0, 0xffff);
+ value("idr_pic_id", c->sh.idr_pic_id, 0, 0xffff);
+ value("nal_unit_type", c->sh.nal_unit_type, 0, 0xff);
+ value("size_dec_ref_pic_marking", c->sh.size_dec_ref_pic_marking, 0, 0x1ffff);
+ value("size_pic_order_cnt_lsb", c->sh.size_pic_order_cnt_lsb, 0, 0xff);
+ value("size_delta_pic_order_cnt_bottom", c->sh.size_delta_pic_order_cnt_bottom, 0, 0xff);
+ value("size_delta_pic_order_cnt0", c->sh.size_delta_pic_order_cnt0, 0, 0xff);
+ value("size_delta_pic_order_cnt1", c->sh.size_delta_pic_order_cnt1, 0, 0xff);
+ value("field_pic_flag", c->sh.field_pic_flag, 0, 1);
+ value("bottom_field_flag", c->sh.bottom_field_flag, 0, 1);
+ return -1;
+ }
+ }
+#undef value
+
+ return -1;
+}
+
void
main(int argc, char **argv)
{
+ int i;
+ u32int x;
+
ARGBEGIN{
}ARGEND
if((g1 = segattach(0, "vpu_hantro_g1", 0, 0x200)) == (void*)-1)
sysfatal("no G1");
- if((g2 = segattach(0, "vpu_hantro_g2", 0, 0x40c+4)) == (void*)-1)
- sysfatal("no G2");
- print("bus: ");
- switch((g1[50]>>16)&7){
- case 1: print("ahb master, ahb slave"); break;
- case 2: print("ocp master, ocp slave"); break;
- case 3: print("axi master, axi slave"); break;
- case 4: print("axi master, apb slave"); break;
- case 5: print("axi master, ahb slave"); break;
- default: print("ERROR\n"); break;
+ /* FIXME will use polling for now */
+ g1[1] = SW_DEC_IRQ_DIS;
+
+ /* run */
+ g1[2] |= SW_DEC_CLK_GATE_E;
+ x = (g1[1] |= SW_DEC_E);
+ for(i = 0; i < 100; i++){
+ sleep(1);
+ if(g1[1] != x){
+ print("irq changed from 0x%ux to 0x%ux\n", x, g1[1]);
+ break;
+ }
}
- char *buswidth[] = {"ERROR", "32", "64", "128"};
- print(", %s bit\n", buswidth[(g1[50]>>12)&3]);
- print("cores: %d\n", 1+(g1[54]>>7)&7);
-
- print("g1: h.264=%d vp8=%d max_owidth=%d\n",
- !!(g1[57]&(1<<31)),
- (g1[54]&(1<<23)) && (g1[57]&(1<<20)),
- ((g1[54]>>14)&3)<<11 | g1[50]&((1<<11)-1)
- );
-
- print("g2: hevc=%d (main%d) vp9=%d (profile %d) downscale=%d max_owidth=%d max_oheight=%d\n",
- !!(g2[23]&(1<<0)),
- 8 + 2*((g2[23]>>8)&0xf),
- !!(g2[23]&(1<<1)),
- 0 + 2*((g2[23]>>12)&0xf),
- !!(g2[23]&(1<<3)),
- ((g2[54]>>14)&3)<<11 | g2[50]&((1<<11)-1),
- g2[56]&((1<<13)-1)
- );
-
- print("pp: exists=%d dithering=%d deinterlace=%d upscale=%d downscale=%d max_owidth=%d\n",
- !!(g1[99]&(1<<31)),
- !!(g1[100]&(1<<28)),
- (g1[100]&(1<<25)) && (g1[99]&(1<<30)),
- !!((g1[100]>>26)&3),
- ((g1[100]>>26)&3) == 3,
- g1[100]&((1<<13)-1)
- );
-
segdetach(g1);
- segdetach(g2);
exits(nil);
}