Questions tagged [sparc]

SPARC(Scalable Processor Architecture) Sun Microsystems's specific CPU.

SPARC is a RISC instruction set architecture (ISA) developed by Sun Microsystems (now merged into Oracle), introduced in mid-1987.

SPARC hardware often runs Solaris, the Unix operating system, but other OSes run on SPARC hardware, and runs on more than just SPARC hardware.

SPARC doesn't allow unaligned loads, so SIGBUS (bus error) faults are a common problem when porting C or C++ to SPARC from x86 (for example).

In assembly, SPARC's 32 architectural registers are a sliding window onto a virtual register file. The save instruction that slides the window might or might not spill to memory, depending on whether the CPU microarchitecture is out of registers when it runs.

287 questions
3
votes
5 answers

undefined reference to `__sync_val_compare_and_swap_4' error at compilation, using gcc 4.1.1 and 4.2.0 for Sparc v8 target

Using crosstool scripts i've built under Cygwin the following compilers gcc-4.1.1 and 4.2.0 20061024 (prerelease) for Sparc architecture: $ ./sparc-unknown-linux-gnu-gcc -v Using built-in specs. Target: sparc-unknown-linux-gnu Configured with:…
G-71
  • 3,626
  • 12
  • 45
  • 69
3
votes
2 answers

Specifying array in Assembler

I wanna specify a 512 x 32 bit array in my assembly file and this looks as follows: #define FUNCTION_01 test #define LABEL_01(name) .L ## test ## _ ## name .section ".data" my_array: .word 0x10101010 .word 0x20101010 .word…
Reini
  • 39
  • 1
  • 3
3
votes
1 answer

SPARC single-stepping mode

Is there a SPARC equivalent to x86's single step mode? What I want is to stop execution after every instruction and move control flow to a trap handler or something similar. I thought of using the ta instruction in the delayed execution slot but…
3
votes
2 answers

Question regarding disassembly output

I have a very simple test routine: void test() { int a = 15; int b = 17; int c, d; c = a + b; d = a | c; printf("%d", d); } I generate then the object file and then I disassemly the object file to see the instruction word for the ADD…
Jim
  • 41
  • 1
3
votes
4 answers

can't compile ffmpeg on Solaris 10 sparc

Has anyone compiled ffmpeg 0.6.1 for Solaris 10 sparc? I'm getting the following errors: uname -a SunOS SERVERNAME 5.10 Generic_118833-36 sun4u sparc SUNW,Sun-Fire-V440 bwddmadm@bwddmliv>/export/home/USERID/ffmpeg-0.6.1/configure…
Raoul
  • 3,849
  • 3
  • 24
  • 30
3
votes
1 answer

What's the best way to debug a segfault in my SPARC assembly?

I'm writing a sparc compiler. One of my test cases works fine when run from the command line normally, but segfaults when I redirect the output to a file. I've tried using GDB but it's difficult with assembly. How can I figure out something as…
Reed Morse
  • 1,398
  • 2
  • 10
  • 17
3
votes
2 answers

Is the SPARC architecture still relevant as a JIT compiler target on high-end servers?

X86 and AMD64 are the most important architectures for many computing environments (desktop, servers, and supercomputers). Obviously a JIT compiler should support both of them to gain acceptance. Until recently, the SPARC architecture was the…
Gabriel Cuvillier
  • 3,617
  • 1
  • 28
  • 35
3
votes
3 answers

Strcpy() corrupts the copied string in Solaris but not Linux

I'm writing a C code for a class. This class requires that our code compile and run on the school server, which is a sparc solaris machine. I'm running Linux x64. I have this line to parse (THIS IS NOT ACTUAL CODE BUT IS INPUT TO MY PROGRAM): while…
Dang Khoa
  • 5,693
  • 8
  • 51
  • 80
3
votes
1 answer

What is EM_SPARC32PLUS for?

I found that Linux and GNU Binutils define a special machine type EM_SPARC32PLUS in ELF header. Why is it needed? What makes SPARC V8+ so special that it can not use EM_SPARC? I think there should be an important reason for new machine type, because…
Marat Dukhan
  • 11,993
  • 4
  • 27
  • 41
3
votes
2 answers

SPARC and x86 GCC different result of one C code

One C code bring different result on “SPARC Solaris 5.9” and “Linux OpenSuse 12.1 i686 (x86)”. #include int main(int argc, char* argv[]) { char Cmd = '\x00'; char tmp[2]; char* TempBuff = &tmp; *(short*)TempBuff = (Cmd << 8) |…
Jarikus
  • 774
  • 8
  • 18
3
votes
1 answer

How to find largest power of 2 a number is divisible by using logic functions?

How do you find the largest power of 2 a number is divisible by using logic function for example 144 is divisible by 16 which is 2^4. How would one do this. I know 144 in binary is 1001 0000 and I have to use a bitwise function. But what would I…
3
votes
2 answers

Transfer programs from one architecture to another

Immediately warn you that this is a difficult task. There is a test. The test was the result of parsing a large problem to a bug in which we encountered at work. Construction __ attribute__((noinline)) prohibits the compiler to do the substitution…
Amazing User
  • 3,473
  • 10
  • 36
  • 75
3
votes
1 answer

Optimizing a loop in SPARC assembly

I'm trying to optimize this code in a way that is correct. What I mean by correct is... I would imagine there is a general approach to performing these optimizations such that if someone else looked at the code, they would be able to remove the…
3
votes
0 answers

Counting the number of digits in a 32-bit signed integer using base 2 returns 32 instead of 31

Part of an assignment for my systems programming class asks us to write an assembly module that returns the number of digits in a 32-bit integer given a base in the range of 2 to 36 inclusive. Everything works fine except for one case. When I use…
ffhaddad
  • 1,653
  • 13
  • 16
3
votes
1 answer

Bit field ordering on Big-Endian (SPARC) processor

Consider the code below: #include #include #define FORCE_CAST(var, type) *(type*)&var struct processor_status_register { unsigned int cwp:5; unsigned int et:1; unsigned int ps:1; unsigned int s:1; unsigned int pil:4; unsigned…
sherlock
  • 2,397
  • 3
  • 27
  • 44
1 2
3
19 20