arch/parisc/math-emu/fcnvfu.c
Source file repositories/reference/linux-study-clean/arch/parisc/math-emu/fcnvfu.c
File Facts
- System
- Linux kernel
- Corpus path
arch/parisc/math-emu/fcnvfu.c- Extension
.c- Size
- 11719 bytes
- Lines
- 524
- Domain
- Architecture Layer
- Bucket
- arch/parisc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
float.hsgl_float.hdbl_float.hcnv_float.h
Detected Declarations
function Copyrightfunction sgl_to_dbl_fcnvfufunction dbl_to_sgl_fcnvfufunction dbl_to_dbl_fcnvfu
Annotated Snippet
if (Sgl_isone_sign(src)) {
result = 0;
} else {
result = 0xffffffff;
}
if (Is_invalidtrap_enabled()) {
return(INVALIDEXCEPTION);
}
Set_invalidflag();
*dstptr = result;
return(NOEXCEPTION);
}
/*
* Generate result
*/
if (src_exponent >= 0) {
/*
* Check sign.
* If negative, trap unimplemented.
*/
if (Sgl_isone_sign(src)) {
result = 0;
if (Is_invalidtrap_enabled()) {
return(INVALIDEXCEPTION);
}
Set_invalidflag();
*dstptr = result;
return(NOEXCEPTION);
}
Sgl_clear_signexponent_set_hidden(src);
Suint_from_sgl_mantissa(src,src_exponent,result);
/* check for inexact */
if (Sgl_isinexact_to_unsigned(src,src_exponent)) {
inexact = TRUE;
/* round result */
switch (Rounding_mode()) {
case ROUNDPLUS:
result++;
break;
case ROUNDMINUS: /* never negative */
break;
case ROUNDNEAREST:
if (Sgl_isone_roundbit(src,src_exponent) &&
(Sgl_isone_stickybit(src,src_exponent) ||
(result & 1))) {
result++;
}
break;
}
}
} else {
result = 0;
/* check for inexact */
if (Sgl_isnotzero_exponentmantissa(src)) {
inexact = TRUE;
/* round result */
switch (Rounding_mode()) {
case ROUNDPLUS:
if (Sgl_iszero_sign(src)) {
result++;
}
break;
case ROUNDMINUS:
if (Sgl_isone_sign(src)) {
result = 0;
if (Is_invalidtrap_enabled()) {
return(INVALIDEXCEPTION);
}
Set_invalidflag();
inexact = FALSE;
}
break;
case ROUNDNEAREST:
if (src_exponent == -1 &&
Sgl_isnotzero_mantissa(src)) {
if (Sgl_isone_sign(src)) {
result = 0;
if (Is_invalidtrap_enabled()) {
return(INVALIDEXCEPTION);
}
Set_invalidflag();
inexact = FALSE;
}
else result++;
}
break;
}
}
Annotation
- Immediate include surface: `float.h`, `sgl_float.h`, `dbl_float.h`, `cnv_float.h`.
- Detected declarations: `function Copyright`, `function sgl_to_dbl_fcnvfu`, `function dbl_to_sgl_fcnvfu`, `function dbl_to_dbl_fcnvfu`.
- Atlas domain: Architecture Layer / arch/parisc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.